From 692e2c3455eba3d2d0ba19b18502bbc8221b5f78 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 23 Oct 2019 23:49:51 +0200 Subject: Linux: set version explicitly in CMakeLists.txt instead of relying on parsing of Tcdefs.h which can be erroneous --- src/Build/CMakeLists.txt | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/Build/CMakeLists.txt b/src/Build/CMakeLists.txt index 1a34e3fe..d8011ef4 100644 --- a/src/Build/CMakeLists.txt +++ b/src/Build/CMakeLists.txt @@ -10,6 +10,11 @@ elseif ( NOT DEFINED NOGUI ) MESSAGE(FATAL_ERROR "NOGUI variable MUST BE set to TRUE if building 'Console' version, 'FALSE' otherwise") endif() +# - Set version of the package +set( FULL_VERSION "1.24" ) +set( VERSION "1.24.6" ) +set( RELEASE "1" ) + # - Set PROJECT_NAME and CONFLICT_PACKAGE values if (NOGUI) set( PROJECT_NAME "veracrypt-console" ) @@ -206,21 +211,6 @@ set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Packaging) # creates the Packaging directory under build directory when CMake generates the build system -# - We excute 'grep VERSION_STRING ../../Common/Tcdefs.h | head -n 1' to get the line which include 'VERSION_STRING' -# Then we delete all first characters from the beginning of the line until the first '"' to get the version in the format : "X.YYY..." -# Then, we remove the leading and trailing '"' characters -# Then, we retrieve the 'version' and the 'release' -# Finally, we replace '-' in the release if it exists with a '.' because CPack does not like '-' in the release -execute_process(COMMAND grep VERSION_STRING "$ENV{SOURCEPATH}/Common/Tcdefs.h" - COMMAND head -n 1 - OUTPUT_VARIABLE FULL_VERSION_LINE OUTPUT_STRIP_TRAILING_WHITESPACE) -string(REGEX REPLACE "^[^\"]+" "" FULL_VERSION ${FULL_VERSION_LINE}) -string(REGEX REPLACE "\"" "" FULL_VERSION ${FULL_VERSION}) -string(REPLACE "." ";" FULL_VERSION_LIST ${FULL_VERSION}) -list(GET FULL_VERSION_LIST 0 VERSION) -list(GET FULL_VERSION_LIST 1 RELEASE) -string(REPLACE "-" "." RELEASE ${RELEASE}) - set( VENDOR "IDRIX" ) set( LICENSE "VeraCrypt License" ) set( CONTACT "VeraCrypt Team " ) -- cgit v1.2.3