hedgewars/CMakeLists.txt
changeset 8195 37d47f09f981
parent 8188 4c166505e5c8
child 8201 647c5d352bce
equal deleted inserted replaced
8193:10144ac42d1c 8195:37d47f09f981
   109 
   109 
   110 # Check Freepascal version
   110 # Check Freepascal version
   111 find_package(Freepascal)
   111 find_package(Freepascal)
   112 
   112 
   113 if (FPC_VERSION VERSION_LESS required_fpc_version)
   113 if (FPC_VERSION VERSION_LESS required_fpc_version)
   114     message(FATAL_ERROR "Necessary FPC version not found (required version = ${required_fpc_version})")
   114     message(FATAL_ERROR "Freepascal is too old, minimum version required is ${required_fpc_version}")
   115 else()
       
   116     message(STATUS "Found FPC: ${FPC_EXECUTABLE} (version ${FPC_VERSION})")
       
   117 endif()
   115 endif()
   118 
   116 
   119 
   117 
   120 #DEPENDECIES AND EXECUTABLES SECTION
   118 #DEPENDECIES AND EXECUTABLES SECTION
   121 if(APPLE)
   119 if(APPLE)
   163     message(STATUS "Screenshots will be in BMP format per user request")
   161     message(STATUS "Screenshots will be in BMP format per user request")
   164 endif()
   162 endif()
   165 
   163 
   166 
   164 
   167 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   165 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   168 if(FPC_VERSION LESS "020600")
   166 if(FPC_VERSION VERSION_LESS "2.6")
   169     #under some configurations CMAKE_BUILD_TOOL fails to pass on the jobserver, breaking parallel compilation
   167     #under some configurations CMAKE_BUILD_TOOL fails to pass on the jobserver, breaking parallel compilation
   170     #TODO: check if this is needed on windows too
       
   171     if(UNIX)
   168     if(UNIX)
   172         set(SAFE_BUILD_TOOL $(MAKE))
   169         set(SAFE_BUILD_TOOL $(MAKE))
   173     else()
   170     else()
   174         set(SAFE_BUILD_TOOL ${CMAKE_BUILD_TOOL})
   171         set(SAFE_BUILD_TOOL ${CMAKE_BUILD_TOOL})
   175     endif()
   172     endif()
   252 if(${FFMPEG_FOUND})
   249 if(${FFMPEG_FOUND})
   253     add_dependencies(${engine_output_name} avwrapper)
   250     add_dependencies(${engine_output_name} avwrapper)
   254 endif()
   251 endif()
   255 
   252 
   256 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   253 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   257 if((FPC_VERSION LESS "020600") AND (NOVIDEOREC OR NOT ${FFMPEG_FOUND}))
   254 if((FPC_VERSION VERSION_LESS "2.6") AND (NOVIDEOREC OR NOT ${FFMPEG_FOUND}))
   258     add_dependencies(${engine_output_name} ENGINECLEAN)
   255     add_dependencies(${engine_output_name} ENGINECLEAN)
   259 endif()
   256 endif()
   260 
   257 
   261 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})
   258 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir})