summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAdriaan de Groot <groot@kde.org>2018-06-28 05:19:32 -0400
committerAdriaan de Groot <groot@kde.org>2018-06-28 05:19:32 -0400
commitdfb42f2b49a347c4c6020a299f5b3cab96628914 (patch)
tree576b5392a1e8f897962fc7def1ca9558c9d9d911 /CMakeLists.txt
parent2f6e80dc428431247a19c16ae0f219044c10b0e2 (diff)
CMake: add target show-version to get version information
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c06beba29..a46b0d37d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,9 @@
# Example usage:
#
# cmake . -DSKIP_MODULES="partition luksbootkeycfg"
+#
+# One special target is "show-version", which can be built
+# to obtain the version number from here.
project( calamares C CXX )
@@ -74,7 +77,6 @@ set( CALAMARES_VERSION_MINOR 2 )
set( CALAMARES_VERSION_PATCH 1 )
set( CALAMARES_VERSION_RC 0 )
-
### Transifex (languages) info
#
# complete = 100% translated,
@@ -394,6 +396,15 @@ if( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
endif()
endif()
+# Special target for not-RC (e.g. might-be-release) builds.
+# This is used by the release script to get the version.
+if ( CALAMARES_VERSION_RC EQUAL 0 )
+ add_custom_target(show-version
+ ${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION_SHORT}
+ USES_TERMINAL
+ )
+endif()
+
# enforce using constBegin, constEnd for const-iterators
add_definitions( "-DQT_STRICT_ITERATORS" )