diff options
Diffstat (limited to 'Tests/RunCMake/XcodeProject/osx.cmake')
-rw-r--r-- | Tests/RunCMake/XcodeProject/osx.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
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") |