summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-13 12:58:48 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-03-13 12:58:50 (GMT)
commit22908e4be83679deb32cf771df9d7793681814fd (patch)
treef2a8eee9d2122968ba6d121087fe29339a75dba4 /Tests
parentb46fa35824f2e8716032b3ec3201d0a0ee445f86 (diff)
parent3fd9f4ab0595f15588055fef1ad8dd8612945e22 (diff)
downloadCMake-22908e4be83679deb32cf771df9d7793681814fd.zip
CMake-22908e4be83679deb32cf771df9d7793681814fd.tar.gz
CMake-22908e4be83679deb32cf771df9d7793681814fd.tar.bz2
Merge topic 'xcode-test-schema-generation'
3fd9f4ab Xcode: Add test for schema generation cf13e495 Xcode: Control schema generation via variable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !577
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeSchemaGeneration.cmake5
2 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index f51a107..5f4bdc3 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -187,3 +187,19 @@ if(NOT XCODE_VERSION VERSION_LESS 5)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS)
endif()
+
+function(XcodeSchemaGeneration)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_XCODE_GENERATE_SCHEME=ON")
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(XcodeSchemaGeneration)
+ run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build)
+endfunction()
+
+if(NOT XCODE_VERSION VERSION_LESS 7)
+ XcodeSchemaGeneration()
+endif()
diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaGeneration.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaGeneration.cmake
new file mode 100644
index 0000000..2fe5a9f
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeSchemaGeneration.cmake
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.7)
+
+project(XcodeSchemaGeneration CXX)
+
+add_executable(foo main.cpp)