- Mac building should work fine now.

This commit is contained in:
ccremers 2007-01-09 10:55:39 +00:00
parent da94176985
commit 3aaffd3110
2 changed files with 22 additions and 22 deletions

View File

@ -21,11 +21,10 @@ endif (Source_OS STREQUAL Destination_OS)
message (STATUS "Locating platform specific file ${BuildScriptName}")
# Locate the file. If it exists, start it
find_file (BuildScriptFile "${BuildScriptName}" .)
if (BuildScriptFile)
if (EXISTS "${BuildScriptName}")
# Execute the build script
include (${BuildScriptName})
else (BuildScriptFile)
include (${BuildScriptFile})
else (EXISTS "${BuildScriptName}")
# Could not find it!
message (STATUS "Could not find ${BuildScriptName}")
if (Source_OS STREQUAL Destination_OS)
@ -33,5 +32,5 @@ else (BuildScriptFile)
else (Source_OS STREQUAL Destination_OS)
message (FATAL_ERROR "Don't know how to build for ${Destination_OS} on ${Source_OS}")
endif (Source_OS STREQUAL Destination_OS)
endif (BuildScriptFile)
endif (EXISTS "${BuildScriptName}")

View File

@ -8,32 +8,33 @@
find_program(lipoexecutable lipo)
if (lipoexecutable)
# Check whether we already have the binaries
set (requiredfiles false)
find_file (ppcfile "scyther-macppc" .)
if (ppcfile)
find_file (intelfile "scyther-macintel" .)
if (intelfile)
set (requiredfiles true)
else (intelfile)
message (FATAL_ERROR "Could not find scyther-macintel, which is required for the universal binary.")
endif (intelfile)
else (ppcfile)
message (FATAL_ERROR "Could not find scyther-macppc, which is required for the universal binary.")
endif (ppcfile)
set (UBrequiredfiles FALSE)
set (ppcfile "${CMAKE_CURRENT_BINARY_DIR}/scyther-macppc")
set (intelfile "${CMAKE_CURRENT_BINARY_DIR}/scyther-macintel")
if (EXISTS "${ppcfile}")
if (EXISTS "${intelfile}")
set (UBrequiredfiles TRUE)
else (EXISTS "${intelfile}")
message (STATUS "Could not find scyther-macintel.")
endif (EXISTS "${intelfile}")
else (EXISTS "${ppcfile}")
message (STATUS "Could not find scyther-macppc.")
endif (EXISTS "${ppcfile}")
# Use information to proceed
if (requiredfiles)
if (UBrequiredfiles)
message (STATUS "Adding target for Mac universal binary")
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 " cmake -DTARGETOS=MacPPC . && make")
message (STATUS " cmake -DTARGETOS=MacIntel . && make")
message (STATUS " cmake . && make scyther-mac")
endif (requiredfiles)
endif (UBrequiredfiles)
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)