2007-01-08 13:24:37 +00:00
|
|
|
################################################################
|
|
|
|
# Name: BuildPlatform.cmake
|
|
|
|
# Purpose: Make platform-dependant decisions
|
|
|
|
# Author: Cas Cremers
|
|
|
|
################################################################
|
|
|
|
|
2007-01-09 09:47:06 +00:00
|
|
|
# Add target for Universal Binary when needed
|
|
|
|
if (APPLE)
|
|
|
|
include (UniversalBinary.cmake)
|
|
|
|
endif (APPLE)
|
|
|
|
|
2007-01-08 13:24:37 +00:00
|
|
|
# Retrieve Source_OS, Destination_OS (from -DTARGET)
|
|
|
|
include (GetOS.cmake)
|
|
|
|
|
|
|
|
# From source_os and destination_os make a new name for the build script
|
|
|
|
if (Source_OS STREQUAL Destination_OS)
|
|
|
|
set (BuildScriptName "Build${Source_OS}.cmake")
|
|
|
|
else (Source_OS STREQUAL Destination_OS)
|
|
|
|
set (BuildScriptName "Build${Source_OS}-${Destination_OS}.cmake")
|
|
|
|
endif (Source_OS STREQUAL Destination_OS)
|
2007-01-08 13:41:39 +00:00
|
|
|
message (STATUS "Locating platform specific file ${BuildScriptName}")
|
|
|
|
|
|
|
|
# Locate the file. If it exists, start it
|
2007-01-09 10:55:39 +00:00
|
|
|
if (EXISTS "${BuildScriptName}")
|
2007-01-08 13:24:37 +00:00
|
|
|
# Execute the build script
|
2007-01-09 10:55:39 +00:00
|
|
|
include (${BuildScriptFile})
|
|
|
|
else (EXISTS "${BuildScriptName}")
|
2007-01-08 13:24:37 +00:00
|
|
|
# Could not find it!
|
|
|
|
message (STATUS "Could not find ${BuildScriptName}")
|
|
|
|
if (Source_OS STREQUAL Destination_OS)
|
|
|
|
message (FATAL_ERROR "Don't know how to build on ${Source_OS}")
|
|
|
|
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)
|
2007-01-09 10:55:39 +00:00
|
|
|
endif (EXISTS "${BuildScriptName}")
|
2007-01-08 13:24:37 +00:00
|
|
|
|