aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Ramos <juan@lunarg.com>2023-10-05 14:47:32 -0600
committerJuan Ramos <114601453+juan-lunarg@users.noreply.github.com>2023-10-05 15:01:08 -0600
commit066a1982b249594d17d59b13cb0c1ccee526290a (patch)
treedcdc7b4950ee9758672f5361f78b1d722bffe6b6
parent6807aa519f950375f08b18d319eb0dc5fd25e58c (diff)
downloadusermoji-066a1982b249594d17d59b13cb0c1ccee526290a.tar.xz
cmake: Simplify INSTALL_ICD logic
-rw-r--r--icd/CMakeLists.txt26
1 files changed, 12 insertions, 14 deletions
diff --git a/icd/CMakeLists.txt b/icd/CMakeLists.txt
index f908906c..b3a2ca14 100644
--- a/icd/CMakeLists.txt
+++ b/icd/CMakeLists.txt
@@ -89,13 +89,6 @@ if (DEFINED GIT_BRANCH_NAME AND DEFINED GIT_TAG_INFO)
target_compile_definitions(VkICD_mock_icd PRIVATE GIT_BRANCH_NAME="${GIT_BRANCH_NAME}" GIT_TAG_INFO="${GIT_TAG_INFO}")
endif()
-# Installing the Mock ICD to system directories is probably not desired since this ICD is not a very complete implementation.
-# Require the user to ask that it be installed if they really want it.
-option(INSTALL_ICD "Install icd")
-if (INSTALL_ICD)
- message(STATUS "Installing Mock ICD")
-endif()
-
# There are 2 primary deliverables for the mock driver.
# - The actual library (lib)VkICD_mock_icd.(dll|so|dylib)
# - The respective json file, VkICD_mock_icd.json
@@ -124,6 +117,15 @@ add_custom_command(TARGET VkICD_mock_icd POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INTERMEDIATE_FILE} $<TARGET_FILE_DIR:VkICD_mock_icd>/${OUTPUT_FILE_FINAL_NAME}
)
+# Installing the Mock ICD to system directories is probably not desired since this ICD is not a very complete implementation.
+# Require the user to ask that it be installed if they really want it.
+option(INSTALL_ICD "Install Mock icd")
+if (INSTALL_ICD)
+ message(NOTICE "Installing Mock ICD")
+else()
+ return()
+endif()
+
# For UNIX-based systems, `library_path` should not contain a relative path (indicated by "./") before installing to system directories
# This json isn't used for regular local development, it's used for installation
if (UNIX)
@@ -137,15 +139,11 @@ if (UNIX)
configure_file(${INPUT_FILE} ${UNIX_INTERMEDIATE_FILE} @ONLY)
- if (INSTALL_ICD)
- install(FILES ${UNIX_INTERMEDIATE_FILE} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/vulkan/icd.d RENAME ${OUTPUT_FILE_FINAL_NAME})
- endif()
+ install(FILES ${UNIX_INTERMEDIATE_FILE} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/vulkan/icd.d RENAME ${OUTPUT_FILE_FINAL_NAME})
endif()
-if (WIN32 AND INSTALL_ICD)
+if (WIN32)
install(FILES ${INTERMEDIATE_FILE} DESTINATION ${LAYER_INSTALL_DIR} RENAME ${OUTPUT_FILE_FINAL_NAME})
endif()
-if (INSTALL_ICD)
- install(TARGETS VkICD_mock_icd DESTINATION ${LAYER_INSTALL_DIR})
-endif()
+install(TARGETS VkICD_mock_icd DESTINATION ${LAYER_INSTALL_DIR})