summaryrefslogtreecommitdiffstats
path: root/Modules/CheckSymbolExists.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:Check*: refactor: use block(SCOPE_FOR POLICIES)scivision2023-03-081-2/+2
|
* Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.logBrad King2023-01-181-11/+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
* CheckSymbolExists: Restore newline at end of test sourceAndrey Vostrikov2022-12-021-1/+1
| | | | | | | | | | Refactoring in commit db76876db5 (Modules: Use new SOURCES_FROM_* try_compile (1/2), 2022-09-26, v3.25.0-rc1~74^2~1) accidentally dropped the final newline of the test source, which was previously provided by the input to `configure_file`. The C standard requires a newline at the end of file, so add one explicitly. Signed-off-by: Andrey Vostrikov <andrey.vostrikov@cogentembedded.com>
* Modules: Use new SOURCES_FROM_* try_compile (1/2)Matthew Woehlke2022-09-271-15/+12
| | | | | | | | | | | 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.
* CheckSymbolExists: Work around GCC failure with -pedantic-errors optionTimo Röhling2021-10-221-0/+15
| | | | | | | | | | | | GCC mistakenly issues the pedantic warning "ISO C forbids conversion of function pointer to object pointer type". With -pedantic-errors in the compile flags, that diagnostic prevents check_symbol_exists() from detecting function symbols. The solution is to filter out -pedantic-errors (and -Werror, just to be future proof) before invoking try_compile(). Fixes: #13208
* Help: refer to CheckSourceCompiles instead of olderMichael Hirsch2021-08-111-1/+1
|
* 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>
* CheckCXXSymbolExists: Make C++-syntax symbols work on more compilersHong Xu2019-07-261-2/+23
| | | | | On some compilers the syntax `#ifndef std::fopen` will always lead to compilation error. Avoid generating it in the check.
* CheckSymbolExists: Add examples for check_symbol_existsHong Xu2019-07-101-0/+11
| | | | | | Add examples in `CheckCXXSymbolExists` too. Co-Author: Brad King <brad.king@kitware.com>
* Check* functions family: add support for LINK_OPTIONSMarc Chevrier2018-12-011-6/+17
| | | | Fixes: #18521
* CheckSymbolExists: Fix CMP0054 warningRuslan Baratov2018-03-221-0/+5
|
* Check*: Added include guardsCristian Adam2017-12-011-0/+2
|
* CheckSymbolExists: Rename implementation macroCristian Adam2017-07-201-3/+3
| | | | | | Currently the implementation macro for `check_symbol_exists` is `_check_symbol_exists`, which impedes CMake users from overriding the `check_symbol_exists` macro themselves.
* CheckSymbolExists: Document that intrinsics may not be detectedBrad King2017-04-121-2/+2
| | | | Fixes: #16794
* CheckSymbolExists: Format documentationBrad King2017-04-121-18/+26
|
* CheckSymbolExists: Convert docs to bracket comment syntaxBrad King2017-04-121-32/+33
|
* 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-271-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'
* Check(Function|Library|Symbol)Exists: make it work if only C++ is enabledRolf Eike Beer2015-09-251-3/+7
|
* 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.
* Check*: Add compatibility hack for old VXL codeBrad King2014-08-181-1/+1
| | | | | | | | | | | | | The cleanup in commit 4f2fcce4 (Check*: Allow result variables to contain regex special characters, 2014-07-31) broke old VXL code that abuses the old "if(MATCHES)" implementation by using SET( ${VARIABLE} ${VARIABLE} ) to reset a check result variable. Add a compatibility hack to the CheckFunctionExists, CheckIncludeFileCXX, and CheckSymbolExists modules to re-run their checks when the result variable is set to its own name. Use STREQUAL instead of MATCHES so that special characters still work.
* 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-301-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-16/+23
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* Handle targets in the LINK_LIBRARIES of try_compile.Stephen Kelly2013-02-221-5/+2
| | | | | | | | | | Imported targets are re-exported so that they can be used by the try_compile generated code with target_link_libraries. This makes the use of the cmake_expand_imported_targets macro obsolete. The macro is not able to expand the generator expressions which may appear in the IMPORTED_LINK_INTERFACE_LIBRARIES content. Instead it just sees them as 'not a target'.
* 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-10/+10
| | | | | | | | | | | | | | | | | 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-35/+35
| | | | | | | | | | | | | | | | | 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
* Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIESAlex Neundorf2012-02-211-1/+6
| | | | | | | | | | | Add the function cmake_expand_imported_targets() to expand imported targets in a list of libraries into their on-disk file names for a particular configuration. Adapt the implementation from KDE's HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES which has been in use for over 2 years. Call the function from all the Check*.cmake macros to handle imported targets named in CMAKE_REQUIRED_LIBRARIES. Alex
* CheckSymbolExists: force the compiler to keep the referenced symbolRolf Eike Beer2012-01-161-1/+1
| | | | | | | | | | | | Otherwise the compiler may optimize out the reference to the symbol as the previous version was not really using this. This leads to symbols that are only in a header but not in the given libraries to be reported as present. This came up on the first try to fix bug 11333 as "gcc -O3" would optimize out the reference to pthread_create() so the correct library the symbol is in was not detected. The new test code was suggested by Brad King.
* CheckSymbolExists: Use IMMEDIATE flag for configure_file (#11333)David Cole2011-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | The test "complex" sets the variable CMAKE_BACKWARDS_COMPATIBILITY to 1.4. When that variable is set, configure_file does not default to IMMEDIATE mode processing. And so, the output file likely does not exist yet by the time the next line in the CMakeLists.txt file is processed. When that next line is "try_compile" on that file, this is a problem. Fix the problem by explicitly using IMMEDIATE in the configure_file call. This problem was quite mysterious, as it only showed up on the "complex" test, when the previous commit introduced a CheckSymbolExists call into the FindThreads module. Which is not even explicitly included in the "complex" test... FindThreads gets included indirectly only as a side effect of setting CMAKE_BACKWARDS_COMPATIBILITY to 1.4 and even then it's included indirectly by auto-inclusion of CMakeBackwardCompatibilityC.cmake... Wow. Just wow.
* Remove debug output from CheckSymbolExistsAlex Neundorf2011-07-291-1/+0
| | | | | | ...which shouldn't have been committed. Alex
* Add CheckCXXSymbolExists.cmake, so this can be used also for C++Alex Neundorf2011-07-081-9/+16
| | | | | | | This commit splits check_symbol_exists() so that the actual implementation can be also used by check_cxx_symbol_exists() Alex
* Update CheckSymbolExists copyright yearBrad King2011-01-171-1/+1
| | | | | Reflect that commit 840f9c05 (Document CheckSymbolExists more clearly, 2011-01-12) changed the file in 2011.
* Document CheckSymbolExists more clearly (#11685)Brad King2011-01-121-5/+12
| | | | | | The check works for macros, functions, and variables, but not for types or enumeration values. Clearly describe the behavior of the check with respect to each symbol type.
* 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.
* ENH: centralized locaiton of CMakeFiles settingKen Martin2006-06-141-6/+6
|
* ENH: Make modules use configure instead of file writeAndy Cedilnik2006-02-231-9/+9
|
* ENH: Made Check* modules more consistent and well documented. Added ↵Brad King2006-02-101-5/+9
| | | | CMAKE_REQUIRED_DEFINITIONS option.
* ENH: Pay attention to CMAKE_REQUIRED_INCLUDES.Brad King2006-02-091-0/+9
|
* ENH: put CmakeTmp into CMakeFilesKen Martin2006-01-121-4/+4
|
* ENH: some style fixes for the bookKen Martin2005-12-151-3/+3
|
* ENH: add documentation support for modulesBill Hoffman2005-12-141-8/+7
|
* DOC: better documentaitonKen Martin2005-11-021-0/+4
|
* ENH: put cmake files intoa CMakeFiles subdir to clean up bin treeKen Martin2005-07-291-2/+2
|