CMakeLists.txt
branchflibqtfrontend
changeset 8126 5bfa1b2025d6
parent 8104 09c38cdf380d
child 8146 1fba650c2aa4
--- a/CMakeLists.txt	Mon Nov 26 00:06:42 2012 +0400
+++ b/CMakeLists.txt	Mon Nov 26 00:09:54 2012 +0400
@@ -1,8 +1,7 @@
 project(hedgewars)
 
 #initialise cmake environment
-cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
-cmake_policy(VERSION 2.6)
+cmake_minimum_required(VERSION 2.6.0)
 FOREACH(hwpolicy CMP0003 CMP0012 CMP0017)
     IF(POLICY ${hwpolicy})
         CMAKE_POLICY(SET ${hwpolicy} NEW)
@@ -11,9 +10,11 @@
 #use available modules, fallback to ours if not present (CMP0017 helps)
 set(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
 
-#set some default values
-option(NOREVISION "Build Hedgewars without revision information" OFF)
 
+#usually this is set at release time
+option(NOREVISION "Build Hedgewars without revision information [default: off]" OFF)
+
+#set other default values
 option(NOSERVER "Disable gameServer build [default: auto]" OFF)
 option(NOPNG "Disable screenshoot compression [default: auto]" OFF)
 option(NOVIDEOREC "Disable video recording [default: auto]" OFF)
@@ -24,6 +25,7 @@
 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF)
 option(MINIMAL_FLAGS "Respect system flags as much as possible [default: off]" OFF)
 
+
 #detect Mercurial revision (if present)
 IF(NOT NOREVISION)
     set(default_build_type "DEBUG")
@@ -44,7 +46,7 @@
 
         MESSAGE(STATUS "Building revision ${revision_number} from hash ${revision_hash} ${HGCHANGED}")
         IF(HGCHANGED)
-            MESSAGE(WARNING "You have uncommitted changes")
+            MESSAGE(WARNING "Notice: you have uncommitted changes in your repository")
         ENDIF()
         set(version_suffix "-${revision_number}${HGCHANGED}")
     ENDIF()
@@ -71,7 +73,6 @@
     set(CMAKE_INSTALL_PREFIX ${bundle_name}/Contents/MacOS/)
     set(DATA_INSTALL_DIR "../Resources/")
     set(target_dir ".")
-    set(minimum_macosx_version "10.6")
 else()
     set(target_dir "bin")
 endif()
@@ -85,12 +86,15 @@
     #detect on which system we are: if sw_vers cannot be found for any reason (re)use minimum_macosx_version
     find_program(sw_vers sw_vers)
     if(sw_vers)
-        execute_process(COMMAND ${sw_vers} "-productVersion" OUTPUT_VARIABLE current_macosx_version)
+        execute_process(COMMAND ${sw_vers} "-productVersion"
+                        OUTPUT_VARIABLE current_macosx_version
+                        OUTPUT_STRIP_TRAILING_WHITESPACE)
         string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version})
-        else()
+    else()
         if(NOT minimum_macosx_version)
             message(FATAL_ERROR "sw_vers not found! Need explicit MACOSX_DEPLOYMENT_TARGET variable set")
         else()
+            message(WARNING "sw_vers not found! Fallback to MACOSX_DEPLOYMENT_TARGET variable")
             set(current_macosx_version ${minimum_macosx_version})
         endif()
     endif()
@@ -100,7 +104,7 @@
         set(minimum_macosx_version ${current_macosx_version})
     endif()
 
-    #lower systems don't have enough processing power anyways
+    #lower systems don't have enough processing power anyway
     if (minimum_macosx_version LESS "10.4")
         message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4")
     endif()
@@ -145,8 +149,8 @@
     #set deployment target
     set(pascal_flags "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_flags})
 
-    message(STATUS "Build system: Mac OS X ${current_macosx_version} with GCC:${CMAKE_C_COMPILER}")
-    message(STATUS "Target system: Mac OS X ${minimum_macosx_version} for architecture(s):${CMAKE_OSX_ARCHITECTURES}")
+    message(STATUS "Build system: Mac OS X ${current_macosx_version} with C compiler: ${CMAKE_C_COMPILER}")
+    message(STATUS "Target system: Mac OS X ${minimum_macosx_version} for architecture(s): ${CMAKE_OSX_ARCHITECTURES}")
 endif(APPLE)
 
 
@@ -230,7 +234,7 @@
         add_subdirectory(gameServer)
         message(STATUS "Found GHC: ${ghc_executable}")
     else()
-        message(STATUS "Could NOT find GHC, server will not be built")
+        message(WARNING "Could NOT find GHC, server will not be built")
         set(HAVE_NETSERVER false)
     endif()
 else()
@@ -246,7 +250,7 @@
 else()
     message(STATUS "LUA will be provided by the bundled sources")
     add_subdirectory(misc/liblua)
-    #linking with liblua.a requires system readline -- this works everywhere, right?
+    #linking with liblua.a requires system readline
     set(pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline" ${pascal_flags})
 endif()
 
@@ -254,10 +258,10 @@
 #main engine
 add_subdirectory(hedgewars)
 
-# physfs library
+#physfs library
 add_subdirectory(misc/physfs)
 
-# frontend library
+#frontend library
 add_subdirectory(project_files/frontlib)
 
 #Android related build scripts