summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeGenericSystem.cmake
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Allow CMAKE_INSTALL_PREFIX to be set by environment variableSilvio Traversaro2024-01-301-9/+16
| | | | Fixes: #25023
* AutoMoc: Don't initialize already defined CMAKE_AUTOMOC_ variablesJoerg Bornemann2022-11-161-3/+9
| | | | | | | | | | | | | | | | | Setting the variables CMAKE_AUTOGEN_ORIGIN_DEPENDS, CMAKE_AUTOMOC_COMPILER_PREDEFINES, and CMAKE_AUTOMOC_MACRO_NAMES on the cmake command line did not work as expected. CMakeGenericSystem.cmake initialized these variables even if they were defined by the user. This led to the confusing situation where the cache variant of a variable had one value (defined on the command line) and the non-cache variant of a variable had a different value (defined in CMakeGenericSystem.cmake). Fix this by checking whether the variables are defined before setting their default values. Fixes: #24069
* Merge topic 'color-diagnostics'Brad King2022-03-091-3/+8
|\ | | | | | | | | | | | | | | | | | | | | 6ab9fbd43b color: Add tests for CMAKE_COLOR_DIAGNOSTICS 78adb1b952 color: Add CMAKE_COLOR_DIAGNOSTICS environment variable 884d9de8b7 color: Introduce CMAKE_COLOR_DIAGNOSTICS variable Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Frank Dana <ferdnyc@gmail.com> Merge-request: !6990
| * color: Add CMAKE_COLOR_DIAGNOSTICS environment variableSemyon Kolton2022-03-081-0/+4
| |
| * color: Introduce CMAKE_COLOR_DIAGNOSTICS variableSemyon Kolton2022-03-081-3/+4
| | | | | | | | | | | | | | Add a variable to control both makefile color messages and compiler color diagnostics. Fixes: #15502
* | genex-LINK_LIBRARY: rename configuration variablesMarc Chevrier2022-02-161-1/+1
|/ | | | | | To be more consistent between genex and variables as well as the forecomming LINK_GROUP genex, rename variable *_LINK_USING_<FEATURE>* in *_LINK_LIBRARY_USING_<FEATURE>*
* $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target propertyMarc Chevrier2022-02-081-0/+6
| | | | | | To enable the management of incompatible $<LINK_LIBRARY> declarations, add LINK_LIBRARY_OVERRIDE and LINK_LIBRARY_OVERRIDE_<LIBRARY> target properties.
* VS: Fix CMAKE_INSTALL_PREFIX with GENERATOR_PLATFORM for x64 and ARMRechi2020-09-251-0/+4
| | | | | | | | Generate the same default `CMAKE_INSTALL_PREFIX` if a project is configured with CMAKE_GENERATOR_PLATFORM (`cmake -G "Visual Studio [...]" -A x64` and `cmake -G "Visual Studio [...]" -A ARM`) instead of the prior CMake 3.1 way (`cmake -G "Visual Studio [...] Win64"` and `cmake -G "Visual Studio [...] ARM"`).
* Merge branch 'backport-3.17-automoc-path-prefix-off'Brad King2020-08-101-1/+3
|\
| * Merge branch 'backport-3.16-automoc-path-prefix-off'Brad King2020-08-101-1/+3
| |\
| | * Autogen: Turn off moc path prefix generation by defaultJoerg Bornemann2020-08-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the default value of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF` to restore compatibility with behavior of CMake 3.15 and below. C++ source files that are generated by Qt's meta object compiler (moc) include the header file that was passed as input argument to moc. This is usually a path relative to the source directory, for example #include "../../source/dir/myobject.h" That is problematic for reproducible builds as described in #18815. To cope with that, the target property AUTOMOC_PATH_PREFIX was introduced in CMake 3.16 by commit d018d27c10 (Autogen: Add moc path prefix generation (AUTOMOC_PATH_PREFIX), 2019-09-13, v3.16.0-rc1~94^2~4). The property is default-initialized from the variable `CMAKE_AUTOMOC_PATH_PREFIX`, which defaults to `ON`. If this property is ON, and myobject.h is located in an include directory of the target, moc-generated C++ files include the file without the "path prefix": #include "myobject.h" This behavior, however, can break projects that have equally named header files in different include directories. As "not breaking existing projects" trumps "have reproducible builds by default" we change the default of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF`. Also, it is now possible to pass `-DCMAKE_AUTOMOC_PATH_PREFIX=ON` on the CMake command line. Before, it was overridden in `CMakeGenericSystem`. Fixes: #20598 Issue: #18815
* | | Initialize CMAKE_EXPORT_COMPILE_COMMANDS only if not set alreadyBrad King2020-05-121-7/+1
|/ / | | | | | | | | | | Also de-duplicate its initialization code. Fixes: #16588
* | Autogen: Recognize the new Q_NAMESPACE_EXPORT macro in AUTOMOCRichard2020-02-261-1/+1
| | | | | | | | | | | | Qt 5.14 introduced a new moc keyword `Q_NAMESPACE_EXPORT`. Qt-Issue: https://bugreports.qt.io/browse/QTBUG-68014
* | Initialize CMAKE_EXPORT_COMPILE_COMMANDS from envvar of the same nameDaan De Meyer2019-10-181-4/+4
|/ | | | Fixes: #18386
* Autogen: Add moc path prefix generation (AUTOMOC_PATH_PREFIX)Sebastian Holtermann2019-09-161-0/+1
| | | | | | | | | | | | | | | | The new `AUTOMOC_PATH_PREFIX` boolean target property enables automatic generation of the path prefix `-p` option for `moc`. `AUTOMOC_PATH_PREFIX` is initialized from the variable `CMAKE_AUTOMOC_PATH_PREFIX`, which is ON by default. When `AUTOMOC_PATH_PREFIX` is enabled, CMake tests if a `moc`ed header file is in one of the include directories. If so, then the `-p` option, with the relative path of the header parent directory to the respective include directory, is added to the `moc` command. If the header file is not in an include directory, the `-p` option is omitted. Closes: #18815 "AUTOMOC: generated files include full relative path, breaking certain reproducible builds"
* Autogen: Add (CMAKE_)AUTOGEN_ORIGIN_DEPENDS supportSebastian Holtermann2018-11-031-0/+2
| | | | | | | | | | | | | | | This adds - the variable ``CMAKE_AUTOGEN_ORIGIN_DEPENDS`` which initializes - the target property ``AUTOGEN_ORIGIN_DEPENDS`` which controls whether or not the origin target dependencies should be forwarded to the corresponding ``_autogen`` target. The default value of ``CMAKE_AUTOGEN_ORIGIN_DEPENDS`` is ``ON`` which corresponds to the behavior that is in place since CMake 3.9. Closes: #18493
* GenericSystem: Remove misspelled flag defaultChristian Pfeiffer2018-01-231-1/+0
| | | | | | | | In CMakeGenericSystem, it should be ``CMAKE_INCLUDE_SEP_<LANG>`` and not ``CMAKE_INCLUDE_<LANG>_SEP``. However, if the flag is defined, include behavior changes to Java-style non-repeating flags, which isn't intended. Therefore, removing the (misspelled) default initialization should help remove confusion and unintended side effects.
* Unhardcode the CMAKE_CONFIGURATION_TYPES valuesBeren Minor2018-01-081-0/+1
| | | | | | | | | | | | This removes duplicated code for per-config variable initialization by providing a `cmake_initialize_per_config_variable(<PREFIX> <DOCSTRING>)` function. This function initializes a `<PREFIX>` cache variable from `<PREFIX>_INIT` and unless the `CMAKE_NOT_USING_CONFIG_FLAGS` variable is defined, does the same with `<PREFIX>_<CONFIG>` from `<PREFIX>_<CONFIG>_INIT` for every `<CONFIG>` in `CMAKE_CONFIGURATION_TYPES` for multi-config generators or `CMAKE_BUILD_TYPE` for single-config generators.
* Autogen: Add (CMAKE_)AUTOMOC_COMPILER_PREDEFINESSebastian Holtermann2017-09-291-0/+1
|
* Autogen: Define all macro names in CMAKE_AUTOMOC_MACRO_NAMESSebastian Holtermann2017-09-271-0/+1
| | | | | | | | | Instead of adding `Q_OBJECT` and `Q_GADGET` to the macro search list in `Source/cmQtAutoGenerators.cxx`, add them in `Modules/CMakeGenericSystem.cmake` to the default value of `CMAKE_AUTOMOC_MACRO_NAMES`. Also add `Q_NAMESPACE` to `CMAKE_AUTOMOC_MACRO_NAMES` which closes #17299.
* MSVC: Add support for ARM64 architectureMinmin Gong2017-09-121-0/+2
| | | | | | Visual Studio 15.4 adds support for this architecture. Fixes: #17213
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Makefile: Optionally disable target completion messages in build outputMichael Ensslin2015-07-141-0/+3
| | | | | | Add a TARGET_MESSAGES property to control whether Makefile targets print the "Built target " completion messages. Default to ON to preserve existing behavior.
* CMakeGenericSystem: Recognize Watcom WMake generator as Makefile generatorBrad King2015-07-141-1/+1
|
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-7/+7
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-51/+51
| | | | | | | | | | | | | | | | | Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Make the CMAKE_EXPORT_COMPILE_COMMANDS option work with Ninja.Stephen Kelly2012-06-041-0/+6
|
* Merge topic 'MakeDefaultInstallComponentNameConfigurable'David Cole2012-05-241-2/+6
|\ | | | | | | | | | | | | b71e731 -add docs for ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} 7ced073 make default install component name configurable b6fba35 -strip trailing whitespace
| * make default install component name configurableAlex Neundorf2012-05-141-0/+4
| | | | | | | | | | | | | | | | | | Until now an unnamed component was always named "Unspecified". Now this name is taken from the new cmake variable CMAKE_INSTALL_DEFAULT_COMPONENT_NAME, which is initialized to "Unspecified". But it can now be set to something project-specific, per directory Alex
| * -strip trailing whitespaceAlex Neundorf2012-05-131-2/+2
| | | | | | | | Alex
* | VS11: Fix ARM architecture hint typo (#13077)Brad King2012-05-101-1/+1
| |
* | VS11: Add ARM architecture generator (#13077)Minmin Gong2012-05-091-0/+2
|/
* Add an option to skip RPATH during installation.Stephen Kelly2012-03-051-0/+3
|
* Add VisualStudio 9 and 10 generators for Itanium platformMatej Hribernik2011-06-201-1/+1
|
* Only offer the compile command output feature on unix systemsManuel Klimek2011-05-161-3/+6
|
* make compile command output optionalManuel Klimek2011-04-251-0/+3
|
* Correct CMAKE_INSTALL_PREFIX value for Win64 apps (#9992)David Cole2010-09-091-13/+89
| | | | | | | | | | | | | The default value for CMAKE_INSTALL_PREFIX should be based on what architecture the built targets are, not what architecture CMake itself is. This fix merely guesses better what the built targets architecture is. It still may guess incorrectly in some cases. For those cases, it will have to be up to build scripts and developers on projects to pass in a correct value for CMAKE_INSTALL_PREFIX with -D on the command line or via 'force cache value' logic in CMakeLists.txt files.
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Split GNU compiler information filesBrad King2009-12-021-3/+0
| | | | | | | | | | | | | | This moves GNU compiler flags into new-style modules Compiler/GNU-<lang>.cmake Platform/<os>-GNU-<lang>.cmake We use language-independent helper modules Compiler/GNU.cmake Platform/<os>-GNU.cmake to define macros consolidating the information.
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-0/+14
| | | | | | | This adds copyright/license notification blocks CMake's non-find modules. Most of the modules had no notices at all. Some had notices referring to the BSD license already. This commit normalizes existing notices and adds missing notices.
* ENH: Allow projects to disable per-rule echo linesBrad King2009-03-161-3/+3
| | | | | | | | | This creates global property RULE_MESSAGES which can be set to disbale per-rule progress and action reporting. On Windows, these reports may cause a noticable delay due to the cost of starting extra processes. This feature will allow scripted builds to avoid the cost since they do not need detailed information anyway. This replaces the RULE_PROGRESS property created earlier as it is more complete. See issue #8726.
* ENH: Allow projects to disable per-rule progressBrad King2009-03-161-0/+3
| | | | | | | | This creates global property RULE_PROGRESS which can be set to disbale per-rule progress reporting. On Windows, progress reports may cause a noticable delay due to the cost of starting an extra process. This feature will allow scripted builds to avoid the cost since they do not need detailed progress anyway. See issue #8726.
* STYLE: this is not necessary anymore for kdevelop, the kdevelop generatorAlexander Neundorf2009-01-101-5/+1
| | | | | | | | | now generates the project so that the environment variable VERBOSE is set to 1 when make is executed by kdevelop (and additionally this didn't work, since CMAKE_GENERATOR never matches KDevelop3, this is now in CMAKE_EXTRA_GENERATOR) Alex
* ENH: Rename SET_PROPERITES command to SET_PROPERTY and give it a more ↵Brad King2008-01-171-1/+1
| | | | powerful signature.
* ENH: add flag so a terminating slash for the link path can be specified ↵Alexander Neundorf2007-08-281-0/+1
| | | | | | (needed by the Digital Mars D compiler) Alex
* BUG: use CMAKE_HOST_UNIX here instead of UNIXAlexander Neundorf2007-08-091-3/+3
| | | | Alex
* STYLE: change global cmake variable CMAKE_TARGET_SUPPORTS_ONLY_STATIC_LIBSAlexander Neundorf2007-06-261-1/+1
| | | | | | to the first global cmake property TARGET_SUPPORTS_SHARED_LIBS Alex
* ENH: print a warning if ADD_LIBRARY( SHARED/MODULE ) is used and the targetAlexander Neundorf2007-06-211-0/+3
| | | | | | platform doesn't support shared libraries Alex
* STYLE: move the two CMAKE_SHARED_LIBRARYC/CXX_FLAGS for gcc fromAlexander Neundorf2007-05-221-14/+8
| | | | | | CMakeGenericSystem.cmake to gcc.cmake Alex
* ENH: Allow user project code to distinguish between an install prefix set on ↵Brad King2006-10-161-0/+8
| | | | the command line and one set by CMake as a default. This is useful for changing the default prefix while still allowing the user to override it.