hedgewars/CMakeLists.txt
branchcmake_pascal
changeset 8798 03d113d51062
parent 8790 783669d76b4f
child 8802 ed984e06b435
equal deleted inserted replaced
8796:8ab4ef8b70f6 8798:03d113d51062
    19 
    19 
    20 enable_language(Pascal)
    20 enable_language(Pascal)
    21 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
    21 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
    22 
    22 
    23 #SOURCE AND PROGRAMS SECTION
    23 #SOURCE AND PROGRAMS SECTION
    24 #if(${BUILD_ENGINE_LIBRARY})
    24 if(${BUILD_ENGINE_LIBRARY})
    25 #    set(engine_output_name "${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}")
    25     set(engine_output_name "${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}")
    26 #    set(hwengine_project hwLibrary.pas)
    26     set(hwengine_project hwLibrary.pas)
    27 #else()
    27 else()
    28 #    set(engine_output_name "hwengine${CMAKE_EXECUTABLE_SUFFIX}")
    28     set(engine_output_name "hwengine${CMAKE_EXECUTABLE_SUFFIX}")
    29 #    set(hwengine_project hwengine.pas)
    29 endif()
    30 #endif()
       
    31 
    30 
    32 if (APPLE)
    31 if (APPLE)
    33     set(required_fpc_version 2.6)
    32     set(required_fpc_version 2.6)
    34 else()
    33 else()
    35     set(required_fpc_version 2.2)
    34     set(required_fpc_version 2.2)
   174     add_definitions(-dPNG_SCREENSHOTS)
   173     add_definitions(-dPNG_SCREENSHOTS)
   175     add_flag_append(CMAKE_Pascal_FLAGS -Fl${PNG_LIB_DIR})
   174     add_flag_append(CMAKE_Pascal_FLAGS -Fl${PNG_LIB_DIR})
   176 endif()
   175 endif()
   177 
   176 
   178 if(NOT LUA_FOUND)
   177 if(NOT LUA_FOUND)
       
   178     add_flag_append(CMAKE_Pascal_FLAGS -k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a)
   179     #linking with liblua.a requires system readline
   179     #linking with liblua.a requires system readline
   180     add_flag_append(CMAKE_Pascal_FLAGS "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a -k-lreadline")
   180     if(UNIX)
       
   181         add_flag_append(CMAKE_Pascal_FLAGS -k-lreadline)
       
   182     endif(UNIX)
   181 endif()
   183 endif()
   182 
   184 
   183 if(NOT PHYSFS_FOUND)
   185 if(NOT PHYSFS_FOUND)
   184     #-XLA is a beta fpc flag that renames libraries before passing them to the linker
   186     #-XLA is a beta fpc flag that renames libraries before passing them to the linker
   185     #we also have to pass PHYSFS_INTERNAL to satisfy windows runtime requirements
   187     #we also have to pass PHYSFS_INTERNAL to satisfy windows runtime requirements
   221 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   223 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   222 #if((FREEPASCAL_VERSION VERSION_LESS "2.6") AND (NOT ${FFMPEG_FOUND}))
   224 #if((FREEPASCAL_VERSION VERSION_LESS "2.6") AND (NOT ${FFMPEG_FOUND}))
   223 #    add_dependencies(hwengine ENGINECLEAN)
   225 #    add_dependencies(hwengine ENGINECLEAN)
   224 #endif()
   226 #endif()
   225 
   227 
   226 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine" DESTINATION ${destination_dir})
   228 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}" DESTINATION ${destination_dir})