Skip to content
  • Stephen Kelly's avatar
    cmGlobalGenerator: Add API to get settings from top-level cmMakefile · f59e8779
    Stephen Kelly authored
    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.
    f59e8779