summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2016-12-26 17:01:32 (GMT)
committerBrad King <brad.king@kitware.com>2017-01-26 18:34:58 (GMT)
commitd525754eabef7a9f6e6696ae323a8ed965e12f2e (patch)
tree0f0e9876554349138907cd6fc9793e2f3e5a9b37 /Tests/RunCMake
parent45405f00d27031fb9641408c56673532a3ee3bde (diff)
downloadCMake-d525754eabef7a9f6e6696ae323a8ed965e12f2e.zip
CMake-d525754eabef7a9f6e6696ae323a8ed965e12f2e.tar.gz
CMake-d525754eabef7a9f6e6696ae323a8ed965e12f2e.tar.bz2
Xcode: Refactor RunCMake.Framework test to prepare for static frameworks
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Framework/RunCMakeTest.cmake48
2 files changed, 18 insertions, 33 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c2c744f..63016f1 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -276,8 +276,7 @@ if(XCODE_VERSION AND NOT "${XCODE_VERSION}" VERSION_LESS 3)
add_RunCMake_test(XcodeProject -DXCODE_VERSION=${XCODE_VERSION})
endif()
-if(NOT XCODE
- AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
+if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)
add_RunCMake_test(Framework)
endif()
diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake
index eeea6f1..1f7d54e 100644
--- a/Tests/RunCMake/Framework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake
@@ -1,33 +1,19 @@
include(RunCMake)
-# iOS
-
-set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/iOSFrameworkLayout-build)
-set(RunCMake_TEST_NO_CLEAN 1)
-set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/ios.cmake")
-
-file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
-file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
-
-run_cmake(FrameworkLayout)
-run_cmake_command(iOSFrameworkLayout-build ${CMAKE_COMMAND} --build .)
-
-unset(RunCMake_TEST_BINARY_DIR)
-unset(RunCMake_TEST_NO_CLEAN)
-unset(RunCMake_TEST_OPTIONS)
-
-# OSX
-
-set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/OSXFrameworkLayout-build)
-set(RunCMake_TEST_NO_CLEAN 1)
-set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/osx.cmake")
-
-file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
-file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
-
-run_cmake(FrameworkLayout)
-run_cmake_command(OSXFrameworkLayout-build ${CMAKE_COMMAND} --build .)
-
-unset(RunCMake_TEST_BINARY_DIR)
-unset(RunCMake_TEST_NO_CLEAN)
-unset(RunCMake_TEST_OPTIONS)
+function(framework_layout_test Name Toolchain)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${Toolchain}FrameworkLayout-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/${Toolchain}.cmake")
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(FrameworkLayout)
+ run_cmake_command(${Name} ${CMAKE_COMMAND} --build .)
+endfunction()
+
+# build check cannot cope with multi-configuration generators directory layout
+if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
+ framework_layout_test(iOSFrameworkLayout-build ios)
+ framework_layout_test(OSXFrameworkLayout-build osx)
+endif()