summaryrefslogtreecommitdiff
path: root/Modules/CMakeTestFortranCompiler.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.logBrad King2023-01-181-12/+0
| | | | | | | | | | `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
* Modules: Use new SOURCES_FROM_* try_compile (1/2)Matthew Woehlke2022-09-271-4/+6
| | | | | | | | | | | 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-4/+4
| | | | | | | | | | | 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.
* Merge topic 'enable_language-CMP0126'Brad King2021-07-191-0/+3
|\ | | | | | | | | | | | | 3ddd7f3576 enable_language: Fix test for working compiler with CMP0126 NEW behavior Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6355
| * enable_language: Fix test for working compiler with CMP0126 NEW behaviorBrad King2021-07-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the logic that converts a `try_compile` result from a cache entry to a normal variable to tolerate an existing normal variable under CMP0126 NEW behavior. Otherwise the `try_compile` result is ignored because CMake uses the false value of the normal variable, and CMake incorrectly reports that the compiler does not work. This went unnoticed for some languages (e.g. C and CXX) because the check for a working compiler is skipped if ABI detection works. It does affect other languages (e.g. CSharp). Fixes: #22423
* | Fortran: Subsume F90 check into ABI checkMichael Hirsch2021-06-251-1/+8
|/ | | | | | | | | Follow the approach from commit 1d21dd0f7c (enable_language: Assume compiler works if ABI detection compiles, 2020-05-25, v3.18.0-rc1~93^2) to avoid a redundant check for F90 support. Almost all maintained Fortran compilers support F90 these days. Fixes: #22222
* enable_language: Assume compiler works if ABI detection compilesBrad King2020-05-251-59/+59
| | | | | | | | | | | | | | | We run a `try_compile` with a tiny test source to check if the compiler works so that we can fail early if it does not. When the compiler does work, we immediately `try_compile` the ABI detection source. In the common case that both steps work, we gain no useful information from the first one and the work was wasted. Re-order the checks to try the ABI detection first. If it works then assume the compiler works and skip the dedicated check. If the ABI check fails then proceed with the normal test for a working compiler so the diagnostic can be shown as before. Fixes: #18703
* Refactor: Use added message types in various modulesAlex Turbov2019-11-021-6/+6
| | | | Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* Maint: misc. typosluz.paz2018-02-161-1/+1
| | | | Found via `codespell`
* Improve formatting of compiler failure error messageBrad King2017-09-191-2/+3
| | | | | | When we report that a compiler was unable to build a simple test program, indent the output of the attempt so that our message formatting will show it as a pre-formatted block.
* 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.
* 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.
* Fortran: Use explicit type in Fortran 90 checkBrad King2013-07-011-1/+1
| | | | | | | | | | In CMakeTestFortranCompiler we build a test program using a Fortran 90 construct to check whether the compiler supports the language. Some compilers have options to require explicit variable types. Fix the test program to use an explicit variable type so it passes under such a configuration. Suggested-by: Neil Carlson <neil.n.carlson@gmail.com>
* Move CMAKE_<LANG>_COMPILER_WORKS to compiler information filesBrad King2012-08-241-37/+47
| | | | | | | | Since the parent commit this test result is specific to the version of CMake. Store it in the version-specific compiler information files instead of CMakeCache.txt so testing can be re-done to meet the requirements of the current version of CMake even if another version of CMake was already used to configure the build tree.
* Make platform information files specific to the CMake versionBrad King2012-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | At the top of a build tree we configure inside the CMakeFiles directory files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to save information detected about the system and compilers in use. The method of detection and the exact results store varies across CMake versions as things improve. This leads to problems when loading files configured by a different version of CMake. Previously we ignored such existing files only if the major.minor part of the CMake version component changed, and depended on the CMakeCache.txt to tell us the last version of CMake that wrote the files. This led to problems if the user deletes the CMakeCache.txt or we add required information to the files in a patch-level release of CMake (still a "feature point" release by modern CMake versioning convention). Ensure that we always have version-consistent platform information files by storing them in a subdirectory named with the CMake version. Every version of CMake will do its own system and compiler identification checks even when a build tree has already been configured by another version of CMake. Stored results will not clobber those from other versions of CMake which may be run again on the same tree in the future. Loaded results will match what the system and language modules expect. Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to CMAKE_PLATFORM_INFO_DIR to clarify its purpose. The new variable points at the version-specific directory while the old variable did not.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-9/+9
| | | | | | | | | | | | | | | | | 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-42/+42
| | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | 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/ \+$//'
* Load platform files that need to know the ABI when possibleBrad King2011-12-051-0/+6
| | | | | | | | Load platform files named in CMAKE_<lang>_ABI_FILES for each language once the ABI sizeof(void*) is known. During the first configuration this is after the test for working compiler and ABI detection checks. During later configurations the ABI information is immediately available because it has been saved in CMake<lang>Compiler.cmake.
* Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
|
* Load compiler information after configuring itBrad King2010-05-061-0/+1
| | | | | | | | | | | After configuring CMakeFiles/CMake<lang>Compiler.cmake in the build tree the second time (to store ABI information), include it immediately. This allows any logic and settings in the compiler information files to be used without duplicating it in CMakeDetermineCompilerABI.cmake. The change in commit "Use Fortran ABI detection results conservatively" (2010-05-05) needs this to use the same logic to set CMAKE_SIZEOF_VOID_P during first and later runs of CMake.
* Make a common function that prints the status during the checks for working ↵David Cole2010-02-121-3/+5
| | | | compilers. Call it from all of the CMakeTesten_US.UTF-8Compiler.cmake files. In the message, print the full path to the tested compiler only for the Makefile generators. For Xcode and Visual Studio generators, print the generator instead so that users are not misled with the full path to a compiler that the generator may not even use. Xcode and Visual Studio have their own mechanisms for choosing the compiler to use during try_compile and build...
* 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.
* Pass Fortran90 test result to try-compileBrad King2009-07-301-28/+28
| | | | | | | This stores CMAKE_Fortran_COMPILER_SUPPORTS_F90 in the Fortran compiler information file CMakeFiles/CMakeFortranCompiler.cmake instead of in CMakeCache.txt. This file makes the result available to try-compile projects.
* ENH: Create Fortran ABI detection frameworkBrad King2009-07-131-0/+14
| | | | | This invokes CMakeDetermineCompilerABI.cmake for Fortran at the same place it is already done for C and CXX.
* STYLE: use IF(NOT ...) instead of IF() ELSE() ... ENDIF()Alexander Neundorf2008-05-121-3/+2
| | | | Alex
* ENH: centralized locaiton of CMakeFiles settingKen Martin2006-06-141-8/+8
|
* ENH: put CmakeTmp into CMakeFilesKen Martin2006-01-121-4/+4
|
* ENH: add documentation support for modulesBill Hoffman2005-12-141-0/+1
|
* ENH: put cmake files intoa CMakeFiles subdir to clean up bin treeKen Martin2005-07-291-4/+4
|
* ENH: Added test for Fortran90 support.Brad King2005-02-041-4/+37
|
* ENH: more uniform approach to enable language, one step closer to being able ↵Bill Hoffman2004-08-261-12/+12
| | | | to enable a language without modifing cmake source code
* ENH: minor fortran fixesBill Hoffman2004-08-111-4/+5
|
* ENH: initial fortran supportBill Hoffman2004-08-061-0/+31