Skip to content

Commit f23590c

Browse files
committed
Add crpropa version string to cmake for download of releases
1 parent 6e31dde commit f23590c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ else(APPLE)
66
# allow < 2.8.12 for debian backports
77
cmake_minimum_required(VERSION 2.8.11)
88
endif(APPLE)
9+
910
project(CRPropa Fortran C CXX)
10-
set(CRPROPA_RELEASE_VERSION 3.1.5)
11+
set(CRPROPA_RELEASE_VERSION 3.1.5) # Update for new release
1112

1213
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
1314

@@ -57,11 +58,12 @@ if(ENABLE_GIT)
5758
include(GetGitRevisionDescription)
5859
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
5960
git_describe(GIT_DESC --tags)
60-
else(ENABLE_GIT)
61+
endif(ENABLE_GIT)
62+
IF(NOT ENABLE_GIT OR (${GIT_SHA1} STREQUAL "GITDIR-NOTFOUND"))
6163
set(GIT_REFSPEC "")
6264
set(GIT_SHA1 "")
63-
set(GIT_DESC ${CRPROPA_RELEASE_VERSION}"-no-git")
64-
endif(ENABLE_GIT)
65+
set(GIT_DESC "${CRPROPA_RELEASE_VERSION}-no-git")
66+
endif()
6567

6668
message(STATUS "CRPropa version: ${GIT_DESC} ${GIT_SHA1} ${GIT_REFSPEC}")
6769
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/Version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/src/Version.cpp" @ONLY)

0 commit comments

Comments
 (0)