this should make cmake-pascal stuff work on linux too cmake_pascal
authorkoda
Mon, 18 Mar 2013 10:06:07 +0100
branchcmake_pascal
changeset 8754 0c08d07e791a
parent 8752 48cf2ccb83c6
child 8756 671f6ef4f7f1
this should make cmake-pascal stuff work on linux too
cmake_modules/CMakeDeterminePascalCompiler.cmake
cmake_modules/CMakePascalInformation.cmake
cmake_modules/CMakeTestPascalCompiler.cmake
hedgewars/CMakeLists.txt
--- a/cmake_modules/CMakeDeterminePascalCompiler.cmake	Mon Mar 18 02:07:58 2013 +0100
+++ b/cmake_modules/CMakeDeterminePascalCompiler.cmake	Mon Mar 18 10:06:07 2013 +0100
@@ -55,7 +55,7 @@
 # configure variables set in this file for fast reload later on
 #CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakePascalCompiler.cmake.in
 CONFIGURE_FILE(${CMAKE_MODULE_PATH}/CMakePascalCompiler.cmake.in
-               "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${CMAKE_VERSION}/CMakePascalCompiler.cmake"
+               "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakePascalCompiler.cmake"
                IMMEDIATE)
 MARK_AS_ADVANCED(CMAKE_AR)
 
--- a/cmake_modules/CMakePascalInformation.cmake	Mon Mar 18 02:07:58 2013 +0100
+++ b/cmake_modules/CMakePascalInformation.cmake	Mon Mar 18 10:06:07 2013 +0100
@@ -174,7 +174,10 @@
 
 IF(NOT CMAKE_Pascal_LINK_EXECUTABLE)
 #GET_FILENAME_COMPONENT(COMPILER_LOCATION "${CMAKE_Pascal_COMPILER}" PATH)
-    message("look here ${CMAKE_CURRENT_BINARY_DIR}")
+    if (NOT EXECUTABLE_OUTPUT_PATH)
+       set (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
+    endif()
+    message("look here ${CMAKE_CURRENT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH}")
     set(CMAKE_Pascal_LINK_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/ppas.sh")
 #  SET(CMAKE_Pascal_LINK_EXECUTABLE "${CMAKE_Pascal_COMPILER} <CMAKE_Ada_LINK_FLAGS> <LINK_FLAGS> <TARGET_BASE>.adb -cargs <FLAGS> -largs <LINK_LIBRARIES>")
 ENDIF(NOT CMAKE_Pascal_LINK_EXECUTABLE)
--- a/cmake_modules/CMakeTestPascalCompiler.cmake	Mon Mar 18 02:07:58 2013 +0100
+++ b/cmake_modules/CMakeTestPascalCompiler.cmake	Mon Mar 18 10:06:07 2013 +0100
@@ -6,10 +6,9 @@
 
 IF(NOT CMAKE_Pascal_COMPILER_WORKS)
   MESSAGE(STATUS "Check for working Pascal compiler: ${CMAKE_Pascal_COMPILER}")
-  FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testpascalcompiler.pas
+  FILE(WRITE ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/testpascalcompiler.pas
   "program testPascalCompiler;
    begin
-
    end.
   ")
 
--- a/hedgewars/CMakeLists.txt	Mon Mar 18 02:07:58 2013 +0100
+++ b/hedgewars/CMakeLists.txt	Mon Mar 18 10:06:07 2013 +0100
@@ -204,9 +204,14 @@
 endif()
 
 
-set(CMAKE_Pascal_FLAGS "-B -FE${PROJECT_BINARY_DIR}/bin -FU${PROJECT_BINARY_DIR}/hedgewars -vm4079,4080,4081 -Fl${PROJECT_BINARY_DIR}/bin -Px86_64   -Fi${PROJECT_BINARY_DIR}/hedgewars -k-L${PROJECT_BINARY_DIR}/bin -Cs2000000 -vewnq -dDEBUGFILE -k-llua -k${SDLMAIN_LIB}")
+set(CMAKE_Pascal_FLAGS "-B -FE${PROJECT_BINARY_DIR}/bin -FU${PROJECT_BINARY_DIR}/hedgewars -vm4079,4080,4081 -Fl${PROJECT_BINARY_DIR}/bin    -Fi${PROJECT_BINARY_DIR}/hedgewars -k-L${PROJECT_BINARY_DIR}/bin -Cs2000000 -vewnq -dDEBUGFILE")
 add_executable(hwengine hwengine.pas)
 
+if(APPLE)
+    set(CMAKE_Pascal_FLAGS "-Px86_64  -k-llua -k${SDLMAIN_LIB} ${CMAKE_Pascal_FLAGS}")
+else()
+    set(CMAKE_Pascal_FLAGS "-Pi386 ${CMAKE_Pascal_FLAGS}")
+endif()
 set(fpc_flags ${pascal_flags} ${hwengine_project})
 
 #add_custom_target(hwengine ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}")