From 249440ac0c67ed804dd1372ff1ce1f5127c83702 Mon Sep 17 00:00:00 2001 From: Mike Schuchardt Date: Thu, 29 Mar 2018 10:12:04 -0600 Subject: tests: macOS CMake fixes for Xcode generator Put icd and test layer json files in $ directory when using Xcode generator so layer tests can be executed and debugged from within Xcode. Change-Id: I079a89ea065ddeec98ce95766e284220c67b1859 --- icd/CMakeLists.txt | 23 +++++++++++++++++------ 1 file 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}/$) + 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 $ + 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 -- cgit v1.2.3