equal
deleted
inserted
replaced
72 endif() |
72 endif() |
73 |
73 |
74 #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on |
74 #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on |
75 #we need to provide the correct one when host and target differ |
75 #we need to provide the correct one when host and target differ |
76 if(NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version}) |
76 if(NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version}) |
77 string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" sdk_version ${minimum_macosx_version}) |
77 find_program(xcrun xcrun) |
78 set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${sdk_version}.sdk/") |
78 if(xcrun) |
79 add_flag_append(CMAKE_Pascal_FLAGS "-XR${CMAKE_OSX_SYSROOT}") |
79 execute_process(COMMAND ${xcrun} "--show-sdk-path" |
80 add_flag_append(CMAKE_Pascal_FLAGS "-k-macosx_version_min -k${minimum_macosx_version}") |
80 OUTPUT_VARIABLE current_sdk_path |
|
81 OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
82 string(REPLACE "${current_macosx_version}" |
|
83 "${minimum_macosx_version}" |
|
84 CMAKE_OSX_SYSROOT |
|
85 "${current_sdk_path}") |
|
86 |
|
87 add_flag_append(CMAKE_Pascal_FLAGS "-XR${CMAKE_OSX_SYSROOT}") |
|
88 add_flag_append(CMAKE_Pascal_FLAGS "-k-macosx_version_min -k${minimum_macosx_version}") |
|
89 else() |
|
90 message("*** xcrun not found! Build will work on ${current_macosx_version} only ***") |
|
91 endif() |
81 endif() |
92 endif() |
82 |
93 |
83 #add user framework directory |
94 #add user framework directory |
84 add_flag_append(CMAKE_Pascal_FLAGS "-Ff~/Library/Frameworks") |
95 add_flag_append(CMAKE_Pascal_FLAGS "-Ff~/Library/Frameworks") |
85 |
96 |