Subversion Repositories Scribus

Rev

Rev 24760 | Rev 24776 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
24760 craig 1
if(APPLE_12_00_X)
2
	set(OSXMINVER "12.00" CACHE STRING "OSX 12.00")
3
	if (WANT_OSX_SDK)
4
		if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk"))
5
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk")
6
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk"))
7
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk")
8
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk"))
9
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk")
10
		endif()
11
	endif()
12
endif()
23908 craig 13
if(APPLE_11_00_X)
14
	set(OSXMINVER "11.00" CACHE STRING "OSX 11.00")
15
	if (WANT_OSX_SDK)
24760 craig 16
		if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk"))
17
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk")
18
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk"))
24451 craig 19
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk")
20
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk"))
24233 craig 21
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk")
23908 craig 22
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"))
23
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk")
24
		endif()
25
	endif()
26
endif()
23128 craig 27
if(APPLE_10_15_X)
28
	set(OSXMINVER "10.15" CACHE STRING "OSX 10.15")
29
	if (WANT_OSX_SDK)
24233 craig 30
		if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk"))
31
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk")
32
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"))
23128 craig 33
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk")
34
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk"))
35
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk")
36
		endif()
37
	endif()
38
endif()
39
if(APPLE_10_14_X)
40
	set(OSXMINVER "10.14" CACHE STRING "OSX 10.14")
41
	if (WANT_OSX_SDK)
23207 craig 42
		if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"))
43
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk")
44
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk"))
23128 craig 45
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk")
46
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk"))
47
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk")
48
		endif()
49
	endif()
50
endif()
51
if(APPLE_10_13_X)
52
	set(OSXMINVER "10.13" CACHE STRING "OSX 10.13")
53
	if (WANT_OSX_SDK)
54
		if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk"))
55
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk")
56
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk"))
57
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk")
58
		endif()
59
	endif()
60
endif()
61
if(APPLE_10_12_X)
62
	set(OSXMINVER "10.12" CACHE STRING "OSX 10.12")
63
	if (WANT_OSX_SDK)
64
		if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk"))
65
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk")
66
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"))
67
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")
68
		endif()
69
	endif()
70
endif()
71
if(APPLE_10_11_X)
72
	set(OSXMINVER "10.11" CACHE STRING "OSX 10.11")
73
	if (WANT_OSX_SDK)
74
		set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")
75
	endif()
76
endif()
77
if(APPLE_10_10_X)
78
	set(OSXMINVER "10.10" CACHE STRING "OSX 10.10")
79
	set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10")
80
	if (WANT_OSX_SDK)
81
		if(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk"))
82
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk")
83
		elseif(EXISTS("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"))
84
			set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")
85
		endif()
86
	endif()
87
endif()
88
if(APPLE_10_9_X)
89
	set(OSXMINVER "10.9" CACHE STRING "OSX 10.9")
90
	if (WANT_OSX_SDK)
91
		set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
92
	endif()
93
endif()
94
if(APPLE_10_8_X)
95
	set(OSXMINVER "10.8" CACHE STRING "OSX 10.8")
96
	if (WANT_OSX_SDK)
97
		set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk")
98
	endif()
99
endif()
100
if(APPLE_10_7_X)
101
	set(OSXMINVER "10.7" CACHE STRING "OSX 10.7")
102
	if (WANT_OSX_SDK)
103
		set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk")
104
	endif()
105
endif()
106
if(APPLE_10_6_X)
107
	set(OSXMINVER "10.6" CACHE STRING "OSX 10.6")
108
	if (WANT_OSX_SDK)
109
		set(CMAKE_OSX_SYSROOT "/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk")
110
	endif()
111
endif()
112
if(APPLE_10_5_X)
113
	set(OSXMINVER "10.5" CACHE STRING "OSX 10.5")
114
	if (WANT_OSX_SDK)
115
		set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk")
116
	endif()
117
endif()
118
if(APPLE_10_4_X)
119
	set(OSXMINVER "10.4" CACHE STRING "OSX 10.4")
120
	if (WANT_OSX_SDK)
121
		set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk")
122
	endif()
123
endif()
124
# gcc/mac
125
if(WANT_UNIVERSAL_BUNDLE)
126
	message(STATUS "Setting Universal (PPC/i386) Architecture for OSX Build/Bundle")
127
	set(CMAKE_OSX_ARCHITECTURES "ppc;i386" )
128
	set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc;i386" )
129
	if (WANT_OSX_SDK)
130
		set(CMAKE_OSX_DEPLOYMENT_TARGET "10.4")
131
	endif()
132
else()
133
	if(ARCH_PPC OR ARCH_PPC_64)
134
		message(STATUS "Setting PPC Architecture for OSX Build/Bundle")
135
		set(CMAKE_OSX_ARCHITECTURES "ppc" )
136
		set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "ppc" )
24775 craig 137
	elseif(ARCH_ARM_64)
138
		message(STATUS "Setting ARM64 Architecture for OSX Build/Bundle")
139
		set(CMAKE_OSX_ARCHITECTURES "arm64" )
140
		set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "arm64" )
141
		if (WANT_OSX_SDK)
142
			set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSXMINVER}")
143
		endif()
23128 craig 144
	else()
145
		if (WANT_OSX_SDK)
146
			set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSXMINVER}")
147
		endif()
24760 craig 148
		if(APPLE_10_6_X OR APPLE_10_7_X OR APPLE_10_8_X OR APPLE_10_9_X OR APPLE_10_10_X OR APPLE_10_11_X OR APPLE_10_12_X OR APPLE_10_13_X OR APPLE_10_14_X OR APPLE_10_15_X OR APPLE_11_00_X OR APPLE_12_00_X)
23128 craig 149
			message(STATUS "Setting x86_64 Architecture for OSX Build/Bundle")
150
			set(CMAKE_OSX_ARCHITECTURES "x86_64" )
151
			set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "x86_64" )
152
		else()
153
			message(STATUS "Setting i386 Architecture for OSX Build/Bundle")
154
			set(CMAKE_OSX_ARCHITECTURES "i386" )
155
			set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES "i386" )
156
		endif()
157
	endif()
158
endif()
159
message(STATUS "Apple Architecture: ${CMAKE_OSX_ARCHITECTURES}")
160
message(STATUS "Apple SDK: ${CMAKE_OSX_SYSROOT}")
161
set(ENV{MACOSX_DEPLOYMENT_TARGET} ${OSXMINVER} )
162
set(ENV{LD_PREBIND} 1 )
163
set(ENV{LD_PREBIND_ALLOW_OVERLAP} 1 )
164
if (WANT_DEBUG)
165
	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
166
	set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
167
endif()
168
if (WANT_RELEASEWITHDEBUG)
169
	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
170
	set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O2 -g -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
171
endif()
172
if (NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
173
	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
174
	set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -fno-inline-functions -Wall -mmacosx-version-min=${OSXMINVER}")
175
endif()