From 4c10c9c2b312263ae37c9492c12fa17d5115476d Mon Sep 17 00:00:00 2001 From: Karl Goetz Date: Wed, 17 Dec 2014 19:47:50 +1100 Subject: [PATCH 1/2] Remove MEGAGLEST_VERSION for MG_VERSION_H_CONTENTS I noticed that mk/macos/CMakeLists.txt has special code for extracting the megaglest version , but its already done in CMakeLists.txt. This removes the duplicate detection and changes the users of MEGAGLEST_VERSION to MG_VERSION_H_CONTENTS. --- mk/macosx/CMakeLists.txt | 16 ++-------------- mk/macosx/Info.plist | 6 +++--- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/mk/macosx/CMakeLists.txt b/mk/macosx/CMakeLists.txt index dfb4947f..1144232a 100644 --- a/mk/macosx/CMakeLists.txt +++ b/mk/macosx/CMakeLists.txt @@ -29,19 +29,7 @@ ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE) ##install part -#extracting the current version... -EXECUTE_PROCESS( - COMMAND /usr/bin/sed - -n -e "s/.*glestVersionString = \"v\\\(.*\\\)\";.*/\\1/p" - - game_util.cpp - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/source/glest_game/facilities" - OUTPUT_VARIABLE MEGAGLEST_VERSION ) - -#for some reason the MEGAGLEST_VERSION can containts return like thus remove it -STRING(REGEX REPLACE "\n" "" MEGAGLEST_VERSION "${MEGAGLEST_VERSION}") - -set(CPACK_PACKAGE_FILE_NAME MegaGlest-${MEGAGLEST_VERSION}) +set(CPACK_PACKAGE_FILE_NAME MegaGlest-${MG_VERSION_H_CONTENTS}) CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist") @@ -50,7 +38,7 @@ include (InstallRequiredSystemLibraries) set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt") -set (CPACK_GENERATOR Bundle) +set (CPACK_GENERATOR "Bundle") set (CPACK_BUNDLE_NAME "MegaGlest") set (CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/data/glest_game/megaglest") set (CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns") diff --git a/mk/macosx/Info.plist b/mk/macosx/Info.plist index 2de7a43d..8545199b 100644 --- a/mk/macosx/Info.plist +++ b/mk/macosx/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable MegaGlest CFBundleGetInfoString - ${MEGAGLEST_VERSION}, © 2001-2010 The Glest Team All Rights Reserved. + ${MG_VERSION_H_CONTENTS}, © 2001-2010 The Glest Team All Rights Reserved. CFBundleIconFile MegaGlest CFBundleIdentifier @@ -19,11 +19,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - ${MEGAGLEST_VERSION} + ${MG_VERSION_H_CONTENTS} CFBundleSignature ???? CFBundleVersion - ${MEGAGLEST_VERSION} + ${MG_VERSION_H_CONTENTS} NSMainNibFile MainMenu NSPrincipalClass From ada9b55740a8046dd63468498eebb13f059ae799 Mon Sep 17 00:00:00 2001 From: Karl Goetz Date: Wed, 17 Dec 2014 20:28:20 +1100 Subject: [PATCH 2/2] Revert change to quoting Accidentally included a change of quoting which isn't related to the diff at hand; reverted with this commit. --- mk/macosx/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/macosx/CMakeLists.txt b/mk/macosx/CMakeLists.txt index 1144232a..2f8456ad 100644 --- a/mk/macosx/CMakeLists.txt +++ b/mk/macosx/CMakeLists.txt @@ -38,7 +38,7 @@ include (InstallRequiredSystemLibraries) set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt") -set (CPACK_GENERATOR "Bundle") +set (CPACK_GENERATOR Bundle) set (CPACK_BUNDLE_NAME "MegaGlest") set (CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/data/glest_game/megaglest") set (CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns")