From 3f68f5ece59190a62e5c430c00de4e3ce3d4310b Mon Sep 17 00:00:00 2001 From: ccremers Date: Mon, 8 Jan 2007 07:21:29 +0000 Subject: [PATCH] - Started towards cross-compilation. --- src/CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a97d014..0cb9d75 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,6 +29,39 @@ include (SVNVersion.cmake) # Make scanner and parser include (ScannerParser.cmake) -# Make the Scyther linux binary -add_executable (scyther-linux ${Scyther_sources}) +# By default, we build what we get +if (WIN32) + set (TARGETOS "WIN32") +else (WIN32) + if (APPLE) + set (TARGETOS "APPLE") + else (APPLE) + if (UNIX) + set (TARGETOS "UNIX") + endif (UNIX) + endif (APPLE) +endif (WIN32) + +# Determine name from type +if (${TARGETOS} STREQUAL "UNIX") + message (STATUS "Building Linux version") + set (scythername "scyther-linux") +endif (${TARGETOS} STREQUAL "UNIX") +if (${TARGETOS} STREQUAL "APPLE") + message (STATUS "Building Apple version") + set (scythername "scyther-mac") +endif (${TARGETOS} STREQUAL "APPLE") +if (${TARGETOS} STREQUAL "WIN32") + message (STATUS "Building W32 version") + set (scythername "scyther-w32") +endif (${TARGETOS} STREQUAL "WIN32") + +# Make the Scyther linux binary +if (scythername) + add_executable (${scythername} ${Scyther_sources}) +else (scythername) + message (FATAL_ERROR "Cannot determine target platform [${TARGETOS}]") +endif (scythername) + +