100 Commits
Author SHA1 Message Date
scivision 32c8a4bd01 LLVMFlang: Add support for COMPILE_WARNING_AS_ERROR
LLVM/Flang has supported `-Werror` since version 13.
2026-08-31 12:05:01 -04:00
scivision c720e2a23d Help: Document execute_process(RESULT_VARIABLE) capture in source code guide
Issue: #27782
2026-05-07 13:42:00 -04:00
scivision 7406f0be82 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Capture `execute_process` calls' `RESULT_VARIABLE`.

We don't actually need to check the result as we presume the existing
logic is already adequate, and sometimes programs return non-zero values
as result of valid query.  I.e. this is a "safe" way to broadly protect
these scripts.

Issue: #27782
2026-05-07 13:36:36 -04:00
scivision 8d48d755f0 Tests: Add missing execute_process result checks 2026-05-06 11:16:36 -04:00
scivision a1b5c0da87 Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Capture the `execute_process` command's `RESULT_VARIABLE`.

Issue: #27782
2026-05-06 11:16:36 -04:00
scivision 6b4432bc10 FindGit: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Issue: #27782
2026-05-06 03:18:34 -04:00
scivision 40ef8fd781 ProcessorCount: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL
Fixes: #27780
Issue: #27782
2026-05-01 11:36:31 -04:00
scivision 3f3ba04d81 file(READ_SYMLINK): Add RESULT option to capture errors
Closes: #27753
2026-04-17 10:51:28 -04:00
scivision d0100b4060 ctest: Avoid printing failed if nothing failed
Fixes: #27607
2026-04-14 15:56:49 -04:00
scivision 1e9150439c NVHPC: Record C23 and C++26 support
NVHPC 26.3 documents support for `-std=c++26` [1].
The `-std=gnu*` flags were also added.

[1] https://docs.nvidia.com/hpc-sdk/archive/26.3/release-notes/index.html
2026-03-31 14:19:53 -04:00
scivision 67c84ef103 Help: Indicate that ctest --test-dir may be specified with a preset
In commit c971212703 (ctest: Allow --test-dir override when using
presets, 2024-04-20, v3.30.0-rc1~200^2) we forgot to update the docs.
2026-03-31 09:38:05 -04:00
scivision 02e9335d9c Help: Document that cmake --preset supports -B to override the build dir 2026-03-31 09:37:54 -04:00
scivision 917678157d Help: Note that generator expressions are supported only where documented
Issue: #27718
2026-03-25 13:36:22 -04:00
scivision d47ea5684a FindOpenMP: Add support for LLVMFlang on non-Windows too
LLVMFlang requires explicit linking to `libomp` on all platforms.
2025-08-25 11:17:41 -04:00
Michael Hirsch 050ddb800f Help: CXX_STANDARD 26 is supported on some compilers
e.g.  80d4bd5 added CXX_STANDARD 26 to IntelLLVM
2025-08-10 12:41:24 -04:00
Michael Hirsch 0d758be222 MSVC: Enable C23 language support
Introduced support via `-std:clatest` in cl 19.39.
2025-07-22 13:50:44 -04:00
scivision 836060a783 FindMatlab add R2025a version map
Just like 20412181e9
2025-06-12 21:53:29 -04:00
scivision 7be01178a0 Help: JSON argument should be quoted
The error that results from a semicolon anywhere in a JSON string
is not obvious.

Issue: #26628
2025-01-24 12:00:56 -05:00
scivision 9be6e42499 Help: Note try_compile/try_run caching 2024-12-18 10:04:47 -05:00
scivision 94b6f8bf4a Help: Check*Runs requires exit code 0 for success
Explicitly state this requirement to avoid ambiguity in what is
'success' of a program.
2024-12-03 16:00:26 -05:00
scivision 3530eef3fb Help: Clarify that if(PATH_EQUAL) does not access the filesystem
Fixes: #26421
2024-11-19 12:01:03 -05:00
scivision aa975c79fb Source: GlobalGenerator generic build message if generator mismatch
Make the error message more generic if there is a generator or build system mismatch,
as often Make is not the generator used. This comes up say if using a VM or WSL and
accidentally specifying the same build directory.
2024-10-10 09:43:21 -04:00
scivision 7a88ca2e56 Help: Document find_program filename suffix behavior
Issue: #16453
2024-10-03 08:00:41 -04:00
scivision 247497eacf NVHPC: Record C++23 support
NVHPC 24.9 documents support for `-std=c++23` [1].

[1] https://docs.nvidia.com/hpc-sdk/archive/24.9/hpc-sdk-release-notes/index.html
2024-10-02 10:34:35 -04:00
scivision b90d7a3a82 FindMatlab: On macOS search under ~/Applications and /Applications
users with locked-down macOS may not be able to install their desired Matlab
under /Applications, but may use the standard ~/Applications instead
2024-09-12 12:37:30 -04:00
scivision 20412181e9 FindMatlab: Add R2024b version map 2024-09-12 12:34:00 -04:00
scivision e8fd9ba8e8 CheckCompilerFlag: Add support for LLVMFlang
Make checks like

    check_compiler_flag(Fortran "-Wall" HAVE_WALL)

work with LLVMFlang.
2024-08-29 13:37:37 -04:00
scivision 7a39cfb012 Help Check{Function,Library}Exists refer to CheckSourceCompiles
help users be aware of more general/robust CheckSourceCompiles
2024-08-26 16:13:34 -04:00
scivision 588bab15c4 Help Check*CompilerFlag harmonize text
This is like recently done for Check*Source{Compiles,Runs}
2024-08-23 12:30:17 -04:00
Michael Hirsch 759776dcdb Help: Check*SourceRuns make text more concise.
Similar simplification was done in !9641 for Check*SourceCompiles
2024-08-15 22:33:55 -04:00
Michael Hirsch 5d42177a06 Help: Check*SourceCompiles, Check*CompilerFlag refer to new command
The CheckSourceCompiles and CheckCompilerFlag would generally be preferred general
command syntax, but users may not realize they exist, so help point them there.
2024-08-15 22:27:17 -04:00
scivision d03bb13839 Help: version 3.16 added cmake --log-level 2024-08-08 08:29:43 -04:00
scivision 4b9ed91424 Help: check_*source_compiles and CMAKE_TRY_COMPILE_TARGET_TYPE
Ref: #26103
2024-07-17 11:56:26 -04:00
scivision 80d4bd5370 IntelLLVM: Record C++26 support 2024-05-13 11:02:04 -04:00
scivision fc2bce54c7 Help: try_compile how to pass compiler options
it wasn't obvious how to pass compiler options. Since the old
add_definitions() is used we can workaround this by passing
compiler options there.
2024-05-11 22:57:38 -04:00
scivision 7fa0057c74 Help: emphasize need for VS Integrations with oneAPI Fortran
Be more explicit that VS Integration is required to use
Intel Fortran with MSVC.

It is common that users do not have VS Integration installed because
oneAPI is then only usable with a narrow range of MSVC versions,
even when oneAPI is used by itself with MSVC as the required backend.
Without VS Integration, a wide range of MSVC versions work as the
backend to oneAPI on Windows.
2024-03-29 15:29:59 -04:00
scivision be6763f34b Help: cmake(1) --toolchain path relative
other cmake(1) options are relative to cwd. It is surprising
enough that --toolchain is relative to -B or -S that it's
good to call it out here too.
2024-03-22 17:17:31 -04:00
scivision bade9832e6 FindMatlab: R2024a version map 2024-03-21 10:13:59 -04:00
scivision 53a542936e Help: Convert http URLs to https 2024-03-07 09:42:45 -05:00
scivision 434bd9c0ef Help: Document {CTEST,CMAKE_BUILD}_PARALLEL_LEVEL equivalent command-line
Clarify that the `--parallel` option isn't needed when these env.
variables are set to a finite integer.
2024-01-18 17:37:17 -05:00
scivision 6f7d87b40d FindMatlab: use NAMES for find_*
this improves readability especially for custom function
_Matlab_find_library
2024-01-16 22:39:13 -05:00
scivision 9e97893147 FindMatlab: set MATLAB_ARCH per process call
this is just a best practice refactor.
2024-01-16 22:34:01 -05:00
scivision 42fbe01eba FindMatlab: Accept long version in matlab_get_release_name_from_version
Make this work:

  matlab_get_release_name_from_version(${Matlab_VERSION})

which the user would expect.

While at it, simplify this function code.
2024-01-16 11:37:43 -05:00
scivision c608adc236 FindMatlab: Fix major.minor version lookups in Windows Registry
The registry key names use only the first two version components.
Previously we were using the full versions.

Fixes: #25582
2024-01-16 11:35:32 -05:00
Michael Hirsch 3f2a5971c0 Modules: CMAKE_*_COMPILER convert path to cmake path
Fixes #25456

Before this, CMake configure halted as the slashes were
interpreted as invalid escape characters
2023-12-05 19:08:39 -05:00
Michael Hirsch ad4481fa00 Source: Enhance check for C++17 filesystem support
* Add `lexically_normal` test for all platforms.

* On Windows, MinGW does not currently handle `lexically_normal()`
  correctly on UNC path, but MSVC and IntelLLVM do--add a comment
  on this to avoid future confusion.

* Add test with `\\?\` notation and `weakly_canonical` that also triggers
  the MinGW bug, but is fine with MSVC and oneAPI, for a more robust and
  comprehensive test.
2023-12-05 11:30:08 -05:00
scivision 5799d0e788 cmake: Improve error message if CMAKE_BINARY_DIR not writable
Fixes: #24407
2023-11-30 14:23:57 -05:00
scivision 12ae3fa0b6 Help: Document that ctest(1) --test-dir was added in 3.20 2023-11-30 08:58:44 -05:00
scivision 13465306cf Help: Clarify pass, fail and skip test properties and exit code
The behavior when system-level failures occur was not previously defined.
Clarify the behavior and provide an example for how to work around them.
Affected test properties:

- PASS_REGULAR_EXPRESSION
- FAIL_REGULAR_EXPRESSION
- SKIP_REGULAR_EXPRESSION
- SKIP_RETURN_CODE

Also update the existing WILL_FAIL test property docs to using the same
consistent wording.
2023-11-24 16:41:03 +11:00
Michael Hirsch ec2ad53d18 Modules: refactor compiler find to use modern foreach 2023-11-18 19:08:00 -05:00
scivision ae72b04418 Help: Document when <LANG>_COMPILER_ID genex learned to support multiple ids
It was added in CMake 3.15.
2023-11-07 13:47:43 -05:00
scivision 7b4983536a Help:test prop WILL_FAIL clarify and example
This makes the WILL_FAIL behavior explicit. Users could be confused
because some other build systems treat equivalent test properties
as allowing a failure, but still pass on a passing test, and may
catch SIGABRT unlike CMake.

We show an example of how to wrap a test so that sigabrt, segfault,
etc. are also handled by WILL_FAIL.
2023-11-06 21:46:17 -05:00
scivision 0f37000304 try_{compile,run}: add LINKER_LANGUAGE option
Fixes: #25326
2023-10-16 11:30:17 -04:00
scivision 957670683d Comeau: Remove undocumented support for this compiler
This appears to be from CMake 2.8 era and was undocumented.
Comeau last release 2008.
2023-10-16 11:11:44 -04:00
scivision 7662d50a1b bootstrap: update known compilers
como: Comeau-not updated since 2008, unlikely to work with CMake
icc: discontinued for icx
icc: not for C++, put in 20 years ago, probably never used / worked
2023-10-13 11:26:49 -04:00
scivision 449f5da373 Help:cmake(1): add versionadded back to 3.17 2023-09-24 14:41:13 -04:00
scivision d95988c8c3 FindJNI: use modern foreach() syntax 2023-09-20 14:22:37 -04:00
scivision 7e4fe71633 FindJNI: use 2-space indents 2023-09-20 14:22:37 -04:00
scivision 88411fd629 FindJNI: use cmake_host_system_info to query registry 2023-09-20 14:22:37 -04:00
scivision b56d4e041a FindJava: use cmake_host_system_info to query registry 2023-09-20 14:22:37 -04:00
scivision bab9a23724 FindJava: use modern foreach() syntax 2023-09-20 14:22:30 -04:00
scivision d49ea4a4d9 Source: Remove redundant FileIsDirectory checks 2023-09-18 23:11:28 -04:00
scivision f5ff17fcf2 Source: Remove redundant FileIsSymlink checks
Replace `FileExists || FileIsSymlink` with `PathExists`.
The latter does not resolve symlinks, so this is OK for use
with broken symlinks, files, and directories.
2023-09-18 16:35:10 -04:00
scivision 39881de3f6 FindMatlab:macOS: return full version when found by path guess 2023-09-18 15:50:48 -04:00
scivision 35bcb9116c FindMatlab:lint: set(... CACHE INTERNAL) implies FORCE 2023-09-18 15:23:21 -04:00
scivision dc9d9589e4 FindMatlab:WIN32: return full Matlab version when found via registry
rework internal XML reading function for better code reuse and
namespace isolation
2023-09-18 15:23:21 -04:00
scivision abbfdd3b3a FindMatlab: improve version regex
the matlab_versions_mapping always has at least major.minor
2023-09-18 15:23:21 -04:00
scivision ff20d993f3 FindMatlab: doc: rename osx=>macOS 2023-09-18 15:09:51 -04:00
scivision d7b73f14c2 FindMatlab: retrieve full major.minor.patch.tweak 2023-09-18 15:09:49 -04:00
scivision 8b8135487f FindMatlab: refactor: remove unneeded syntax 2023-09-18 15:07:53 -04:00
scivision fff5c1507e FindMatlab: refactor: use registry query instead of execute_process
On Windows,
instead of executing "reg query" it's much simpler and more robust
to use cmake's built in registry query.

Remove unused variables. Significantly reduces amount of code in
function.
2023-09-18 15:07:52 -04:00
scivision ca77b745e9 cmake: Clarify error if -P script does not exist 2023-09-18 11:51:31 -04:00
scivision cf7ea12a7e FindMatlab: Add R2023b=23.2
Matlab went to a new version numbering scheme with R2023b.
2023-09-15 09:03:32 -04:00
scivision 6ebf0e1a46 Ninja: Use absolute path to COMSPEC if possible
If the COMSPEC is set to an absolute path, use it instead of just
`cmd.exe`.  This avoids searching for the tool in the current working
directory and the `PATH`.  If COMSPEC is not set to an absolute path,
fall back to the existing behavior.

Issue: #18350
2023-09-11 08:47:09 -04:00
scivision 8ea398a7af FindMatlab: Prefer to use VersionInfo.xml to get version, fallback to run
Parsing the version file is much faster than running Matlab.
It also improves reliability as Matlab silently quits or hangs
in some misconfigured environments.

For old Matlab, falls back to running Matlab.

also refactor file(STRINGS => file(READ as whole file was read anyway

Fixes: #25209
2023-09-09 22:23:05 -04:00
scivision 7d7fe9981c FindMatlab: use if(IS_DIRECTORY) for directories instead of EXISTS 2023-08-27 18:27:39 -04:00
scivision cf554750dd FindMatlab: no if(NOT EXIST) guard needed for file(MAKE_DIRECTORY) 2023-08-27 18:25:55 -04:00
scivision d2c30ac063 Help:CheckCXXSymbolExists: refer to CheckSourceCompiles
This was just missed in the earlier MR.
2023-08-21 00:01:21 -04:00
scivision a8634b878a Help:ENV: note escaping needed for special characters 2023-08-17 10:51:14 -04:00
scivision 136edadad4 Help:try_run: place options in their own section 2023-08-16 10:06:31 -04:00
scivision a5b292c9a6 Help:try_compile: place options in their own section
As try_compile interface was enhanced in 3.25, the Help got a lot
longer. Make the options its own section for navigability.
2023-08-16 10:05:53 -04:00
scivision c949a8742e ExternalProject: Add option subsection anchors for accessibility from TOC
Use RST subsections for each major step of `ExternalProject_Add()`.
This makes finding options easier with less scrolling.
For example, finding important Download vs. Test options etc.

Fixes: #25129
2023-07-31 11:21:10 -04:00
scivision 58ab34d88a FindMatlab: add version/release map for R2023a 2023-03-16 11:08:05 -04:00
scivision 9e1b30121f Help:toolchain: refer to CheckSourceCompiles 2023-03-14 16:48:25 -04:00
scivision cf48022dc5 Help:Check*: include CMAKE_REQUIRED_* vars to dedupe
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
2023-03-14 16:48:25 -04:00
scivision 03c6ebf2b5 Modules:Check,GenerateExportHeader: include only what's needed
GenerateExportHeader had a hidden state requirement that other
modules were included first. Considering include_guard, Modules
should include all they actually use.
2023-03-13 10:36:09 -04:00
scivision f3e85754b4 Modules:Check*: refactor: use block(SCOPE_FOR POLICIES) 2023-03-08 14:07:55 -05:00
scivision 103dbb2fd2 FindMatlab: Windows -wait is only for -r, not -batch 2023-03-07 15:34:36 -05:00
scivision 1932ae0284 FindMatlab: refactor: use string(APPEND 2023-03-07 15:34:36 -05:00
scivision c4cacdc7eb FindMatlab: use modern foreach()
remove unused superseded commented code
2023-03-07 15:34:35 -05:00
scivision af05544c49 FindMatlab: document function input/output 2023-03-07 15:34:35 -05:00
scivision 257a3e870e FindMatlab: add Matlab_VERSION and document.
fixes #24569
2023-03-07 15:32:56 -05:00
scivision 2931f078dc Help:cmake-language: note new block() command scope 2023-03-02 10:34:56 -05:00
scivision b6cfbe7b17 Help:try_{compile,run}: clarify, encourage new syntax 2023-02-28 08:59:16 -05:00
scivision 9b56aabd99 Help:file: document HTTPHEADER more
Some servers have allow-lists for HTTP UserAgent for example.
CMake project devs would benefit from this hint about setting
authorization tokens and HTTP User Agent.
2023-02-24 12:32:41 -05:00
scivision 6f354a6d57 Help: ctest(1): emphasize the --test-dir option
it seems few people know of this option
and needlessly add extra shell commands to change directory.
2023-02-18 20:22:23 -05:00
scivision f0e60ea867 Help: cmake (1): put modern configure signature first
recommend compact, most robust signature first. So many people are
still using the multi-step pre-3.13 way of initializing a build.
Rather than simply

  cmake -Bbuild

which is one step instead of 3 just to configure a new project.
2023-02-18 20:13:40 -05:00
scivision 6e71c31afd Help:add_test: emphasize important points
* enable_testing must be called to enable testing
* can only set properties on tests created in same directory
* WILL_FAIL still fails on segfault and similar
* compact wording
2023-02-15 16:23:35 -05:00
scivision bf5512ef51 Help:cmake -E time: note overhead included 2023-02-15 10:53:14 -05:00
scivision 848f7b0a81 cmake -E time: use C++11 chrono and better format output
fixes #24415
2023-02-15 10:53:14 -05:00