summaryrefslogtreecommitdiffstats
path: root/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
Commit message (Collapse)AuthorAgeFilesLines
* CMakePackageConfigHelpers: only emit arch check if neededAndrea Pappacoda2023-01-291-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, the write_basic_package_version_file() function of the CMakePackageConfigHelpers module always emitted an architecture check, even if the ARCH_INDEPENDENT option was specified. While this is not an issue when configuring builds, as the check is skipped, this can create issues when the "arch independent" version files are installed in the datadir (e.g. /usr/share) in a MultiArch environment like Debian, where different architecture packages of the same libraries can be coinstalled; as the amd64 version of a given library contains "8 * 8" in the file, while the i386 one contains "4 * 8", there's a conflict, as files in /usr/share are expected to be identical across architectures. This patch fixes this issue by only emitting the architecture check code if needed; when ARCH_INDEPENDENT is specified, no code is written at all. Here's a diff between the version files generated before and after this patch: diff -u old/indep.cmake new/indep.cmake --- old/indep.cmake 2023-01-29 13:43:04.840671117 +0100 +++ new/indep.cmake 2023-01-29 13:57:28.475191551 +0100 @@ -52,19 +52,3 @@ endif() -# if the installed project requested no architecture check, don't perform the check -if("TRUE") - return() -endif() - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") - return() -endif() - -# check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") - math(EXPR installedBits "8 * 8") - set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() diff -u old/no-indep.cmake new/no-indep.cmake --- old/no-indep.cmake 2023-01-29 13:42:05.010710508 +0100 +++ new/no-indep.cmake 2023-01-29 13:57:40.914237219 +0100 @@ -52,13 +52,8 @@ endif() -# if the installed project requested no architecture check, don't perform the check -if("FALSE") - return() -endif() - # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") +if(CMAKE_SIZEOF_VOID_P STREQUAL "" OR "8" STREQUAL "") return() endif() Fixes: #24375
* WriteBasicConfigVersion supports version strings such as 21.07.04Robert Maynard2021-05-271-0/+3
| | | | Fixes #22207
* CMakePackageConfigHelpers: Relax restrictions on version rangeMarc Chevrier2020-12-141-12/+21
|
* CMakePackageConfigHelpers: Add version range supportMarc Chevrier2020-09-231-0/+7
|
* Modules: Consistently use 2 space indentationKitware Robot2019-05-141-1/+1
|
* CMakePackageConfigHelpers: Add ARCH_INDEPENDENT optionJustin Bassett2018-12-011-0/+5
| | | | | | | Allow skipping the architecture check in the package version file generated from calling write_basic_package_version_file. Document said architecture check. Fixes: #16184
* Revert the use of string(APPEND) in .cmake.in filesDaniel Pfeifer2016-08-081-1/+1
| | | | | The generated files may be consumed by older cmake versions which do not support string(APPEND).
* Use string(APPEND) in ModulesDaniel Pfeifer2016-07-271-1/+1
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* write_basic_package_version_file: remove variable dereferences in templatesRolf Eike Beer2015-09-041-5/+5
| | | | Fixes some minor whitespace issues in the if()s.
* BasicConfigVersion: Make docs refer to the macro, not the module nameStephen Kelly2012-10-231-1/+1
| | | | | The -ExactVersion variant already refers to the macro, and I think it makes more sense anyway.
* write_basic_package_version_file() now works with unset CMAKE_SIZEOF_VOID_PAlex Neundorf2012-05-231-0/+5
| | | | | | | | This fixes #13241. If CMAKE_SIZEOF_VOID_P is not set, either in the installed or in the using project, don't check for it. Alex
* Improve documentation for WriteBasicConfigVersionFile.cmakeAlex Neundorf2011-08-051-2/+1
| | | | Alex
* Set UNSUITABLE instead of not COMPATIBLEAlex Neundorf2011-08-051-24/+21
| | | | Alex
* Add some tests for write_basic_config_version_file()Alex Neundorf2011-08-011-0/+2
| | | | Alex
* Provide macro write_basic_config_version_file()Alex Neundorf2011-08-011-0/+43
This macro can be used to generate basic version files which can be installed along a Config.cmake file to provide versioning support. This (3rd try) is implemented using a macro, which maps the COMPATIBILITY mode to a filename and configure_file()s the resulting file. Alex