summaryrefslogtreecommitdiff
path: root/Modules/WriteBasicConfigVersionFile.cmake
Commit message (Collapse)AuthorAgeFilesLines
* WriteBasicConfigVersionFile: Fix regression in ARCH_INDEPENDENT checkBrad King2023-03-161-1/+1
| | | | | | | | | | | | | | | Refactoring in commit 77982de955 (CMakePackageConfigHelpers: only emit arch check if needed, 2023-01-29, v3.26.0-rc1~16^2) did not correctly preserve the check for empty `CMAKE_SIZEOF_VOID_P`. Fix it. The difference between the version files generated before and after is: -if(CMAKE_SIZEOF_VOID_P STREQUAL "" OR "8" STREQUAL "") +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") This restores the check generated before the above-mentioned commit. Fixes: #24608
* CMakePackageConfigHelpers: only emit arch check if neededAndrea Pappacoda2023-01-291-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* CMakePackageConfigHelpers: Add ARCH_INDEPENDENT optionJustin Bassett2018-11-301-1/+2
| | | | | | | Allow skipping the architecture check in the package version file generated from calling write_basic_package_version_file. Document said architecture check. Fixes: #16184
* Help: Use 'deprecated' template, and date deprecation of modulesJoachim Wuttke (o)2018-10-251-2/+3
|
* Help: Convert remaining modules to block-style commentsKitware Robot2018-10-221-16/+17
|
* WriteBasicConfigVersionFile: Add SameMinorVersion COMPATIBILITY optionDaniele E. Domenichelli2017-11-211-1/+1
|
* Don't include CMakeParseArgumentsDaniel Pfeifer2017-01-111-2/+0
| | | | | | | | | | | | The cmake_parse_arguments command is builtin with version 3.5. The CMakeParseArguments module is empty and exists for backwards compatibility with CMake 3.4 and lower. Remove the includes of CMakeParseArguments from CMake's modules. The modules are always used with the current version of CMake. Leave the includes in the tests, as the tests may be run with an older version of CMake.
* Simplify CMake per-source license noticesBrad King2016-09-271-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Modules: Format documentation to avoid over-long preformatted linesBrad King2014-10-221-1/+4
| | | | | | Convert several preformatted code block literals that enumerate lists of options or variables to use reST definition lists instead. Manually wrap other long lines in code blocks.
* write_basic_package_version_file: use PROJECT_VERSIONAlex Neundorf2014-01-291-2/+6
| | | | | | | In the write_basic_package_version_file(), the VERSION argument is now optional. If none is given, it falls back to ${PROJECT_VERSION}. Alex
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-1/+11
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-2/+2
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* wrap write_basic_config_version_file as write_basic_package_version_file()Alex Neundorf2012-03-071-26/+1
| | | | | | | So the name fits better with configure_package_config_file(), as discussed on the mailing list. Adapt the documentation accordingly. Alex
* Improve documentation for WriteBasicConfigVersionFile.cmakeAlex Neundorf2011-08-051-7/+11
| | | | Alex
* Really fix copyright noticeAlex Neundorf2011-08-011-1/+1
| | | | Alex
* Fix copyright noticeAlex Neundorf2011-08-011-3/+12
| | | | Alex
* Add example to documentationAlex Neundorf2011-08-011-0/+7
| | | | Alex
* Provide macro write_basic_config_version_file()Alex Neundorf2011-08-011-0/+49
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