mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-10 01:28:02 +00:00
Add `SamePatchVersion`, `SameFullVersion`, and `SemanticVersion` support. Document `ExactVersion` as deprecated in favor of the clearer `SamePatchVersion`/`SameFullVersion` names. Closes: #18060
26 lines
877 B
CMake
26 lines
877 B
CMake
include(WriteBasicConfigVersionFile)
|
|
|
|
# Verify that ExactVersion remains accepted as a deprecated alias and
|
|
# generates the same config version file as SamePatchVersion.
|
|
set(_installed_version 1.2.3.4)
|
|
set(_exact_file "${CMAKE_CURRENT_BINARY_DIR}/ExactVersionConfigVersion.cmake")
|
|
set(_same_patch_file "${CMAKE_CURRENT_BINARY_DIR}/SamePatchVersionConfigVersion.cmake")
|
|
|
|
write_basic_config_version_file(
|
|
"${_exact_file}"
|
|
VERSION "${_installed_version}"
|
|
COMPATIBILITY ExactVersion)
|
|
|
|
write_basic_config_version_file(
|
|
"${_same_patch_file}"
|
|
VERSION "${_installed_version}"
|
|
COMPATIBILITY SamePatchVersion)
|
|
|
|
file(READ "${_exact_file}" _exact_content)
|
|
file(READ "${_same_patch_file}" _same_patch_content)
|
|
|
|
if(NOT _exact_content STREQUAL _same_patch_content)
|
|
message(SEND_ERROR
|
|
"ExactVersion should generate the same config version file as SamePatchVersion.")
|
|
endif()
|