cmake_modules/FindSDL_Extras.cmake
author dag10
Mon, 14 Jan 2013 11:19:59 +0100
changeset 8377 869f80966a77
parent 8347 716c05f19401
permissions -rw-r--r--
GCI2012: Improve Game Configuration Widget - Refactored mapmodel+datamanager to have two separate map models for static and mission maps, and then three static MapInfos in MapModel for the three special maps (random, maze, drawn). - Created theme selector dialog. - Created seed view/edit dialog. - Enlarged start icon on pagemultiplayer and pagenetgame, and added Start.png. - Moved "Settings" button on pagemultiplayer and pagenetgame from middle of page to page footer. - Added "load drawing" button to mapcontainer widget. - Map preview is no longer the randomize button; The randomize functionality is now in a button of its own. - Map preview no longer grays out (isn't disabled) when in slave mode. - Seed is now viewable and copyable when in slave mode -- but not editable. - You should now use the property master (isMaster() and setMaster()) on gamecfgwidget and mapcontainer instead of the enabled property. This is because some widgets (e.g. "view/edit seed" button and map preview) shouldn't be disabled, when all other widgets should be. - Added mission map descriptions w/ locale support in INI format in mapname/desc.txt if applicable. Use '|' for line break.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5019
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     1
#if the headers are not installed, the newer apis won't be activated
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     2
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     3
#find which version of SDL_mixer we have (for Mix_Init)
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     4
find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_INCLUDE_DIR})
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     5
if(sdlmixer_h)
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     6
    file(STRINGS ${sdlmixer_h} sdlmixer_majorversion_tmp REGEX "SDL_MIXER_MAJOR_VERSION[\t' ']+[0-9]+")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     7
    file(STRINGS ${sdlmixer_h} sdlmixer_minorversion_tmp REGEX "SDL_MIXER_MINOR_VERSION[\t' ']+[0-9]+")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     8
    file(STRINGS ${sdlmixer_h} sdlmixer_patchversion_tmp REGEX "SDL_MIXER_PATCHLEVEL[\t' ']+[0-9]+")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
     9
    string(REGEX MATCH ".([0-9]+)" sdlmixer_majorversion "${sdlmixer_majorversion_tmp}")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    10
    string(REGEX MATCH ".([0-9]+)" sdlmixer_minorversion "${sdlmixer_minorversion_tmp}")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    11
    string(REGEX MATCH ".([0-9]+)" sdlmixer_patchversion "${sdlmixer_patchversion_tmp}")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    12
    math(EXPR sdlmixer_version "${sdlmixer_majorversion}*10000 + ${sdlmixer_minorversion}*100 + ${sdlmixer_patchversion}")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    13
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    14
    if(sdlmixer_version GREATER "10209")
7817
6cc558a69b58 countless small optimisation for cmake, output messages are now coherent (mostly) and the options get fully respected (eg. skipping library search if not activated)
koda
parents: 7707
diff changeset
    15
        message(STATUS "Mix_Init() is present")
8347
716c05f19401 GCI2012: CMake List Append
Willie Zhu
parents: 7817
diff changeset
    16
        list(APPEND pascal_flags "-dSDL_MIXER_NEWER")
5019
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    17
    endif()
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    18
endif()
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    19
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    20
#find which version of SDL_image we have (for IMG_Init)
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    21
find_file(sdlimage_h SDL_image.h ${SDLIMAGE_INCLUDE_DIR})
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    22
if(sdlimage_h)
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    23
    file(STRINGS ${sdlimage_h} sdlimage_majorversion_tmp REGEX "SDL_IMAGE_MAJOR_VERSION[\t' ']+[0-9]+")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    24
    file(STRINGS ${sdlimage_h} sdlimage_minorversion_tmp REGEX "SDL_IMAGE_MINOR_VERSION[\t' ']+[0-9]+")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    25
    file(STRINGS ${sdlimage_h} sdlimage_patchversion_tmp REGEX "SDL_IMAGE_PATCHLEVEL[\t' ']+[0-9]+")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    26
    string(REGEX MATCH ".([0-9]+)" sdlimage_majorversion "${sdlimage_majorversion_tmp}")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    27
    string(REGEX MATCH ".([0-9]+)" sdlimage_minorversion "${sdlimage_minorversion_tmp}")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    28
    string(REGEX MATCH ".([0-9]+)" sdlimage_patchversion "${sdlimage_patchversion_tmp}")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    29
    math(EXPR sdlimage_version "${sdlimage_majorversion}*10000 + ${sdlimage_minorversion}*100 + ${sdlimage_patchversion}")
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    30
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    31
    if(sdlimage_version GREATER "010207")
7817
6cc558a69b58 countless small optimisation for cmake, output messages are now coherent (mostly) and the options get fully respected (eg. skipping library search if not activated)
koda
parents: 7707
diff changeset
    32
        message(STATUS "IMG_Init() is present")
8347
716c05f19401 GCI2012: CMake List Append
Willie Zhu
parents: 7817
diff changeset
    33
        list(APPEND pascal_flags "-dSDL_IMAGE_NEWER")
5019
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    34
    endif()
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    35
endif()
e38d1720a0ff allows for building hedgewars with SDL-1.3
koda
parents:
diff changeset
    36