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) |
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 |
10 #if the headers are not installed, the newer apis won't be activated |
11 find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_LIBRARY}) |
11 find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_INCLUDE_DIR}) |
|
12 if(sdlmixer_h) |
12 file(STRINGS ${sdlmixer_h} sdlmixer_version_tmp REGEX "SDL_MIXER_PATCHLEVEL[\t' ']+[0-9]+") |
13 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 string(REGEX MATCH ".([0-9]+)" sdlmixer_version "${sdlmixer_version_tmp}") |
14 |
15 |
15 if(sdlmixer_version GREATER 9) |
16 if(sdlmixer_version GREATER 9) |
16 message(STATUS "Enabling enhanced SDL_Mixer calls") |
17 message(STATUS "Enabling enhanced SDL_Mixer calls") |
17 set(pascal_compiler_flags_cmn "-dSDL_MIXER_NEWER" ${pascal_compiler_flags_cmn}) |
18 set(pascal_compiler_flags_cmn "-dSDL_MIXER_NEWER" ${pascal_compiler_flags_cmn}) |
18 endif() |
19 endif() |
|
20 endif() |
19 |
21 |
20 find_file(sdlimage_h SDL_image.h ${SDLIMAGE_LIBRARY}) |
22 find_file(sdlimage_h SDL_image.h ${SDLIMAGE_INCLUDE_DIR}) |
|
23 if(sdlimage_h) |
21 file(STRINGS ${sdlimage_h} sdlimage_version_tmp REGEX "SDL_IMAGE_PATCHLEVEL[\t' ']+[0-9]+") |
24 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}") |
25 string(REGEX MATCH ".([0-9]+)" sdlimage_version "${sdlimage_version_tmp}") |
23 |
26 |
24 if(sdlimage_version GREATER 7) |
27 if(sdlimage_version GREATER 7) |
25 message(STATUS "Enabling enhanced SDL_Image calls") |
28 message(STATUS "Enabling enhanced SDL_Image calls") |
26 set(pascal_compiler_flags_cmn "-dSDL_IMAGE_NEWER" ${pascal_compiler_flags_cmn}) |
29 set(pascal_compiler_flags_cmn "-dSDL_IMAGE_NEWER" ${pascal_compiler_flags_cmn}) |
|
30 endif() |
27 endif() |
31 endif() |
28 |
32 |
29 #SOURCE AND PROGRAMS SECTION |
33 #SOURCE AND PROGRAMS SECTION |
30 set(fpc_tryexe fpc) |
34 set(fpc_tryexe fpc) |
31 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwengine.pas) |
35 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwengine.pas) |