From 7734566bbdf5263d9a5110dee72d5371775b2a58 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Thu, 11 Feb 2016 23:53:23 +0100 Subject: [PATCH] Update gitversion --- cpack/CMakeLists.txt | 4 +- vendor/gitversion/CMakeLists.txt | 2 +- .../.gitignore | 0 .../LICENSE | 0 .../README.md | 0 .../cmake.cmake | 41 ++++++++++++++----- .../src/gitversionbuilder/DummyVersion.py | 0 .../src/gitversionbuilder/__init__.py | 0 .../src/gitversionbuilder/__main__.py | 0 .../src/gitversionbuilder/main.py | 0 .../src/gitversionbuilder/utils.py | 0 .../src/gitversionbuilder/versioninfo.py | 0 .../gitversionbuilder/versioninfooutputter.py | 0 .../gitversionbuilder/versioninforeader.py | 0 .../src/setup.py | 0 .../src/test/__init__.py | 0 .../src/test/main_test.py | 0 .../src/test/test_utils.py | 0 .../src/test/utils_test.py | 0 .../src/test/versioninfo_test.py | 0 .../src/test/versioninfooutputter_test.py | 0 .../src/test/versioninforeader_test.py | 0 22 files changed, 32 insertions(+), 15 deletions(-) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/.gitignore (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/LICENSE (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/README.md (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/cmake.cmake (57%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/gitversionbuilder/DummyVersion.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/gitversionbuilder/__init__.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/gitversionbuilder/__main__.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/gitversionbuilder/main.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/gitversionbuilder/utils.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/gitversionbuilder/versioninfo.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/gitversionbuilder/versioninfooutputter.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/gitversionbuilder/versioninforeader.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/setup.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/test/__init__.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/test/main_test.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/test/test_utils.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/test/utils_test.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/test/versioninfo_test.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/test/versioninfooutputter_test.py (100%) rename vendor/gitversion/{gitversion-1.8 => gitversion-1.9}/src/test/versioninforeader_test.py (100%) diff --git a/cpack/CMakeLists.txt b/cpack/CMakeLists.txt index 549f0d61..6df0ba3c 100644 --- a/cpack/CMakeLists.txt +++ b/cpack/CMakeLists.txt @@ -1,5 +1,3 @@ -include (../vendor/gitversion/gitversion-1.8/cmake.cmake) - # Fix debfiles permissions. Unfortunately, git doesn't store file permissions. # When installing the .deb package and these files have the wrong permissions, the package manager complains. execute_process(COMMAND /bin/bash -c "chmod 0755 ${CMAKE_CURRENT_SOURCE_DIR}/debfiles/*") @@ -36,4 +34,4 @@ set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.cryfs.org") set(CPACK_RPM_PACKAGE_LICENSE "LGPLv3") set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/debfiles/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debfiles/postrm") -include(CPack) \ No newline at end of file +include(CPack) diff --git a/vendor/gitversion/CMakeLists.txt b/vendor/gitversion/CMakeLists.txt index 505483cf..0ab18ccd 100644 --- a/vendor/gitversion/CMakeLists.txt +++ b/vendor/gitversion/CMakeLists.txt @@ -1 +1 @@ -include(gitversion-1.8/cmake.cmake) +include(gitversion-1.9/cmake.cmake) diff --git a/vendor/gitversion/gitversion-1.8/.gitignore b/vendor/gitversion/gitversion-1.9/.gitignore similarity index 100% rename from vendor/gitversion/gitversion-1.8/.gitignore rename to vendor/gitversion/gitversion-1.9/.gitignore diff --git a/vendor/gitversion/gitversion-1.8/LICENSE b/vendor/gitversion/gitversion-1.9/LICENSE similarity index 100% rename from vendor/gitversion/gitversion-1.8/LICENSE rename to vendor/gitversion/gitversion-1.9/LICENSE diff --git a/vendor/gitversion/gitversion-1.8/README.md b/vendor/gitversion/gitversion-1.9/README.md similarity index 100% rename from vendor/gitversion/gitversion-1.8/README.md rename to vendor/gitversion/gitversion-1.9/README.md diff --git a/vendor/gitversion/gitversion-1.8/cmake.cmake b/vendor/gitversion/gitversion-1.9/cmake.cmake similarity index 57% rename from vendor/gitversion/gitversion-1.8/cmake.cmake rename to vendor/gitversion/gitversion-1.9/cmake.cmake index 587196ef..ee0b2da6 100644 --- a/vendor/gitversion/gitversion-1.8/cmake.cmake +++ b/vendor/gitversion/gitversion-1.9/cmake.cmake @@ -1,14 +1,6 @@ set(DIR_OF_GITVERSION_TOOL "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "DIR_OF_GITVERSION_TOOL") -################################################# -# Add git version information -# Uses: -# TARGET_GIT_VERSION_INIT(buildtarget) -# Then, you can write in your source file: -# #include -# cout << gitversion::VERSION.toString() << endl; -################################################# -function(TARGET_GIT_VERSION_INIT TARGET) +function (_CREATE_GIT_VERSION_FILE) FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/messmer_gitversion") FILE(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/messmer_gitversion/gitversion") @@ -18,11 +10,38 @@ function(TARGET_GIT_VERSION_INIT TARGET) IF(NOT ${result} EQUAL 0) MESSAGE(FATAL_ERROR "Error running messmer/git-version tool. Return code is: ${result}") ENDIF() - TARGET_INCLUDE_DIRECTORIES(${TARGET} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/messmer_gitversion") +endfunction (_CREATE_GIT_VERSION_FILE) +function(_SET_GITVERSION_CMAKE_VARIABLE OUTPUT_VARIABLE) # Load version string and write it to a cmake variable so it can be accessed from cmake. FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/messmer_gitversion/gitversion/version.h" VERSION_H_FILE_CONTENT) STRING(REGEX REPLACE ".*VERSION_STRING = \"([^\"]*)\".*" "\\1" VERSION_STRING "${VERSION_H_FILE_CONTENT}") MESSAGE(STATUS "Version from git: ${VERSION_STRING}") - SET(GITVERSION_VERSION_STRING "${VERSION_STRING}" PARENT_SCOPE) + SET(${OUTPUT_VARIABLE} "${VERSION_STRING}" CACHE INTERNAL "${OUTPUT_VARIABLE}") + MESSAGE(STATUS "Output: ${OUTPUT_VARIABLE}: ${${OUTPUT_VARIABLE}}") +endfunction(_SET_GITVERSION_CMAKE_VARIABLE) + +###################################################### +# Add git version information +# Uses: +# TARGET_GIT_VERSION_INIT(buildtarget) +# Then, you can write in your source file: +# #include +# cout << gitversion::VERSION.toString() << endl; +###################################################### +function(TARGET_GIT_VERSION_INIT TARGET) + _CREATE_GIT_VERSION_FILE() + TARGET_INCLUDE_DIRECTORIES(${TARGET} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/messmer_gitversion") + _SET_GITVERSION_CMAKE_VARIABLE(GITVERSION_VERSION_STRING) endfunction(TARGET_GIT_VERSION_INIT) + +###################################################### +# Load git version information into a cmake variable +# Uses: +# GET_GIT_VERSION(OUTPUT_VARIABLE) +# MESSAGE(STATUS "The version is ${OUTPUT_VARIABLE}") +###################################################### +function(GET_GIT_VERSION OUTPUT_VARIABLE) + _CREATE_GIT_VERSION_FILE() + _SET_GITVERSION_CMAKE_VARIABLE(${OUTPUT_VARIABLE}) +endfunction(GET_GIT_VERSION OUTPUT_VARIABLE) diff --git a/vendor/gitversion/gitversion-1.8/src/gitversionbuilder/DummyVersion.py b/vendor/gitversion/gitversion-1.9/src/gitversionbuilder/DummyVersion.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/gitversionbuilder/DummyVersion.py rename to vendor/gitversion/gitversion-1.9/src/gitversionbuilder/DummyVersion.py diff --git a/vendor/gitversion/gitversion-1.8/src/gitversionbuilder/__init__.py b/vendor/gitversion/gitversion-1.9/src/gitversionbuilder/__init__.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/gitversionbuilder/__init__.py rename to vendor/gitversion/gitversion-1.9/src/gitversionbuilder/__init__.py diff --git a/vendor/gitversion/gitversion-1.8/src/gitversionbuilder/__main__.py b/vendor/gitversion/gitversion-1.9/src/gitversionbuilder/__main__.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/gitversionbuilder/__main__.py rename to vendor/gitversion/gitversion-1.9/src/gitversionbuilder/__main__.py diff --git a/vendor/gitversion/gitversion-1.8/src/gitversionbuilder/main.py b/vendor/gitversion/gitversion-1.9/src/gitversionbuilder/main.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/gitversionbuilder/main.py rename to vendor/gitversion/gitversion-1.9/src/gitversionbuilder/main.py diff --git a/vendor/gitversion/gitversion-1.8/src/gitversionbuilder/utils.py b/vendor/gitversion/gitversion-1.9/src/gitversionbuilder/utils.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/gitversionbuilder/utils.py rename to vendor/gitversion/gitversion-1.9/src/gitversionbuilder/utils.py diff --git a/vendor/gitversion/gitversion-1.8/src/gitversionbuilder/versioninfo.py b/vendor/gitversion/gitversion-1.9/src/gitversionbuilder/versioninfo.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/gitversionbuilder/versioninfo.py rename to vendor/gitversion/gitversion-1.9/src/gitversionbuilder/versioninfo.py diff --git a/vendor/gitversion/gitversion-1.8/src/gitversionbuilder/versioninfooutputter.py b/vendor/gitversion/gitversion-1.9/src/gitversionbuilder/versioninfooutputter.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/gitversionbuilder/versioninfooutputter.py rename to vendor/gitversion/gitversion-1.9/src/gitversionbuilder/versioninfooutputter.py diff --git a/vendor/gitversion/gitversion-1.8/src/gitversionbuilder/versioninforeader.py b/vendor/gitversion/gitversion-1.9/src/gitversionbuilder/versioninforeader.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/gitversionbuilder/versioninforeader.py rename to vendor/gitversion/gitversion-1.9/src/gitversionbuilder/versioninforeader.py diff --git a/vendor/gitversion/gitversion-1.8/src/setup.py b/vendor/gitversion/gitversion-1.9/src/setup.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/setup.py rename to vendor/gitversion/gitversion-1.9/src/setup.py diff --git a/vendor/gitversion/gitversion-1.8/src/test/__init__.py b/vendor/gitversion/gitversion-1.9/src/test/__init__.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/test/__init__.py rename to vendor/gitversion/gitversion-1.9/src/test/__init__.py diff --git a/vendor/gitversion/gitversion-1.8/src/test/main_test.py b/vendor/gitversion/gitversion-1.9/src/test/main_test.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/test/main_test.py rename to vendor/gitversion/gitversion-1.9/src/test/main_test.py diff --git a/vendor/gitversion/gitversion-1.8/src/test/test_utils.py b/vendor/gitversion/gitversion-1.9/src/test/test_utils.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/test/test_utils.py rename to vendor/gitversion/gitversion-1.9/src/test/test_utils.py diff --git a/vendor/gitversion/gitversion-1.8/src/test/utils_test.py b/vendor/gitversion/gitversion-1.9/src/test/utils_test.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/test/utils_test.py rename to vendor/gitversion/gitversion-1.9/src/test/utils_test.py diff --git a/vendor/gitversion/gitversion-1.8/src/test/versioninfo_test.py b/vendor/gitversion/gitversion-1.9/src/test/versioninfo_test.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/test/versioninfo_test.py rename to vendor/gitversion/gitversion-1.9/src/test/versioninfo_test.py diff --git a/vendor/gitversion/gitversion-1.8/src/test/versioninfooutputter_test.py b/vendor/gitversion/gitversion-1.9/src/test/versioninfooutputter_test.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/test/versioninfooutputter_test.py rename to vendor/gitversion/gitversion-1.9/src/test/versioninfooutputter_test.py diff --git a/vendor/gitversion/gitversion-1.8/src/test/versioninforeader_test.py b/vendor/gitversion/gitversion-1.9/src/test/versioninforeader_test.py similarity index 100% rename from vendor/gitversion/gitversion-1.8/src/test/versioninforeader_test.py rename to vendor/gitversion/gitversion-1.9/src/test/versioninforeader_test.py