diff options
author | Brad King <brad.king@kitware.com> | 2015-08-27 14:03:58 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-08-27 14:03:58 (GMT) |
commit | ba6533e658f63d9446993882788f03263d32fe1b (patch) | |
tree | f940b55669166e2536bc4dd61b1dff9080e095db /Tests | |
parent | ef0bf87939d40c3a42129c82e3233fd9a27a5da8 (diff) | |
parent | 67f60958b61941264b0e2a63ad527dd346a6b1e3 (diff) | |
download | CMake-ba6533e658f63d9446993882788f03263d32fe1b.zip CMake-ba6533e658f63d9446993882788f03263d32fe1b.tar.gz CMake-ba6533e658f63d9446993882788f03263d32fe1b.tar.bz2 |
Merge topic 'apple-tbd-stubs'
67f60958 Darwin: Add support for tbd library stub files
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeTbdStub-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeTbdStub.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/osx.cmake | 18 |
4 files changed, 27 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index ef81739..1151abf 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -39,3 +39,9 @@ if(NOT XCODE_VERSION VERSION_LESS 5) unset(RunCMake_TEST_NO_CLEAN) unset(RunCMake_TEST_OPTIONS) endif() + +if(NOT XCODE_VERSION VERSION_LESS 7) + set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/osx.cmake") + run_cmake(XcodeTbdStub) + unset(RunCMake_TEST_OPTIONS) +endif() diff --git a/Tests/RunCMake/XcodeProject/XcodeTbdStub-stdout.txt b/Tests/RunCMake/XcodeProject/XcodeTbdStub-stdout.txt new file mode 100644 index 0000000..9d9e143 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeTbdStub-stdout.txt @@ -0,0 +1 @@ +.*/libz\.tbd.* diff --git a/Tests/RunCMake/XcodeProject/XcodeTbdStub.cmake b/Tests/RunCMake/XcodeProject/XcodeTbdStub.cmake new file mode 100644 index 0000000..e83d7f3 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeTbdStub.cmake @@ -0,0 +1,2 @@ +cmake_minimum_required(VERSION 3.3) +find_package(ZLIB REQUIRED) diff --git a/Tests/RunCMake/XcodeProject/osx.cmake b/Tests/RunCMake/XcodeProject/osx.cmake new file mode 100644 index 0000000..e021fcd --- /dev/null +++ b/Tests/RunCMake/XcodeProject/osx.cmake @@ -0,0 +1,18 @@ +set(CMAKE_SYSTEM_NAME Darwin) +set(CMAKE_SYSTEM_VERSION 1) +set(UNIX True) +set(APPLE True) + +find_program(XCRUN_EXECUTABLE xcrun) +if(NOT XCRUN_EXECUTABLE) + message(FATAL_ERROR "xcrun not found") +endif() + +execute_process( + COMMAND ${XCRUN_EXECUTABLE} --sdk macosx --show-sdk-path + OUTPUT_VARIABLE OSX_SDK_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE) + +set(CMAKE_OSX_SYSROOT ${OSX_SDK_PATH} CACHE PATH "Sysroot used for OSX support") + +set(CMAKE_FIND_ROOT_PATH ${OSX_SDK_PATH} CACHE PATH "Find search path root") |