summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2017-03-12 20:23:26 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2017-03-12 20:27:53 (GMT)
commit3fd9f4ab0595f15588055fef1ad8dd8612945e22 (patch)
treeb5bde066806fcac446fc5cf1d94e29b29ffa17fb /Tests
parentcf13e495447662624c3389dc075fe48342f5e593 (diff)
downloadCMake-3fd9f4ab0595f15588055fef1ad8dd8612945e22.zip
CMake-3fd9f4ab0595f15588055fef1ad8dd8612945e22.tar.gz
CMake-3fd9f4ab0595f15588055fef1ad8dd8612945e22.tar.bz2
Xcode: Add test for schema generation
Closes: #15441
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)