Commit Graph

5495 Commits

Author SHA1 Message Date
Brad King
6fbd94cf5b Merge topic 'tutorial_update_step_11'
6dade88d1c Tutorial: Add documentation on Package helper functions
1bf25b5b5f Tutorial: Remove information about EXPORT keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6575
2021-10-05 09:04:37 -04:00
Brad King
c55a41c9b2 Merge topic 'default_extensions'
4a0485be7f cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
29e2b85171 Tests: Simplify RunCMake.CompileFeatures introspection
fc3a1cbdd8 CompilerID: Compiler extensions default detection
2adfd95d79 CompilerID: Rename language_dialect to language_standard
00055d7779 Help: Document CMAKE_<LANG>_STANDARD_DEFAULT
a65bee4cfc Help: Document HIP standard/extensions properties and variables
a40ff1bb5a Help: Make language standard/extensions variable pages less wordy
3feff8379b Help: Generic language standard and extension variables documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6177
2021-10-04 12:43:24 -04:00
Brad King
f3a6d295e8 Merge topic 'tutorial-regex'
0f17b37b96 Tutorial: Fix regexps in sample CMakeLists.txt files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6572
2021-10-04 10:31:57 -04:00
Brad King
162413664f Merge topic 'tutorial-step1'
14600a42c8 Tutorial: Update Step 1 instructions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6576
2021-10-04 10:29:00 -04:00
Brad King
eb3fd11a23 Merge topic 'tutorial-step5'
01c332c9c7 Tutorial: Clarify instructions in Step 5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6577
2021-10-04 10:26:45 -04:00
Craig Scott
63d7404a8a Merge topic 'compile-feature-version-tags'
b75f778531 Help: Detailed version tags for compiler known features

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6562
2021-10-03 01:27:38 -04:00
FeRD (Frank Dana)
b75f778531 Help: Detailed version tags for compiler known features 2021-10-02 09:13:53 +10:00
Joseph Snyder
6dade88d1c Tutorial: Add documentation on Package helper functions
Add documentation for the configure_package_config_file() and
write_basic_package_version_file() commands.

Update the comment for the installation of those files to allow a
stopping point for the code display.

Issue: #22663
2021-09-30 14:43:28 -04:00
Joseph Snyder
1bf25b5b5f Tutorial: Remove information about EXPORT keyword
Remove the text that implies that the EXPORT keyword will also install
the generated CMake file.
2021-09-30 13:06:20 -04:00
Betsy McPhail
01c332c9c7 Tutorial: Clarify instructions in Step 5 2021-09-30 12:18:41 -04:00
Betsy McPhail
14600a42c8 Tutorial: Update Step 1 instructions
To demonstrate how simple a CMake project can be, move the `Build and Run`
section earlier in the step.
2021-09-30 12:04:52 -04:00
Christophe Bernard
0f17b37b96 Tutorial: Fix regexps in sample CMakeLists.txt files
Replace original regexp `[-nan|nan|0]` with `(-nan|nan|0)`
which is what the author most likely intended to write in the
first place.
2021-09-30 08:55:41 -04:00
Raul Tambre
4a0485be7f cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
The changes are part of CMP0128.

When the standard level is unset:
* Flags are added if extension mode doesn't match the compiler's default.
  Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224.
* The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was
  used. This was only supported for IAR.

Otherwise:
* Avoid adding flags if not necessary per the detected compiler defaults.
* Fixed check for when the requested standard is older. It now matches the
  nearby comments.

I reworded the fallback comment as its logic was a bit difficult to wrap my
head around.
2021-09-29 22:28:40 +03:00
Ralf Habacker
9aba0ce29d Help: Fix CMAKE_FIND_LIBRARY_SUFFIXES examples for Windows
Fixes: #22697
2021-09-29 13:38:41 -04:00
Raul Tambre
fc3a1cbdd8 CompilerID: Compiler extensions default detection 2021-09-28 21:24:53 +03:00
Raul Tambre
00055d7779 Help: Document CMAKE_<LANG>_STANDARD_DEFAULT
Seems to be stable and will referred to by policy for standards flags rework.
2021-09-28 21:24:53 +03:00
Raul Tambre
a65bee4cfc Help: Document HIP standard/extensions properties and variables 2021-09-28 21:24:53 +03:00
Raul Tambre
a40ff1bb5a Help: Make language standard/extensions variable pages less wordy
They all had two sentences describing the same thing. Furthermore, with the
shorter wording the explicit advice to see the property being initialized for
further information seems unnecessary.
2021-09-28 21:24:53 +03:00
Raul Tambre
3feff8379b Help: Generic language standard and extension variables documentation
Add generic documentation to improve the discoverability of language-specific
ones and to make it possible to refer to them generically from other language
generic documentation.
2021-09-28 21:24:53 +03:00
Brad King
09dd52c9d2 Merge topic 'tutorial_update_step_8'
f55a02a26e Tutorial: Enhance CTestConfig info in Step 8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6565
2021-09-28 09:56:14 -04:00
Brad King
6c4ebcbf40 Merge topic 'tutorial_update_stage_2'
68e0f72744 Tutorial: Describe placement of add_subdirectory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6559
2021-09-27 13:46:58 -04:00
Joseph Snyder
f55a02a26e Tutorial: Enhance CTestConfig info in Step 8
Add a copy of the CTestConfig.cmake from Step 9 into the directory for
Step 8.

Expand the information about the contents of the CTestConfig file and
write a brief explanation of where on CDash to acquire the CTestConfig
file for a specific project.

CMake Issue: #22663
2021-09-27 10:11:17 -04:00
Craig Scott
d277d797de Merge topic 'doc-find_package-restructure'
84e02be51c Help: Restructure the find_package() docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !6542
2021-09-25 03:39:33 -04:00
Joseph Snyder
68e0f72744 Tutorial: Describe placement of add_subdirectory
Clarify that the process of making a target optional in the second step
of the tutorial is further steps to the work done before, not
a separate addition to the file.

Do this by ensuring that the paragraph which describes the work done
mentions the placement and use of the previous command.
This is done to avoid duplication of the add_subdirectory call.

CMake Issue: #22663
2021-09-24 08:59:23 -04:00
Craig Scott
84e02be51c Help: Restructure the find_package() docs
The explanation of the basic and full signatures was interwoven tightly
with that of the Module and Config search modes. Config mode is
supported by both signatures, which made the structure of the
command documentation a bit confusing.

Add a section at the start which unambiguously describes the two
modes, including the fallback functionality between them. Move the
text about this out of the basic signature section, leaving just a
description of the basic syntax with a note that it is supported by both
search modes. This makes the basic signature section more focused.

Drop the Module and Config mode parts of the titles for the basic and
full signature sections. Those are now more precisely covered by the
new opening section, so the Basic Signature and Full Signature sections
are now clearer in what they cover.

Swap the order of the Search Procedure and Version Selection sections
to improve the logical flow. Also add  "Config Mode" to their titles to
make it clearer what they apply to. Add a note at the start of both
sections to highlight their relationship to the basic and full signatures.
2021-09-23 21:56:33 +10:00
Craig Scott
b1745dcbca Merge topic 'doc-build-config'
b8d10c27d1 Help: Restructure build type docs and clarify case sensitivity

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6516
2021-09-22 08:20:08 -04:00
Craig Scott
b8d10c27d1 Help: Restructure build type docs and clarify case sensitivity
Fixes: #22591
2021-09-21 22:23:24 +10:00
Brad King
36966f63ca Merge topic 'hip-no-hipcc'
cb93f72624 HIP: Simplify detection of HIP runtime CMake package
a71f0fc9c7 HIP: Remove ROMClang compiler id and use Clang directly
b125e9809a HIP: Detect ROCm path earlier
735f41fc2d HIP: Use 'rocm_agent_enumerator' to determine CMAKE_HIP_ARCHITECTURES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !6533
2021-09-20 12:38:44 -04:00
Brad King
5b7651f9b7 Merge branch 'release-3.20' 2021-09-20 12:22:49 -04:00
Brad King
0d3bfda22a CMake 3.20.6 2021-09-20 11:28:01 -04:00
Brad King
a71f0fc9c7 HIP: Remove ROMClang compiler id and use Clang directly
Since commit bd844387df (ROCMClang: Add the ROCm toolkit derived clang
compiler to CMake, 2020-08-28, v3.21.0-rc1~66^2~6) and commit ff0d2858e1
(HIP: Extract clang compiler details from hipcc, 2020-10-21,
v3.21.0-rc1~66^2~5), the separate `ROCMClang` compiler id for `hipcc`
has caused a few problems:

* The compiler id changed from behavior of CMake 3.20 and below,
  breaking projects that already built with `hipcc` treated as `Clang`.

* The implementation of `target_compile_features` was incomplete for
  the `ROCMClang` identity.

* Only `hipcc` was identified as `ROCMClang`, so after it is unwrapped
  to the underlying `clang++`, future runs of new CMake versions on
  an existing build tree would not repeat this.

* Clang should be usable as a HIP compiler without the `hipcc` wrapper.

Remove the `ROMClang` compiler identity, and revise HIP language support
to work directly with a Clang compiler.

Reject direct `hipcc` usage as a HIP compiler.  For now it cannot be
supported because it interferes with flags CMake needs to pass to Clang.

Fixes: #22536, #22460, #22593
2021-09-16 15:33:47 -04:00
Zack Galbreath
735f41fc2d HIP: Use 'rocm_agent_enumerator' to determine CMAKE_HIP_ARCHITECTURES 2021-09-16 14:41:30 -04:00
Brad King
ffb9978e95 Merge topic 'clarify_cmake_policy_warning_doc'
1230ceb97e Help: Improve explanation on CMAKE_POLICY_WARNING warnings occur

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6522
2021-09-16 08:24:56 -04:00
Brad King
1b91aaecd8 Merge topic 'vs2022'
b6ac10394b VS: Update Visual Studio 17 2022 generator for Preview 4
f200f4d5a7 VS: Fix managed C++ project generation for VS 2022

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6524
2021-09-16 08:16:54 -04:00
Brad King
b6ac10394b VS: Update Visual Studio 17 2022 generator for Preview 4 2021-09-15 13:20:02 -04:00
Robert Maynard
1230ceb97e Help: Improve explanation on CMAKE_POLICY_WARNING warnings occur 2021-09-15 09:28:10 -04:00
Brad King
8f67d42671 Merge topic 'find-matlab-imported-targets'
161990b921 FindMatlab: Add imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6488
2021-09-14 09:42:50 -04:00
Brad King
2a8d9bf4cc Merge topic 'CMakeDependentOption-condition-syntax'
059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6493
2021-09-14 09:35:07 -04:00
Silvio Traversaro
161990b921 FindMatlab: Add imported targets 2021-09-13 12:12:05 -04:00
Craig Scott
dadb7a2ba5 Merge topic 'document_find_package_version_restrictions'
563139e5e9 Help: find_package document version only supports numeric components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6510
2021-09-11 04:39:10 -04:00
Daniel Schürmann
059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax
Fixes: #22303
2021-09-10 09:46:55 -04:00
Brad King
293070c325 Merge topic 'vs_settings'
f21158cdfe VS: Honor VS_SETTINGS source file property on all sources
3bf013632d cmVisualStudio10TargetGenerator: Factor out helper to write VS_SETTINGS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6492
2021-09-10 09:34:17 -04:00
Brad King
a4fccf74af Merge topic 'ctest-memcheck-generate-test.xml'
ce44c2cec3 ctest_memcheck: generate `DynamicAnalysis-Test.xml` as well

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6491
2021-09-10 09:29:42 -04:00
Robert Maynard
563139e5e9 Help: find_package document version only supports numeric components 2021-09-09 15:02:30 -04:00
Steven Boswell
f21158cdfe VS: Honor VS_SETTINGS source file property on all sources
Extend the feature added by commit 2ce42f281f (VS: Add VS_SETTINGS
source file property, 2020-03-18, v3.18.0-rc1~449^2~3) to support
all source file types.
2021-09-09 14:19:28 -04:00
Ben Boeckel
ce44c2cec3 ctest_memcheck: generate DynamicAnalysis-Test.xml as well
This is useful so that memcheck results also show up as test results on
CDash. It will be submitted with the other `MemCheck` parts.

Fixes: #22190
2021-09-08 21:04:46 -04:00
Joerg Bornemann
84aaebf79f Help: Mention that Qt6 is supported by AUTOGEN
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2021-09-07 08:51:26 +10:00
Brad King
441691bc24 Help: Document that toolchain files may set implicit link information
Document in `CMAKE_<LANG>_IMPLICIT_LINK_{LIBRARIES,DIRECTORIES}` how
their value is used and that a fallback value may be provided by a
toolchain file.
2021-09-02 14:49:40 -04:00
Brad King
c8991f17cf Merge topic 'cmake-packages-pkg-cfg-file-example'
d186797cf6 Help: Fix regex in example of cmake-packages(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6489
2021-09-02 10:26:21 -04:00
Johel Ernesto Guerrero Peña
d186797cf6 Help: Fix regex in example of cmake-packages(7)
This change makes it work as intended as opposed to make the condition always true.
This can be confirmed by running the following script:
```
[johel@sundown tmp]$ cat x.cmake 
function(f)
  set(valid_inputs abc 123)
  foreach(input ${ARGV})
    if(";${valid_inputs};" MATCHES input)
      message("old valid: ${input}")
    endif()
    if(";${valid_inputs};" MATCHES ";${input};")
      message("new valid: ${input}")
    endif()
  endforeach()
endfunction()

f("0;z;123;12;abc;ab;13;ac")

set(_supported_components Plot Table)
set(ClimbingStats_FIND_COMPONENTS Plot Table P T)

foreach(_comp ${ClimbingStats_FIND_COMPONENTS})
  if(NOT ";${_supported_components};" MATCHES _comp)
    message("old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE \"Unsupported component: ${_comp}\")")
  endif()
  if(NOT ";${_supported_components};" MATCHES ";${_comp};")
    message("new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE \"Unsupported component: ${_comp}\")")
  endif()
endforeach()
[johel@sundown tmp]$ cmake -P x.cmake 
new valid: 123
new valid: abc
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: Plot")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: Table")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: P")
new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: P")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: T")
new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: T")
```
2021-08-28 10:49:28 -04:00