add support for FPC and FPFLAGS cmake arguments (helps crosscompiling)
authorkoda
Mon, 07 May 2012 10:51:32 +0200
changeset 7029 efbe6400fc24
parent 7028 0f60591f3a16
child 7030 09984acadece
add support for FPC and FPFLAGS cmake arguments (helps crosscompiling)
CMakeLists.txt
hedgewars/CMakeLists.txt
--- a/CMakeLists.txt	Sat May 05 19:04:59 2012 +0100
+++ b/CMakeLists.txt	Mon May 07 10:51:32 2012 +0200
@@ -154,7 +154,8 @@
 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
 
-set(pascal_compiler_flags_cmn "-B" "-FE../bin" "-Cs2000000" "-vewn" ${pascal_compiler_flags_cmn})
+separate_arguments(FPFLAGSINT UNIX_COMMAND ${FPFLAGS})
+set(pascal_compiler_flags_cmn ${FPFLAGSINT} "-B" "-FE../bin" "-Cs2000000" "-vewn" ${pascal_compiler_flags_cmn})
 set(haskell_compiler_flags_cmn "-O2" ${haskell_compiler_flags_cmn})
 
 if(Optz)
--- a/hedgewars/CMakeLists.txt	Sat May 05 19:04:59 2012 +0100
+++ b/hedgewars/CMakeLists.txt	Mon May 07 10:51:32 2012 +0200
@@ -91,7 +91,11 @@
     endif (APPLE)
 endif(BUILD_ENGINE_LIBRARY)
 
-find_program(fpc_executable fpc)
+IF(FPC)
+    set(fpc_executable ${FPC})
+ELSE()
+    find_program(fpc_executable fpc)
+ENDIF()
 
 if(fpc_executable)
     exec_program(${fpc_executable} ARGS "-iV" OUTPUT_VARIABLE fpc_output)
@@ -138,7 +142,7 @@
         message(FATAL_ERROR "Minimum required version of FreePascal is 2.6.0 on Mac OS X")
     endif()
 else()
-    message(FATAL_ERROR "No Pascal compiler found!")
+    message(FATAL_ERROR "No FreePascal compiler found!")
 endif()