https://github.com/Kitware/CMake
Revision f59e87792943904dcb11e16380883e87395d115f authored by Stephen Kelly on 06 October 2016, 16:01:36 UTC, committed by Stephen Kelly on 06 October 2016, 16:41:06 UTC
At generate-time, definitions are sometimes read from a nearby cmMakefile,
making the value directory-specific because they are read once per
directory.  Often however, the intention is more
often to create a 'global' setting, such that the user writes for
example:

 set(CMAKE_IMPORT_LIBRARY_SUFFIX something)

once at the top level of their project.

Many of these are also set by internal platform files, such as
CMAKE_EXTRA_LINK_EXTENSIONS.

The set() definitions are not really suitable for 'global' settings
because they can be different for each directory, and code consuming the
settings must assume they are different for each directory, and read it
freshly each time with new allocations.

CMake has other variable types which are global in scope, such as global
properties, and cache variables.  These are less convenient to populate
for users, so establish a convention and API using the value as it is at
the end of the top-level CMakeLists file.
1 parent b99bbfe
History
Tip revision: f59e87792943904dcb11e16380883e87395d115f authored by Stephen Kelly on 06 October 2016, 16:01:36 UTC
cmGlobalGenerator: Add API to get settings from top-level cmMakefile
Tip revision: f59e877
File Mode Size
Auxiliary
Help
Licenses
Modules
Packaging
Source
Templates
Tests
Utilities
.clang-format -rw-r--r-- 217 bytes
.gitattributes -rw-r--r-- 658 bytes
.gitignore -rw-r--r-- 64 bytes
.hooks-config.bash -rw-r--r-- 435 bytes
CMakeCPack.cmake -rw-r--r-- 8.1 KB
CMakeCPackOptions.cmake.in -rw-r--r-- 12.8 KB
CMakeGraphVizOptions.cmake -rw-r--r-- 153 bytes
CMakeLists.txt -rw-r--r-- 29.0 KB
CMakeLogo.gif -rw-r--r-- 4.4 KB
CONTRIBUTING.rst -rw-r--r-- 1.7 KB
CTestConfig.cmake -rw-r--r-- 440 bytes
CTestCustom.cmake.in -rw-r--r-- 5.8 KB
CompileFlags.cmake -rw-r--r-- 2.9 KB
Copyright.txt -rw-r--r-- 4.8 KB
DartConfig.cmake -rw-r--r-- 374 bytes
README.rst -rw-r--r-- 2.9 KB
bootstrap -rwxr-xr-x 46.6 KB
cmake_uninstall.cmake.in -rw-r--r-- 790 bytes
configure -rwxr-xr-x 99 bytes
doxygen.config -rw-r--r-- 27.4 KB

README.rst

back to top