Xcode: Add unit test for iOS project install (#12506)

This commit is contained in:
Gregor Jasny 2015-08-15 22:37:35 +02:00
parent 48fe617e66
commit ad262917d9
4 changed files with 29 additions and 0 deletions

View File

@ -11,6 +11,20 @@ endif()
# Use a single build tree for a few tests without cleaning.
if(NOT XCODE_VERSION VERSION_LESS 5)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeInstallIOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_BINARY_DIR}/ios_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
run_cmake(XcodeInstallIOS)
run_cmake_command(XcodeInstallIOS-install ${CMAKE_COMMAND} --build . --target install)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesOSX-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS "-DTEST_IOS=OFF")

View File

@ -0,0 +1,2 @@
-- Install configuration: .*
-- Installing: .*/ios_install/lib/libfoo.a

View File

@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 2.8.5)
project(XcodeInstallIOS)
set(CMAKE_OSX_SYSROOT iphoneos)
set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
set(CMAKE_OSX_ARCHITECTURES "armv7;i386")
add_library(foo STATIC foo.cpp)
install(TARGETS foo ARCHIVE DESTINATION lib)

View File

@ -0,0 +1 @@
void foo() { }