hedgewars/CMakeLists.txt
branchcmake_pascal
changeset 8852 0576439ef859
parent 8846 c156ac6ddc2b
child 8855 879270f627e0
equal deleted inserted replaced
8849:db108c851315 8852:0576439ef859
    12 
    12 
    13 enable_language(Pascal)
    13 enable_language(Pascal)
    14 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
    14 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
    15 include_directories(${CMAKE_CURRENT_BINARY_DIR})
    15 include_directories(${CMAKE_CURRENT_BINARY_DIR})
    16 
    16 
    17 if (APPLE)
       
    18     set(required_fpc_version 2.6)
       
    19 else()
       
    20     set(required_fpc_version 2.2)
       
    21 endif()
       
    22 
    17 
    23 set(engine_sources
    18 set(engine_sources
    24     SDLh.pas
    19     SDLh.pas
    25     uSinTable.pas
    20     uSinTable.pas
    26     uFloat.pas
    21     uFloat.pas
    90     )
    85     )
    91 
    86 
    92 
    87 
    93 include(${CMAKE_MODULE_PATH}/utils.cmake)
    88 include(${CMAKE_MODULE_PATH}/utils.cmake)
    94 
    89 
    95 find_package_or_fail(FreePascal)
    90 if (${CMAKE_Pascal_COMPILER_VERSION} VERSION_LESS 2.2 OR # older versions are just ancient
    96 
    91     (${CMAKE_Pascal_COMPILER_VERSION} VERSION_LESS 2.6 AND APPLE)) # because of 64bit and opengl bindings
    97 #when cmake-2.6 support is dropped, this ought to be inside FindFreePascal.cmake
    92     message(FATAL_ERROR "Your FreePascal installation is too old (fpc ${CMAKE_Pascal_COMPILER_VERSION})!")
    98 if (FREEPASCAL_VERSION VERSION_LESS required_fpc_version)
    93 elseif(CMAKE_Pascal_COMPILER_VERSION VERSION_GREATER 2.4)
    99     message(FATAL_ERROR "Freepascal ${FREEPASCAL_VERSION} is too old, minimum version required is ${required_fpc_version}")
       
   100 elseif(FREEPASCAL_VERSION VERSION_GREATER 2.4)
       
   101     #enable INLINE only with a recent version of fpc
    94     #enable INLINE only with a recent version of fpc
   102     add_flag_prepend(CMAKE_Pascal_FLAGS_RELEASE -Si)
    95     add_flag_prepend(CMAKE_Pascal_FLAGS_RELEASE -Si)
   103 endif()
    96 endif()
   104 
    97 
   105 
    98