mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
Fix version file generation
This commit is contained in:
parent
68f5605866
commit
fa1a5d11ee
@ -3,16 +3,20 @@ if(NOT BDIR)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Git REQUIRED)
|
find_package(Git REQUIRED)
|
||||||
|
execute_process(COMMAND git describe --tags --match "v[0-9]*" --long --dirty WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE git_version_string RESULT_VARIABLE status ERROR_QUIET)
|
||||||
|
|
||||||
if(GIT_FOUND AND IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../.git)
|
if(status AND NOT status EQUAL 0)
|
||||||
execute_process(COMMAND git describe --tags --match "v[0-9]*" --long --dirty WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE git_version_string)
|
|
||||||
else()
|
|
||||||
# for source package files (generated for ubuntu builds on launchpad) read the version from version.txt
|
|
||||||
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../version.txt)
|
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../version.txt)
|
||||||
file(READ ${CMAKE_CURRENT_LIST_DIR}/../version.txt git_version_string )
|
# for source package files (generated for ubuntu builds on launchpad) read the version from version.txt
|
||||||
|
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../version.txt)
|
||||||
|
file(READ ${CMAKE_CURRENT_LIST_DIR}/../version.txt git_version_string )
|
||||||
|
else()
|
||||||
|
get_filename_component(git_version_string ${CMAKE_CURRENT_LIST_DIR}/.. NAME)
|
||||||
|
string(REGEX REPLACE "^netgen(.*)" "\\1" git_version_string "${git_version_string}")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
get_filename_component(git_version_string ${CMAKE_CURRENT_LIST_DIR}/.. NAME)
|
MESSAGE(WARNING "Could not determine git-version from source code - assuming 6.2.0.0")
|
||||||
string(REGEX REPLACE "^netgen(.*)" "\\1" git_version_string "${git_version_string}")
|
set(git_version_string "v6.2.0.0")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user