CMake: make show-version available in all builds

This commit is contained in:
Adriaan de Groot 2021-03-26 14:33:44 +01:00
parent 2ebf9124d1
commit c2d759f11e

View File

@ -522,13 +522,18 @@ if( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
endif() endif()
endif() endif()
# Special target for not-RC (e.g. might-be-release) builds. # Special target for displaying the version. In RC (might-be-release)
# This is used by the release script to get the version. # builds, use the short version (3.x.y), otherwise show the long version.
if ( CALAMARES_VERSION_RC EQUAL 0 ) if ( CALAMARES_VERSION_RC EQUAL 0 )
add_custom_target(show-version add_custom_target(show-version
${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION_SHORT} ${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION_SHORT}
USES_TERMINAL USES_TERMINAL
) )
else()
add_custom_target(show-version
${CMAKE_COMMAND} -E echo CALAMARES_VERSION=${CALAMARES_VERSION}
USES_TERMINAL
)
endif() endif()
# enforce using constBegin, constEnd for const-iterators # enforce using constBegin, constEnd for const-iterators