This topic was never tested without some follow-up commits. The
GetCacheEntryValue API returns a pointer to memory freed on return.
It will have to be revised along with the rest of the original topic.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
We revert commit "Create CMake Policy CMP0015 to fix set(CACHE)" because
the NEW behavior of the policy breaks a valid use case:
# CMakeLists.txt
option(BUILD_SHARED_LIBS "..." ON)
add_library(mylib ...)
set(BUILD_SHARED_LIBS OFF) # we want only mylib to be shared
add_subdirectory(ThirdParty)
# ThirdParty/CMakeLists.txt
option(BUILD_SHARED_LIBS "..." ON)
# uh, oh, with NEW behavior this dir uses shared libs!!!
We'll re-introduce the policy later with a different change in behavior
to resolve the motivating case, which was more subtle but less common.
See issue #9008.
This converts the CMake license to a pure 3-clause OSI-approved BSD
License. We drop the previous license clause requiring modified
versions to be plainly marked. We also update the CMake copyright to
cover the full development time range.
The commit "Remove barely-used cmMakefile::AddCacheDefinition" broke
option() calls that pass a non-boolean default value. We restore the
old behavior by always coercing the value to 'ON' or 'OFF'.
The set(CACHE) and option() commands should always expose the cache
value. Previously we failed to expose the value when it was already set
if a local variable definition hid it. When set to NEW, this policy
tells the commands to always remove the local variable definition to
expose the cache value. See issue #9008.
The boolean overload of this method was used only to implement option().
We re-implement option() in terms of the main method and removes the
now-unused signature. This removes some duplicate code that had already
fallen behind on changes (it was not removing the local definition
instead of setting it).