diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2017-12-05 16:41:25 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-12-06 08:38:30 -0700 |
| commit | 7e46a5a0f95dc143b092ecf92e811b1d499b64d5 (patch) | |
| tree | cbd47cc895b2039c2735d6e4388adf595664568d /layers | |
| parent | 57fb625663db6fe1d11c6fa0f6047b29695aac78 (diff) | |
| download | usermoji-7e46a5a0f95dc143b092ecf92e811b1d499b64d5.tar.xz | |
cmake: Fix layers/icd cmake files for in-tree builds
See Github #2243.
Change-Id: I40119c73a1518357df4360654c888b8306aa94d8
Diffstat (limited to 'layers')
| -rw-r--r-- | layers/CMakeLists.txt | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt index 9c7096fd..80fa6f23 100644 --- a/layers/CMakeLists.txt +++ b/layers/CMakeLists.txt @@ -48,7 +48,6 @@ set(LAYER_BINARY_FILES ) if (WIN32) - if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) if (CMAKE_GENERATOR MATCHES "^Visual Studio.*") foreach (config_file ${LAYER_JSON_FILES}) FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/windows/${config_file}.json src_json) @@ -68,6 +67,7 @@ if (WIN32) ) endforeach(config_file) endif() + if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)) # Copy vk_validation_error_messages.h from source to build dir for scripts to pick up FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/vk_validation_error_messages.h src_val_msgs) FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/vk_validation_error_messages.h dst_val_msgs) @@ -105,20 +105,22 @@ else() endif() endif() # If a layer has a direct dependency on a project with the same name, use it. -foreach (config_file ${LAYER_JSON_FILES_WITH_DEPENDENCIES}) - add_dependencies(${config_file}-json ${config_file}) -endforeach(config_file) -# If a layer has no direct dependencies, give it one so it copies in the proper order -foreach (config_file ${LAYER_JSON_FILES_NO_DEPENDENCIES}) - add_dependencies(${config_file}-json VkLayer_utils) -endforeach(config_file) -if(UNIX) - foreach (config_file ${LAYER_BINARY_JSON_FILES}) - add_dependencies(${config_file}-json VkLayer_utils) +if ((Win32) OR (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR))) + foreach (config_file ${LAYER_JSON_FILES_WITH_DEPENDENCIES}) + add_dependencies(${config_file}-json ${config_file}) endforeach(config_file) - foreach (config_file ${LAYER_BINARY_FILES}) - add_dependencies(${config_file}-so VkLayer_utils) + # If a layer has no direct dependencies, give it one so it copies in the proper order + foreach (config_file ${LAYER_JSON_FILES_NO_DEPENDENCIES}) + add_dependencies(${config_file}-json VkLayer_utils) endforeach(config_file) + if(UNIX) + foreach (config_file ${LAYER_BINARY_JSON_FILES}) + add_dependencies(${config_file}-json VkLayer_utils) + endforeach(config_file) + foreach (config_file ${LAYER_BINARY_FILES}) + add_dependencies(${config_file}-so VkLayer_utils) + endforeach(config_file) + endif() endif() # Add targets for JSON file install on Linux. |
