Skip to content

Commit bc4340e

Browse files
author
Kasper Peeters
committed
Store version info during build in VERSION file.
1 parent 398aad4 commit bc4340e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ message(STATUS "Build id '${CADABRA_VERSION_BUILD}' dated ${CADABRA_VERSION_DATE
7474
message(STATUS "Build mode is set to '${CMAKE_BUILD_TYPE}'")
7575
message(STATUS "Architecture is '${CMAKE_SYSTEM_PROCESSOR}}'")
7676

77+
# Store the version number in a build/VERSION file (so that e.g. github
78+
# actions can pick it up).
79+
if(NOT "${CADABRA_VERSION_TWEAK}" STREQUAL "0")
80+
file(WRITE build/VERSION "${CADABRA_VERSION_MAJOR}.${CADABRA_VERSION_MINOR}.${CADABRA_VERSION_PATCH}.${CADABRA_VERSION_TWEAK}")
81+
else()
82+
file(WRITE build/VERSION "${CADABRA_VERSION_MAJOR}.${CADABRA_VERSION_MINOR}.${CADABRA_VERSION_PATCH}")
83+
endif()
84+
85+
7786
# Notify about install directory
7887
if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "")
7988
message(STATUS "Install directory not set")

0 commit comments

Comments
 (0)