# HG changeset patch # User koda # Date 1336380692 -7200 # Node ID efbe6400fc24ba8dcd8e864bc11faa697a9c85ed # Parent 0f60591f3a16e66616c849e51aa362031b826d8c add support for FPC and FPFLAGS cmake arguments (helps crosscompiling) diff -r 0f60591f3a16 -r efbe6400fc24 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) diff -r 0f60591f3a16 -r efbe6400fc24 hedgewars/CMakeLists.txt --- 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()