mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-24 07:28:54 -06:00
In c4d12d7d we changed how the project command handles various variables
and made the behavior consistent across all variables controlled by
the project command. The conditions under which project() modifies the
various VERSION variables are non-intuitive, but can be observed as
side-effects.
Because this behavior is observable, it requires a policy to be changed.
This commit reverts to the previous behavior until a policy is added
and adds a test for that behavior.
Fixes: #27142
15 lines
488 B
CMake
15 lines
488 B
CMake
# TODO: In the future this should be a policy test, but for now verify version
|
|
# variables remain undefined for various configurations.
|
|
|
|
project(NoVersion LANGUAGES NONE)
|
|
|
|
foreach(pre "NoVersion_" "PROJECT_" "CMAKE_PROJECT_")
|
|
foreach(post "" "_MAJOR" "_MINOR" "_PATCH" "_TWEAK")
|
|
if(DEFINED ${pre}VERSION${post})
|
|
message(SEND_ERROR "${pre}VERSION${post} is defined when no project version was provided")
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
|
|
add_subdirectory(VersionSubdir)
|