--- a/CMakeLists.txt Thu Aug 04 17:41:07 2011 +0200
+++ b/CMakeLists.txt Thu Aug 04 17:44:55 2011 +0200
@@ -1,11 +1,15 @@
project(hedgewars)
+
+#initialise cmake environment
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
FOREACH(policy CMP0003 CMP0012)
IF(POLICY ${policy})
CMAKE_POLICY(SET ${policy} NEW)
ENDIF()
ENDFOREACH()
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
+
#detect Mercurial revision (if present)
set(version_suffix "-dev") #UNSET THIS VARIABLE AT RELEASE TIME
@@ -20,7 +24,7 @@
OUTPUT_VARIABLE version_suffix
)
STRING(REGEX REPLACE "[^+]" "" HGCHANGED ${version_suffix})
- STRING(REGEX REPLACE "([0-9a-zA-Z]+)(.*) ([0-9]+)(.*)" "\\3:\\1" version_suffix ${version_suffix})
+ STRING(REGEX REPLACE "([0-9a-zA-Z]+)(.*) ([0-9]+)(.*)" "\\3-\\1" version_suffix ${version_suffix})
IF (HGCHANGED)
MESSAGE(STATUS "Building revision ${version_suffix} (SOURCE CODE MODIFIED)")
ELSE()
@@ -33,11 +37,14 @@
set(HW_DEV false)
ENDIF()
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
-set( CPACK_PACKAGE_VERSION_MAJOR 0 )
-set( CPACK_PACKAGE_VERSION_MINOR 9 )
-set( CPACK_PACKAGE_VERSION_PATCH 16${version_suffix} )
+#versioning
+set(CPACK_PACKAGE_VERSION_MAJOR 0)
+set(CPACK_PACKAGE_VERSION_MINOR 9)
+set(CPACK_PACKAGE_VERSION_PATCH 16${version_suffix})
+set(HEDGEWARS_PROTO_VER 38)
+set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+
#set some safe values
IF(NOT WITH_SERVER)
@@ -49,6 +56,7 @@
set(target_dir "bin")
+#bundle .app setup
if(APPLE)
set(CMAKE_FIND_FRAMEWORK "FIRST")
@@ -165,8 +173,6 @@
endif()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-set( HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" )
-set( HEDGEWARS_PROTO_VER 38 )
if(WITH_SERVER)
find_program(ghc_executable ghc)
@@ -195,8 +201,8 @@
add_subdirectory(tools)
endif()
-# CPack vars
+# CPack variables
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hedgewars, a free turn-based strategy")
set(CPACK_PACKAGE_VENDOR "Hedgewars Project")
set(CPACK_PACKAGE_FILE_NAME "hedgewars-${HEDGEWARS_VERSION}")
@@ -278,3 +284,4 @@
)
include(CPack)
+