hedgewars/CMakeLists.txt
changeset 5019 e38d1720a0ff
parent 4930 5d59bb58c365
child 5169 e353ca78d28b
--- a/hedgewars/CMakeLists.txt	Thu Mar 17 22:35:46 2011 +0100
+++ b/hedgewars/CMakeLists.txt	Thu Mar 17 23:53:33 2011 +0100
@@ -5,31 +5,9 @@
 find_package(SDL_mixer)
 find_package(Lua)
 
-configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
-
-#find which version of SDL_image and SDL_mixer we have (for IMG_Init and Mix_Init)
-#if the headers are not installed, the newer apis won't be activated
-find_file(sdlmixer_h SDL_mixer.h ${SDLMIXER_INCLUDE_DIR})
-if(sdlmixer_h)
-    file(STRINGS ${sdlmixer_h} sdlmixer_version_tmp REGEX "SDL_MIXER_PATCHLEVEL[\t' ']+[0-9]+")
-    string(REGEX MATCH ".([0-9]+)" sdlmixer_version "${sdlmixer_version_tmp}")
+include(${CMAKE_MODULE_PATH}/FindSDL_Extras.cmake)
 
-    if(sdlmixer_version GREATER 9)
-        message(STATUS "Enabling enhanced SDL_Mixer calls")
-        set(pascal_compiler_flags_cmn "-dSDL_MIXER_NEWER" ${pascal_compiler_flags_cmn})
-    endif()
-endif()
-
-find_file(sdlimage_h SDL_image.h ${SDLIMAGE_INCLUDE_DIR})
-if(sdlimage_h)
-    file(STRINGS ${sdlimage_h} sdlimage_version_tmp REGEX "SDL_IMAGE_PATCHLEVEL[\t' ']+[0-9]+")
-    string(REGEX MATCH ".([0-9]+)" sdlimage_version "${sdlimage_version_tmp}")
-
-    if(sdlimage_version GREATER 7)
-        message(STATUS "Enabling enhanced SDL_Image calls")
-        set(pascal_compiler_flags_cmn "-dSDL_IMAGE_NEWER" ${pascal_compiler_flags_cmn})
-    endif()
-endif()
+configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
 
 #SOURCE AND PROGRAMS SECTION
 set(fpc_tryexe fpc)
@@ -154,8 +132,8 @@
 
     if(fpc_ver LESS "020200")
         message(FATAL_ERROR "Minimum required version of FreePascal is 2.2.0")
-    elseif(APPLE AND x86_64_build AND fpc_ver LESS "020400")
-        message(FATAL_ERROR "Minimum required version of FreePascal is 2.4.0 for building 64 bit applications!")
+    elseif(APPLE AND x86_64_build AND (fpc_ver LESS "020400"))
+        message(FATAL_ERROR "Minimum required version of FreePascal is 2.4.0 for building 64 bit applications on Mac OS X!")
     endif()
 else()
     message(FATAL_ERROR "No Pascal compiler found!")