- Mac building should work fine now.
This commit is contained in:
		
							parent
							
								
									da94176985
								
							
						
					
					
						commit
						3aaffd3110
					
				| @ -21,11 +21,10 @@ endif (Source_OS STREQUAL Destination_OS) | |||||||
| message (STATUS "Locating platform specific file ${BuildScriptName}") | message (STATUS "Locating platform specific file ${BuildScriptName}") | ||||||
| 
 | 
 | ||||||
| # Locate the file. If it exists, start it | # Locate the file. If it exists, start it | ||||||
| find_file (BuildScriptFile "${BuildScriptName}" .) | if (EXISTS "${BuildScriptName}") | ||||||
| if (BuildScriptFile) |  | ||||||
| 	# Execute the build script | 	# Execute the build script | ||||||
| 	include (${BuildScriptName}) | 	include (${BuildScriptFile}) | ||||||
| else (BuildScriptFile) | else (EXISTS "${BuildScriptName}") | ||||||
| 	# Could not find it! | 	# Could not find it! | ||||||
| 	message (STATUS "Could not find ${BuildScriptName}") | 	message (STATUS "Could not find ${BuildScriptName}") | ||||||
| 	if (Source_OS STREQUAL Destination_OS) | 	if (Source_OS STREQUAL Destination_OS) | ||||||
| @ -33,5 +32,5 @@ else (BuildScriptFile) | |||||||
| 	else (Source_OS STREQUAL Destination_OS) | 	else (Source_OS STREQUAL Destination_OS) | ||||||
| 		message (FATAL_ERROR "Don't know how to build for ${Destination_OS} on ${Source_OS}") | 		message (FATAL_ERROR "Don't know how to build for ${Destination_OS} on ${Source_OS}") | ||||||
| 	endif (Source_OS STREQUAL Destination_OS) | 	endif (Source_OS STREQUAL Destination_OS) | ||||||
| endif (BuildScriptFile) | endif (EXISTS "${BuildScriptName}") | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -8,32 +8,33 @@ | |||||||
| find_program(lipoexecutable lipo) | find_program(lipoexecutable lipo) | ||||||
| if (lipoexecutable) | if (lipoexecutable) | ||||||
| 	# Check whether we already have the binaries | 	# Check whether we already have the binaries | ||||||
| 	set (requiredfiles false) | 	set (UBrequiredfiles FALSE) | ||||||
| 	find_file (ppcfile "scyther-macppc" .) | 	set (ppcfile	"${CMAKE_CURRENT_BINARY_DIR}/scyther-macppc") | ||||||
| 	if (ppcfile) | 	set (intelfile	"${CMAKE_CURRENT_BINARY_DIR}/scyther-macintel") | ||||||
| 		find_file (intelfile "scyther-macintel" .) | 	if (EXISTS "${ppcfile}") | ||||||
| 		if (intelfile) | 		if (EXISTS "${intelfile}") | ||||||
| 			set (requiredfiles true) | 			set (UBrequiredfiles TRUE) | ||||||
| 		else (intelfile) | 		else (EXISTS "${intelfile}") | ||||||
| 			message (FATAL_ERROR "Could not find scyther-macintel, which is required for the universal binary.") | 			message (STATUS "Could not find scyther-macintel.") | ||||||
| 		endif (intelfile) | 		endif (EXISTS "${intelfile}") | ||||||
| 	else (ppcfile) | 	else (EXISTS "${ppcfile}") | ||||||
| 		message (FATAL_ERROR "Could not find scyther-macppc, which is required for the universal binary.") | 		message (STATUS "Could not find scyther-macppc.") | ||||||
| 	endif (ppcfile) | 	endif (EXISTS "${ppcfile}") | ||||||
| 	 | 	 | ||||||
| 	# Use information to proceed | 	# Use information to proceed | ||||||
| 	if (requiredfiles) | 	if (UBrequiredfiles) | ||||||
| 		message (STATUS "Adding target for Mac universal binary") | 		message (STATUS "Adding target for Mac universal binary") | ||||||
| 		add_custom_target (scyther-mac | 		add_custom_target (scyther-mac | ||||||
| 			COMMAND	lipo -create ${ppcfile} ${intelfile} -output scyther-mac | 			COMMAND	lipo -create "${ppcfile}" "${intelfile}" -output scyther-mac | ||||||
|  | 			COMMENT	"Generating Mac universal binary" | ||||||
| 		) | 		) | ||||||
| 	else (requiredfiles) | 	else (UBrequiredfiles) | ||||||
| 		message (STATUS "No universal binary possible yet. Please do the following:") | 		message (STATUS "No universal binary possible yet. Please do the following:") | ||||||
| 		message (STATUS "  cmake -DTARGETOS=MacPPC   . && make") | 		message (STATUS "  cmake -DTARGETOS=MacPPC   . && make") | ||||||
| 		message (STATUS "  cmake -DTARGETOS=MacIntel . && make") | 		message (STATUS "  cmake -DTARGETOS=MacIntel . && make") | ||||||
| 		message (STATUS "  cmake . && make scyther-mac") | 		message (STATUS "  cmake . && make scyther-mac") | ||||||
| 	endif (requiredfiles) | 	endif (UBrequiredfiles) | ||||||
| else (lipoexecutable) | else (lipoexecutable) | ||||||
| 	message (FATAL_ERROR "Cannot find lipo program to create universal binaries") | 	message (FATAL_ERROR "Cannot find the 'lipo' program that is required for creating universal binaries") | ||||||
| endif (lipoexecutable) | endif (lipoexecutable) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user