hedgewars/CMakeLists.txt
branchcmake_pascal
changeset 8770 53481d654691
parent 8761 801cf78707f2
child 8775 3cad01db0bae
equal deleted inserted replaced
8767:54c770f91714 8770:53481d654691
   166     #when you have multiple ld installation make sure you get the one bundled with the compiler
   166     #when you have multiple ld installation make sure you get the one bundled with the compiler
   167     get_filename_component(compiler_dir ${CMAKE_C_COMPILER} PATH)
   167     get_filename_component(compiler_dir ${CMAKE_C_COMPILER} PATH)
   168     list(APPEND pascal_flags "-FD${compiler_dir}")
   168     list(APPEND pascal_flags "-FD${compiler_dir}")
   169 endif(APPLE)
   169 endif(APPLE)
   170 
   170 
   171 find_package_or_disable_msg(PNG NOPNG "Screenshots will be saved in BMP")
       
   172 if(PNG_FOUND)
       
   173     list(REMOVE_AT PNG_INCLUDE_DIR 1) #removing the zlib include path
       
   174     list(APPEND pascal_flags "-dPNG_SCREENSHOTS -Fl${PNG_INCLUDE_DIR}")
       
   175 endif()
       
   176 
       
   177 
       
   178 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   171 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   179 if(FREEPASCAL_VERSION VERSION_LESS "2.6")
   172 if(FREEPASCAL_VERSION VERSION_LESS "2.6")
   180     #under some configurations CMAKE_BUILD_TOOL fails to pass on the jobserver, breaking parallel compilation
   173     #under some configurations CMAKE_BUILD_TOOL fails to pass on the jobserver, breaking parallel compilation
   181     if(UNIX)
   174     if(UNIX)
   182         set(SAFE_BUILD_TOOL $(MAKE))
   175         set(SAFE_BUILD_TOOL $(MAKE))
   203     else()
   196     else()
   204         add_library(avwrapper STATIC avwrapper.c)
   197         add_library(avwrapper STATIC avwrapper.c)
   205     endif()
   198     endif()
   206 endif()
   199 endif()
   207 
   200 
   208 
   201 find_package_or_disable_msg(PNG NOPNG "Screenshots will be saved in BMP")
   209 set(CMAKE_Pascal_FLAGS " -vm4079,4080,4081 -Fl${PROJECT_BINARY_DIR}/bin -k-L${PROJECT_BINARY_DIR}/bin -Cs2000000 -vewnq -dDEBUGFILE")
   202 if(PNG_FOUND)
       
   203     get_filename_component(PNG_LIB_DIR ${PNG_LIBRARY} PATH)
       
   204     add_definitions(-dPNG_SCREENSHOTS -Fl${PNG_LIB_DIR})
       
   205 endif()
       
   206 
       
   207 
       
   208 set(CMAKE_Pascal_FLAGS "-vm4079,4080,4081 -Fl${PROJECT_BINARY_DIR}/bin -Cs2000000 -vewnq -dDEBUGFILE ${CMAKE_Pascal_FLAGS}")
   210 add_executable(hwengine ${engine_sources})
   209 add_executable(hwengine ${engine_sources})
   211 
   210 
   212 if(APPLE)
   211 if(APPLE)
   213     set(CMAKE_Pascal_FLAGS "-Px86_64  -k-llua -k${SDLMAIN_LIB} ${CMAKE_Pascal_FLAGS}")
   212     set(CMAKE_Pascal_FLAGS "-Px86_64  -k-llua -k${SDLMAIN_LIB} ${CMAKE_Pascal_FLAGS}")
   214 else()
   213 else()