CMake: add target show-version to get version information

This commit is contained in:
Adriaan de Groot 2018-06-28 05:19:32 -04:00
parent 2f6e80dc42
commit dfb42f2b49

View File

@ -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" )