Refactor Freepascal module.
authorBryan Dunsmore <dunsmoreb@gmail.com>
Sat, 01 Dec 2012 16:03:38 -0600
changeset 8166 5bc0fc0bab4d
parent 8164 b12634f2e1b2
child 8180 33868aea694c
Refactor Freepascal module.
cmake_modules/FindFreepascal.cmake
hedgewars/CMakeLists.txt
--- a/cmake_modules/FindFreepascal.cmake	Sat Dec 01 15:40:10 2012 -0600
+++ b/cmake_modules/FindFreepascal.cmake	Sat Dec 01 16:03:38 2012 -0600
@@ -28,7 +28,7 @@
 
 if (TEST_NOEXECSTACK)
     set(NOEXECSTACK_FLAGS "")
-    message(STATUS "Checking whether linker supports noexecstack flag -- no")
+    message(STATUS "Checking whether linker needs explicit noexecstack -- no")
 else()
-    message(STATUS "Checking whether linker supports noexecstack flag -- yes")
+    message(STATUS "Checking whether linker needs explicit noexecstack -- yes")
 endif()
--- a/hedgewars/CMakeLists.txt	Sat Dec 01 15:40:10 2012 -0600
+++ b/hedgewars/CMakeLists.txt	Sat Dec 01 16:03:38 2012 -0600
@@ -11,7 +11,12 @@
 #SOURCE AND PROGRAMS SECTION
 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwengine.pas)
 set(engine_output_name "hwengine")
-set(required_fpc_version 2.2)
+
+if (APPLE)
+    set(required_fpc_version 2.6)
+else()
+    set(required_fpc_version 2.2)
+endif()
 
 set(engine_sources
     ${hwengine_project}
@@ -105,18 +110,12 @@
 # Check Freepascal version
 find_package(Freepascal)
 
-if (NOT APPLE)
-    if (FPC_VERSION VERSION_LESS required_fpc_version)
-        message(FATAL_ERROR "Necessary FPC version not found (version >= ${required_fpc_version} required)")
-    endif()
-elseif (APPLE)
-    if (FPC_VERSION VERSION_LESS 2.6)
-        message(FATAL_ERROR "Necessary FPC version not found (version >= 2.6 required)")
-    endif()
+if (FPC_VERSION VERSION_LESS required_fpc_version)
+    message(FATAL_ERROR "Necessary FPC version not found (version >= ${required_fpc_version} required)")
+else()
+    message(STATUS "Found FPC: ${FPC_EXECUTABLE} (version ${FPC_VERSION})")
 endif()
 
-message(STATUS "Found FPC: ${FPC_EXECUTABLE} (version ${FPC_VERSION})")
-
 
 #DEPENDECIES AND EXECUTABLES SECTION
 if(APPLE)