summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-17 08:43:35 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-17 08:45:15 -0700
commitaa48dfea27388125f0da0b175ce13d48dd96f1a6 (patch)
tree146383e3dfb44220ea20163984dde304cd52656e /CMakeLists.txt
parenta41475c339cf3c7e245dcd1c927b22a19a93ee2b (diff)
downloadsubsurface-aa48dfea27388125f0da0b175ce13d48dd96f1a6.tar.gz
Cmake: automatically create version for Mac bundle
The version info that is used for the Mac bundle is created at cmake run time, not at make run time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 328a003d9..deec8b397 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,6 +34,17 @@ include_directories(.
qt-ui/profile
)
+# get the version string -- this is only used for Mac Bundle at this point
+# the other version data gets updated when running make - this is set when running cmake
+execute_process(
+ COMMAND sh scripts/get-version linux
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE SSRF_VERSION_STRING
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+message(STATUS "Creating build files for Subsurface ${SSRF_VERSION_STRING}")
+
# compiler specific settings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 ")
@@ -260,9 +271,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(MACOSX_BUNDLE_ICON_FILE Subsurface.icns)
set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.subsurface-divelog")
set(MACOSX_BUNDLE_BUNDLE_NAME "Subsurface")
- set(MACOSX_BUNDLE_BUNDLE_VERSION "4.4.1")
- set(MACOSX_BUNDLE_SHORT_VERSION_STRING "4.4.1")
- set(MACOSX_BUNDLE_LONG_VERSION_STRING "4.4.1")
+ set(MACOSX_BUNDLE_BUNDLE_VERSION "${SSRF_VERSION_STRING}")
+ set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${SSRF_VERSION_STRING}")
+ set(MACOSX_BUNDLE_LONG_VERSION_STRING "${SSRF_VERSION_STRING}")
set(MACOSX_BUNDLE_COPYRIGHT "Linus Torvalds, Dirk Hohndel, Tomaz Canabrava, and others")
set_source_files_properties(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set(SUBSURFACE_PKG MACOSX_BUNDLE ${ICON_FILE})