hedgewars/CMakeLists.txt
changeset 2672 0f1403bf267a
parent 2671 7e0f88013fe8
child 2673 2c847bcc951d
equal deleted inserted replaced
2671:7e0f88013fe8 2672:0f1403bf267a
     4 find_package(SDL_image)
     4 find_package(SDL_image)
     5 find_package(SDL_net)
     5 find_package(SDL_net)
     6 find_package(SDL_ttf)
     6 find_package(SDL_ttf)
     7 find_package(SDL_mixer)
     7 find_package(SDL_mixer)
     8 
     8 
       
     9 #find which version of SDL_image and SDL_mixer we have (for IMG_Init and Mix_Init)
       
    10 #if the headers are not installed, the newer apis won't be activated
       
    11 find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_LIBRARY})
       
    12 file(STRINGS ${sdlmixer_h} sdlmixer_version_tmp REGEX "SDL_MIXER_PATCHLEVEL[\t' ']+[0-9]+")
       
    13 string(REGEX MATCH ".([0-9]+)" sdlmixer_version "${sdlmixer_version_tmp}")
       
    14 
       
    15 if(sdlmixer_version GREATER 9)
       
    16 message(STATUS "Enabling enhanced SDL_Mixer calls")
       
    17 set(pascal_compiler_flags_cmn "-dSDL_MIXER_NEWER" ${pascal_compiler_flags_cmn})
       
    18 endif()
       
    19 
       
    20 find_file(sdlimage_h SDL_image.h ${SDLIMAGE_LIBRARY})
       
    21 file(STRINGS ${sdlimage_h} sdlimage_version_tmp REGEX "SDL_IMAGE_PATCHLEVEL[\t' ']+[0-9]+")
       
    22 string(REGEX MATCH ".([0-9]+)" sdlimage_version "${sdlimage_version_tmp}")
       
    23 
       
    24 if(sdlimage_version GREATER 7)
       
    25 message(STATUS "Enabling enhanced SDL_Image calls")
       
    26 set(pascal_compiler_flags_cmn "-dSDL_IMAGE_NEWER" ${pascal_compiler_flags_cmn})
       
    27 endif()
     9 
    28 
    10 #SOURCE AND PROGRAMS SECTION 
    29 #SOURCE AND PROGRAMS SECTION 
    11 set(fpc_tryexe fpc)
    30 set(fpc_tryexe fpc)
    12 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwengine.pas)
    31 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwengine.pas)
    13 
    32