if (BUILD_WSI_MIR_SUPPORT)
find_package(Mir REQUIRED)
endif()
+
+ # This option can be used to suppress the installation of artifacts from the
+ # Vulkan-LoaderAndValidationLayers repo while running "make install" for the
+ # VulkanTools and VulkanSamples repos. This can be used to prevent the
+ # overwriting of LVL artifacts when installing these downstream repos.
+ option(INSTALL_LVL_FILES "Install content from LoaderAndValidationLayers repo" ON)
endif()
set(SCRIPTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/scripts")
endif()
if(UNIX)
- install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ if(INSTALL_LVL_FILES)
+ install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ endif()
# uninstall target
configure_file(
# Add targets for JSON file install on Linux.
# Need to remove the "./" from the library path before installing to /etc.
if(UNIX)
- foreach (config_file ${LAYER_JSON_FILES})
- add_custom_target(${config_file}-staging-json ALL
- COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/staging-json
- COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/linux/${config_file}.json ${CMAKE_CURRENT_BINARY_DIR}/staging-json
- COMMAND sed -i -e "/\"library_path\":/s$./libVkLayer$libVkLayer$" ${CMAKE_CURRENT_BINARY_DIR}/staging-json/${config_file}.json
- VERBATIM
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/linux/${config_file}.json
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/staging-json/${config_file}.json DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/vulkan/explicit_layer.d)
- endforeach(config_file)
+ if(INSTALL_LVL_FILES)
+ foreach (config_file ${LAYER_JSON_FILES})
+ add_custom_target(${config_file}-staging-json ALL
+ COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/staging-json
+ COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/linux/${config_file}.json ${CMAKE_CURRENT_BINARY_DIR}/staging-json
+ COMMAND sed -i -e "/\"library_path\":/s$./libVkLayer$libVkLayer$" ${CMAKE_CURRENT_BINARY_DIR}/staging-json/${config_file}.json
+ VERBATIM
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/linux/${config_file}.json
+ )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/staging-json/${config_file}.json DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/vulkan/explicit_layer.d)
+ endforeach(config_file)
+ endif()
endif()
if (WIN32)
target_link_Libraries(VkLayer_${target} VkLayer_utils)
add_dependencies(VkLayer_${target} generate_helper_files VkLayer_utils)
set_target_properties(VkLayer_${target} PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic,--exclude-libs,ALL")
- install(TARGETS VkLayer_${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ if(INSTALL_LVL_FILES)
+ install(TARGETS VkLayer_${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
endmacro()
endif()
add_library(VkLayer_utils STATIC vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp vk_format_utils.cpp)
else()
add_library(VkLayer_utils SHARED vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp vk_format_utils.cpp)
- install(TARGETS VkLayer_utils DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ if(INSTALL_LVL_FILES)
+ install(TARGETS VkLayer_utils DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
endif()
add_dependencies(VkLayer_utils generate_helper_files)
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)
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()