summaryrefslogtreecommitdiff
path: root/Modules/CheckIncludeFiles.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Help:Check*: include CMAKE_REQUIRED_* vars to dedupescivision2023-03-141-16/+11
| | | | | | CMAKE_REQUIRED_FLAGS now notes that space-delimited string, not ;-list is required, which could be surprising compared to similar options that do use ;-list
* Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.logBrad King2023-01-181-9/+1
| | | | | | | | | | `try_compile` and `try_run` now automatically log checks using them to `CMakeConfigureLog.yaml`. Add `LOG_DESCRIPTION` arguments to some `try_compile` calls to replace the description previously written to the old logs. Issue: #23200
* Check*: Restore support for arbitrary result variable namesZhong Ruoyu2022-11-281-2/+3
| | | | | | | | | | | | | | | | | | | | In commit db76876db5 (Modules: Use new SOURCES_FROM_* try_compile (1/2), 2022-09-26, v3.25.0-rc1~74^2~1) and commit 41f7b1169a (Modules: Use new SOURCES_FROM_* try_compile (2/2), 2022-09-26, v3.25.0-rc1~74^2) the switch to `SOURCE_FROM_*` required a stronger precondition (the second argument to check_include_files must not have path components) than before (any variable name could be used). Fix that by transforming the variable name to a C identifier before feeding it to try_compile as a filename. The filename is unspecified by the documentation, and the file itself is only temporary, so that should work fine. I have gone through all the occurrences of `SOURCE_FROM_*`, and identified these two that require changes. The rest should work fine as the filenames do not depend on input variable names. Fixes: #24204
* Modules: Use new SOURCES_FROM_* try_compile (1/2)Matthew Woehlke2022-09-271-9/+7
| | | | | | | | | | | Modify some modules that ship with CMake to use the new SOURCES_FROM_* arguments to try_compile / try_run as added by commits cb14ae2b87 (try_compile: Add SOURCE_FROM_{ARG,VAR}, 2022-09-21) and 611d801790 (try_compile: Add SOURCE_FROM_FILE, 2022-09-22). This covers users which previously either used an existing file (but sometimes needed to rename it), or which wrote out their source in entirety. It does NOT cover users that actually need configure_file functionality, as those will be more involved to update and will thus be tackled in part 2.
* Modules: Use new keyword-dispatched try_compile signatureMatthew Woehlke2022-09-141-2/+1
| | | | | | | | | | | Modify most of the modules that ship with CMake to use the new try_compile / try_run signatures added by commit aa9220d3a0 (try_compile: Add keyword-dispatched signature, 2022-09-02). This improves debugging by each invocation using its own directory so that the results of multiple invocations can be retained. This does not cover any invocations which provide an entire project, as that flavor of try_compile has not yet been updated.
* Help: Add `.. versionadded` directives to module docsNikita Nemkin2020-12-021-2/+4
| | | | Issue: #19715
* Refactor: Use added message types in various modulesAlex Turbov2019-11-021-3/+3
| | | | Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* Check* functions family: add support for LINK_OPTIONSMarc Chevrier2018-12-011-10/+21
| | | | Fixes: #18521
* Help: Convert remaining modules to block-style commentsKitware Robot2018-10-221-39/+40
|
* CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIESBrad King2018-04-181-0/+27
| | | | | | | | | | | | | Other check modules honor this variable, so include file checks should too. Add policy `CMP0075` to enable the behavior in a compatible way. This change was originally made by commit v3.11.0-rc1~108^2 (CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES, 2017-12-24) but it was reverted by commit v3.11.1~9^2 (Revert "CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES", 2018-04-04) because the behavior change could affect checks in existing projects in an incompatible way. Fixes: #9514
* Revert "CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES"Brad King2018-04-041-3/+0
| | | | | | | | | | This reverts commit v3.11.0-rc1~108^2 (CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES, 2017-12-24). The behavior change can affect checks in existing projects that don't expect the behavior. Introducing the behavior again will require a policy. Fixes: #17874 Issue: #9514
* CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIESDon Hinton2018-01-101-0/+3
| | | | | | | | This is needed when cross compiling and the compiler requires a specific linker different from the default, e.g., when cross compiling from Darwin to Linux and passing `-fuse-ld=lld` to clang. Fixes: #9514
* Merge topic 'pragma-once'Brad King2017-12-041-0/+2
|\ | | | | | | | | | | | | 4d611868 Check*: Added include guards Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1327
| * Check*: Added include guardsCristian Adam2017-12-011-0/+2
| |
* | CheckIncludeFiles: Fix name of source file used for checkBrad King2017-11-301-2/+2
| | | | | | | | | | | | | | | | | | | | In commit 7669695a74 (CheckIncludeFiles: extend to allow a LANGUAGE argument, 2017-11-08) the file name used for the check was accidentally left as `${var}.c`, where `var` is not a variable we define. It was passing tests by accidentally using just `.c` as the file name, but can break in real projects that may leave `var` defined to something else. The reference was taken from similar code in CheckTypeSize where the variable names are different. Fix our reference to be `${VARIABLE}`.
* | CheckIncludeFiles: improve warning for missing argumentDavid Adam2017-11-241-3/+5
| |
* | CheckIncludeFiles: clean up documentation of new featuresDavid Adam2017-11-241-3/+5
| |
* | CheckIncludeFiles: extend to allow a LANGUAGE argumentDavid Adam2017-11-111-3/+29
|/ | | | Allows CheckIncludeFiles to work for C or C++.
* Simplify CMake per-source license noticesBrad King2016-09-271-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use string(APPEND) in ModulesDaniel Pfeifer2016-07-281-4/+4
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* Help: Revise CheckIncludeFile* documentationBrad King2015-06-251-14/+19
| | | | | Improve formatting. Link from each module to the other two. Explain the command signatures in more detail.
* Help: Document that the CHECK_* macros create cache variablesSebastian Leske2014-09-111-0/+1
| | | | Otherwise callers may expect to be able to re-use result variables.
* CheckIncludeFiles: Use modern C declaration for 'main' (#15058)Nate Eldredge2014-08-051-1/+1
| | | | | Otherwise some compilers will incorrectly fail the checks when certain warning/error flags are enabled.
* Check*: Allow result variables to contain regex special characters (#14923)Brad King2014-07-311-1/+1
| | | | | | | | | | | | | | | | | | Prior to the existence of the if(DEFINED) condition, many of our Check modules implemented the condition with a hack that takes advantage of the auto-dereference behavior of the if() command to detect if a variable is defined. The hack has the form: if("${VAR} MATCHES "^${VAR}$") where "${VAR}" is a macro argument reference. However, this does not work when the variable named in the macro argument contains characters that have special meaning in regular expressions, such as '+'. Run the command git grep -E 'if\("\$\{.*\}" MATCHES "\^\$\{.*\}\$"\)' -- Modules/Check* to identify lines with this problem. Use if(NOT DEFINED) instead.
* Check*.cmake : Add CMAKE_REQUIRED_QUIET flag.Clinton Stimpson2014-03-291-3/+10
| | | | | Setting this flag can silence messages from the Check*.cmake modules. This can be used by Find*.cmake modules when they are in silent mode.
* Drop use of configure_file IMMEDIATE optionDaniele E. Domenichelli2013-11-131-1/+1
| | | | | | Since commit 7d47c693 (Drop compatibility with CMake < 2.4, 2013-10-08) we no longer need to use the configure_file IMMEDIATE option to support compatibility modes less than 2.0.
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-8/+20
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* Remove period at the end of the check message.Stephen Kelly2012-09-291-1/+1
| | | | Other messages don't have one.
* 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-37/+37
| | | | | | | | | | | | | | | | | 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
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-3/+3
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* CheckIncludeFiles: Shorten check description messageBrad King2012-04-091-4/+14
| | | | | | | | | | | | | | | | | Since commit 44d007b6 (CheckIncludeFiles: fix status output, 2012-02-01) check_include_files reports the list of files tested instead of the name of the variable storing the result. Some projects incrementally test and concatenate very long lists leading to long messages that do not provide much information. Users report confusion especially when the lines wrap. For lists of more than two files produce messages of the format Looing for N include files first.h, ..., last.h where N is the list length and "..." is literal. Leave the log file entries and cache entry description unchanged as they should have the full detail of the check performed.
* CheckIncludeFiles: fix status outputRolf Eike Beer2012-02-011-5/+5
| | | | | | | | | | CHECK_INCLUDE_FILES("foo.h" HAVE_FOO_H) gave an output like: Looking for include files HAVE_FOO_H After this change it does now what CHECK_INCLUDE_FILE() also does: Looking for include files foo.h
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-0/+13
| | | | | | | 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.
* BUG: fix double cmakefiles directoryBill Hoffman2008-02-171-1/+1
|
* ENH: centralized locaiton of CMakeFiles settingKen Martin2006-06-141-4/+4
|
* BUG: Fix the moduleAndy Cedilnik2006-02-241-1/+1
|
* ENH: Make modules use configure instead of file writeAndy Cedilnik2006-02-231-7/+8
|
* ENH: Made Check* modules more consistent and well documented. Added ↵Brad King2006-02-091-5/+8
| | | | CMAKE_REQUIRED_DEFINITIONS option.
* ENH: Patch from Alexander Neundorf to improve behavior.Brad King2006-02-091-1/+8
|
* ENH: put CmakeTmp into CMakeFilesKen Martin2006-01-121-3/+3
|
* ENH: some style fixes for the bookKen Martin2005-12-151-2/+2
|
* ENH: add documentation support for modulesBill Hoffman2005-12-141-6/+6
|
* DOC: better documentaitonKen Martin2005-11-021-0/+3
|
* ENH: put cmake files intoa CMakeFiles subdir to clean up bin treeKen Martin2005-07-291-2/+2
|
* ENH: When test fails, write out the outputAndy Cedilnik2004-10-051-1/+1
|
* ENH: Cleanups and add missing CMakeOutput.log and CMakeError.log appending. ↵Andy Cedilnik2003-08-081-0/+4
| | | | Close Bug #136 - Verify that all modules that do try compile produce CMakeError.log and CMakeOutput.log
* ENH: Extra new line after outputAndy Cedilnik2003-07-171-1/+1
|
* ENH: Replace WRITE_FILE with FILE(WRITE and FILE(APPEND. Replace ↵Andy Cedilnik2003-07-111-14/+12
| | | | MAKE_DIRECTORY with FILE(MAKE_DIRECTORY, replace STRING(ASCII things