From 22ace14fa8156031875c60c302358dcccc1e1b6e Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Mon, 12 Jun 2017 11:23:57 -0600 Subject: build: Add CMake flag to suppress LVL content Add CMake flag INSTALL_LVL_FILES (default ON) that when set to OFF, suppresses the installation of LVL artifacts when running "make install" on Linux. This flag doesn't have much use in the LVL repo because when turned off, CMake won't generate an install target in the makefiles. However, for the downstream VulkanTools and VulkanSamples repos, it can be useful to avoid installing LVL files on top of files that may have already been installed from a previous "make install" installation of the LVL repo. An example of such a use case would be the desire to have a more up-to-date version of LVL on the system than the one last merged into the downstream repo. This new flag is meant to address the need mentioned in LVL Pull Request #1844. Change-Id: I421f37ea4e885fbf0a268eff363a28f0537b1953 --- loader/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'loader') diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index d15f09cc..7303f594 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -145,7 +145,9 @@ else() set_target_properties(${API_LOWERCASE} PROPERTIES SOVERSION "1" VERSION "1.0.${vk_header_version}") target_link_libraries(${API_LOWERCASE} -ldl -lpthread -lm) - install(TARGETS ${API_LOWERCASE} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + if(INSTALL_LVL_FILES) + install(TARGETS ${API_LOWERCASE} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() # Generate pkg-config file. include(FindPkgConfig QUIET) @@ -155,7 +157,9 @@ else() set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}") endforeach() configure_file("vulkan.pc.in" "vulkan.pc" @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vulkan.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + if(INSTALL_LVL_FILES) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vulkan.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif() endif() endif() -- cgit v1.2.3