50 set(CMAKE_OSX_ARCHITECTURES "i386") |
50 set(CMAKE_OSX_ARCHITECTURES "i386") |
51 endif() |
51 endif() |
52 endif() |
52 endif() |
53 endif() |
53 endif() |
54 |
54 |
|
55 #parse this system variable and adjust only the powerpc syntax to be compatible with -P |
|
56 if(CMAKE_OSX_ARCHITECTURES) |
|
57 string(REGEX MATCH "[pP][pP][cC]+" powerpc_build "${CMAKE_OSX_ARCHITECTURES}") |
|
58 string(REGEX MATCH "[iI]386+" i386_build "${CMAKE_OSX_ARCHITECTURES}") |
|
59 string(REGEX MATCH "[xX]86_64+" x86_64_build "${CMAKE_OSX_ARCHITECTURES}") |
|
60 if(x86_64_build) |
|
61 add_flag_prepend(CMAKE_Pascal_FLAGS -Px86_64) |
|
62 elseif(i386_build) |
|
63 add_flag_prepend(CMAKE_Pascal_FLAGS -Pi386) |
|
64 elseif(powerpc_build) |
|
65 add_flag_prepend(CMAKE_Pascal_FLAGS -Ppowerpc) |
|
66 else() |
|
67 message(FATAL_ERROR "Unknown architecture present in CMAKE_OSX_ARCHITECTURES (${CMAKE_OSX_ARCHITECTURES})") |
|
68 endif() |
|
69 list(LENGTH CMAKE_OSX_ARCHITECTURES num_of_archs) |
|
70 if(num_of_archs GREATER 1) |
|
71 message(${WARNING} "Only one architecture in CMAKE_OSX_ARCHITECTURES is currently supported, picking the first one") |
|
72 endif() |
|
73 elseif(CMAKE_SIZEOF_VOID_P MATCHES "8") |
|
74 #if that variable is not set check if we are on x86_64 and if so force it, else use default |
|
75 add_flag_prepend(CMAKE_Pascal_FLAGS -Px86_64) |
|
76 endif() |
|
77 |
55 #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on |
78 #CMAKE_OSX_SYSROOT is set at the system version we are supposed to build on |
56 #we need to provide the correct one when host and target differ |
79 #we need to provide the correct one when host and target differ |
57 if(NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version}) |
80 if(NOT ${minimum_macosx_version} VERSION_EQUAL ${current_macosx_version}) |
58 if(minimum_macosx_version VERSION_EQUAL "10.4") |
81 if(minimum_macosx_version VERSION_EQUAL "10.4") |
59 set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/") |
82 set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/") |