summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-11-14 12:53:06 (GMT)
committerBrad King <brad.king@kitware.com>2011-11-14 12:54:10 (GMT)
commita8f6159f69dbfdacf4d48ff26f21862d83fa7fd8 (patch)
treec5c376e71ae8e76280ce0fd075f66562b52f3e1d
parent33fff24aca46c4eca17997c42c5f62d71666b836 (diff)
downloadCMake-a8f6159f69dbfdacf4d48ff26f21862d83fa7fd8.zip
CMake-a8f6159f69dbfdacf4d48ff26f21862d83fa7fd8.tar.gz
CMake-a8f6159f69dbfdacf4d48ff26f21862d83fa7fd8.tar.bz2
KWIML: Create test output dir for Xcode
Xcode 2.x forgets to create the target output directory before linking the individual architecture pieces of a universal binary for the target KWIML_test. Then it passes the directory to -L and -F options when linking the and warns that the directory does not exist. We work around the problem by using a pre-build rule on the target to create the output directory.
-rw-r--r--test/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 15816cf..febc994 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -56,3 +56,13 @@ set_property(TARGET ${KWIML}_test PROPERTY
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_test(${KWIML}.test ${CMAKE_CURRENT_BINARY_DIR}/${KWIML}_test)
set_property(TEST ${KWIML}.test PROPERTY LABELS ${KWIML_LABELS_TEST})
+
+# Xcode 2.x forgets to create the output directory before linking
+# the individual architectures.
+if(CMAKE_OSX_ARCHITECTURES AND XCODE
+ AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
+ add_custom_command(
+ TARGET ${KWIML}_test
+ PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
+ )
+endif()