cmake_modules/FindSDL_Extras.cmake
changeset 6613 c7bf3b7c49dd
parent 5019 e38d1720a0ff
child 7707 e7e7b2082f44
equal deleted inserted replaced
6612:8fd6bb239a1e 6613:c7bf3b7c49dd
     1 #if the headers are not installed, the newer apis won't be activated
     1 #if the headers are not installed, the newer apis won't be activated
     2 
     2 
     3 #find which version of SDL we are building against
     3 ##find which version of SDL we are building against
     4 find_file(sdl_h SDL_version.h ${SDL_INCLUDE_DIR})
     4 #find_file(sdl_h SDL_version.h ${SDL_INCLUDE_DIR})
     5 if(sdl_h)
     5 #if(sdl_h)
     6     file(STRINGS ${sdl_h} sdl_majorversion_tmp REGEX "SDL_MAJOR_VERSION[\t' ']+[0-9]+")
     6 #    file(STRINGS ${sdl_h} sdl_majorversion_tmp REGEX "SDL_MAJOR_VERSION[\t' ']+[0-9]+")
     7     file(STRINGS ${sdl_h} sdl_minorversion_tmp REGEX "SDL_MINOR_VERSION[\t' ']+[0-9]+")
     7 #    file(STRINGS ${sdl_h} sdl_minorversion_tmp REGEX "SDL_MINOR_VERSION[\t' ']+[0-9]+")
     8     file(STRINGS ${sdl_h} sdl_patchversion_tmp REGEX "SDL_PATCHLEVEL[\t' ']+[0-9]+")
     8 #    file(STRINGS ${sdl_h} sdl_patchversion_tmp REGEX "SDL_PATCHLEVEL[\t' ']+[0-9]+")
     9     string(REGEX MATCH ".([0-9]+)" sdl_majorversion "${sdl_majorversion_tmp}")
     9 #    string(REGEX MATCH ".([0-9]+)" sdl_majorversion "${sdl_majorversion_tmp}")
    10     string(REGEX MATCH ".([0-9]+)" sdl_minorversion "${sdl_minorversion_tmp}")
    10 #    string(REGEX MATCH ".([0-9]+)" sdl_minorversion "${sdl_minorversion_tmp}")
    11     string(REGEX MATCH ".([0-9]+)" sdl_patchversion "${sdl_patchversion_tmp}")
    11 #    string(REGEX MATCH ".([0-9]+)" sdl_patchversion "${sdl_patchversion_tmp}")
    12     math(EXPR sdl_version "${sdl_majorversion}*10000 + ${sdl_minorversion}*100 + ${sdl_patchversion}")
    12 #    math(EXPR sdl_version "${sdl_majorversion}*10000 + ${sdl_minorversion}*100 + ${sdl_patchversion}")
    13 
    13 #
    14     if(NOT (sdl_version LESS "010300"))
    14 #    if(NOT (sdl_version LESS "010300"))
    15         message(STATUS "Enabling SDL-1.3+ calls")
    15 #        message(STATUS "Enabling SDL-1.3+ calls")
    16         set(pascal_compiler_flags_cmn "-dSDL13" ${pascal_compiler_flags_cmn})
    16 #        set(pascal_compiler_flags_cmn "-dSDL13" ${pascal_compiler_flags_cmn})
    17     endif()
    17 #    endif()
    18 endif()
    18 #endif()
    19 
    19 
    20 #find which version of SDL_mixer we have (for Mix_Init)
    20 #find which version of SDL_mixer we have (for Mix_Init)
    21 find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_INCLUDE_DIR})
    21 find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_INCLUDE_DIR})
    22 if(sdlmixer_h)
    22 if(sdlmixer_h)
    23     file(STRINGS ${sdlmixer_h} sdlmixer_majorversion_tmp REGEX "SDL_MIXER_MAJOR_VERSION[\t' ']+[0-9]+")
    23     file(STRINGS ${sdlmixer_h} sdlmixer_majorversion_tmp REGEX "SDL_MIXER_MAJOR_VERSION[\t' ']+[0-9]+")