Xcode: Add test for schema generation

Closes: #15441
This commit is contained in:
Gregor Jasny 2017-03-12 21:23:26 +01:00
parent cf13e49544
commit 3fd9f4ab05
2 changed files with 21 additions and 0 deletions

View File

@ -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()

View File

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.7)
project(XcodeSchemaGeneration CXX)
add_executable(foo main.cpp)