aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Schuchardt <mikes@lunarg.com>2018-03-29 10:12:04 -0600
committerMike Schuchardt <mikes@lunarg.com>2018-03-29 13:32:59 -0600
commit249440ac0c67ed804dd1372ff1ce1f5127c83702 (patch)
tree8d1fef757d5a268319e5075c724c5644c7c076f8
parent73a0d20cca88014e0e479820edaa504528fe4488 (diff)
downloadusermoji-249440ac0c67ed804dd1372ff1ce1f5127c83702.tar.xz
tests: macOS CMake fixes for Xcode generator
Put icd and test layer json files in $<CONFIG> directory when using Xcode generator so layer tests can be executed and debugged from within Xcode. Change-Id: I079a89ea065ddeec98ce95766e284220c67b1859
-rw-r--r--icd/CMakeLists.txt23
1 files changed, 17 insertions, 6 deletions
diff --git a/icd/CMakeLists.txt b/icd/CMakeLists.txt
index 3fe467d5..44851bf7 100644
--- a/icd/CMakeLists.txt
+++ b/icd/CMakeLists.txt
@@ -55,12 +55,23 @@ if (WIN32)
elseif(APPLE)
# extra setup for out-of-tree builds
if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR))
- foreach (config_file ${ICD_JSON_FILES})
- add_custom_target(${config_file}-json ALL
- COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/macos/${config_file}.json
- VERBATIM
- )
- endforeach(config_file)
+ if (CMAKE_GENERATOR MATCHES "^Xcode.*")
+ add_custom_target(mk_icd_config_dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
+ foreach (config_file ${ICD_JSON_FILES})
+ add_custom_target(${config_file}-json ALL
+ DEPENDS mk_icd_config_dir
+ COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/macos/${config_file}.json $<CONFIG>
+ VERBATIM
+ )
+ endforeach(config_file)
+ else()
+ foreach (config_file ${ICD_JSON_FILES})
+ add_custom_target(${config_file}-json ALL
+ COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/macos/${config_file}.json
+ VERBATIM
+ )
+ endforeach(config_file)
+ endif()
endif()
else()
# extra setup for out-of-tree builds