From bce291439c4094e1be37a51bfc0c986fa0b03410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Fu=C3=9F?= Date: Fri, 15 Jan 2021 17:41:49 +0100 Subject: [PATCH] Avoid name clashes on case-insensitive file systems On case-insensitive file systems (i.e. macOS), the VERSION file collides with the Boost-provided version file on #include . Work around by re-naming VERSION to ICINGA2_VERSION. --- CMakeLists.txt | 6 +++--- VERSION => ICINGA2_VERSION | 0 RELEASE.md | 2 +- doc/21-development.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename VERSION => ICINGA2_VERSION (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47df384c9..3f59d46f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,7 @@ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING" ICINGA2_LICENSE_GPL) set(ICINGA2_LICENSE "${ICINGA2_LICENSE_GPL}\n\n---\n\n${ICINGA2_LICENSE_ADDITIONS}") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" ${ICINGA2_LICENSE}) -file(STRINGS VERSION SPEC_VERSION REGEX "^Version:") +file(STRINGS ICINGA2_VERSION SPEC_VERSION REGEX "^Version:") string(LENGTH "${SPEC_VERSION}" SPEC_VERSION_LENGTH) math(EXPR SPEC_VERSION_LENGTH "${SPEC_VERSION_LENGTH} - 9") string(SUBSTRING ${SPEC_VERSION} 9 ${SPEC_VERSION_LENGTH} SPEC_VERSION) @@ -102,7 +102,7 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/icinga-version.h.force) configure_file(icinga-version.h.force ${CMAKE_CURRENT_BINARY_DIR}/icinga-version.h COPYONLY) else() if(NOT ICINGA2_GIT_VERSION_INFO OR GIT_VERSION MATCHES "-NOTFOUND$") - file(STRINGS VERSION SPEC_REVISION REGEX "^Revision: ") + file(STRINGS ICINGA2_VERSION SPEC_REVISION REGEX "^Revision: ") string(LENGTH "${SPEC_REVISION}" SPEC_REVISION_LENGTH) math(EXPR SPEC_REVISION_LENGTH "${SPEC_REVISION_LENGTH} - 10") string(SUBSTRING ${SPEC_REVISION} 10 ${SPEC_REVISION_LENGTH} SPEC_REVISION) @@ -536,4 +536,4 @@ if(WIN32) ) endif() -include(CPack) \ No newline at end of file +include(CPack) diff --git a/VERSION b/ICINGA2_VERSION similarity index 100% rename from VERSION rename to ICINGA2_VERSION diff --git a/RELEASE.md b/RELEASE.md index dfae94faf..3db79ad4a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -64,7 +64,7 @@ git log --use-mailmap | grep '^Author:' | cut -f2- -d' ' | sort -f | uniq > AUTH Update the version: ``` -sed -i "s/Version: .*/Version: $VERSION/g" VERSION +sed -i "s/Version: .*/Version: $VERSION/g" ICINGA2_VERSION ``` ## Changelog diff --git a/doc/21-development.md b/doc/21-development.md index 034f054ff..d6f189736 100644 --- a/doc/21-development.md +++ b/doc/21-development.md @@ -2342,7 +2342,7 @@ for implementation details. CMake determines the Icinga 2 version number using `git describe` if the source directory is contained in a Git repository. Otherwise the version number -is extracted from the [VERSION](VERSION) file. This behavior can be +is extracted from the [ICINGA2_VERSION](ICINGA2_VERSION) file. This behavior can be overridden by creating a file called `icinga-version.h.force` in the source directory. Alternatively the `-DICINGA2_GIT_VERSION_INFO=OFF` option for CMake can be used to disable the usage of `git describe`.