1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

57 Commits

Author SHA1 Message Date
Peter Kokot
4e6a13f211 Use lower case style for commands
Where possible this syncs the CS for command names:

- check_c_source_compiles()
- check_cxx_compiler_flag()
- check_cxx_source_compiles()
- check_cxx_symbol_exists()
- check_include_file_cxx()
- check_include_file()
- check_include_files()
- check_library_exists()
- check_source_compiles()
- check_struct_has_member()
- check_symbol_exists()
- check_type_size()
- cmake_dependent_option()
- cmake_parse_arguments()
- feature_summary()
- file()
- find_package_handle_standard_args()
- if(), endif...
- install(FILES)
- list()
- message()
- pkg_check_modules()
- select_library_configurations()
- set_package_info()
- test_big_endian()
2025-01-28 13:51:46 -05:00
Brad King
d77a7e8d1c CMP0007: Remove support for OLD behavior 2025-01-17 09:28:36 -05:00
Matthew Woehlke
99ac59d31b style: Remove trailing blank lines from all CMake sources
Our development workflow tooling prevents trailing blank lines
from being added, but some such lines remain from before that
was enforced.  Remove them to make it easier to rename files
without triggering enforcement.
2024-11-21 15:48:02 -05:00
Matthew Woehlke
2edf0fc6d7 Modules: Use new keyword-dispatched try_compile signature
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.
2022-09-14 07:52:16 -04:00
Henry Schreiner
92854bf29e CUDA: Update arch selection, restructure for maintainability
Fixes: #21712
2021-01-20 12:28:28 -05:00
Henry Schreiner
a58a572459 CUDA: Add arch selection debug mode to print out CUDA versions 2021-01-20 12:27:54 -05:00
Brad King
21b6b13956 Merge topic 'cuda-11.1-sm86'
5f6b0ba8b1 FindCUDA/select_compute_arch: Add CUDA 11.1 and SM86 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5292
2020-09-30 08:05:50 -04:00
zasdfg bnm
5f6b0ba8b1 FindCUDA/select_compute_arch: Add CUDA 11.1 and SM86 support 2020-09-29 05:32:25 -04:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
zasdfg bnm
8707178c1c FindCUDA/select_compute_arch: generate PTX for the latest architecture 2020-07-08 13:35:12 -04:00
zasdfg bnm
295d1b9cb5 FindCUDA/select_compute_arch: Add CUDA 11 and Ampere support
Co-Author: Henry Schreiner <henryschreineriii@gmail.com>
2020-07-07 11:32:45 -04:00
Johnny Jazeix
2d0100fac7 replace remove and remove_directory with rm in tests 2019-11-13 18:02:18 -05:00
Hong Xu
76b76a7f9b FindCUDA: Fix support for backslashes in CUDA_NVCC_INCLUDE_DIRS
Backslashes in `CUDA_NVCC_INCLUDE_DIRS` cause syntax errors because it
is written to a generated `.cmake` script as a string literal.  Use a
bracket argument to hold the expanded value as we already do for
`CUDA_NVCC_COMPILE_DEFINITIONS`.  Then explicitly convert backslashes to
forward slashes.
2019-08-20 09:47:29 -04:00
Anton Chernov
0f9533e61b CUDA: Add CUDA 10 (Turing) detection 2018-12-07 08:51:57 -05:00
Soumith Chintala
bfd93b73a0 FindCUDA: Filter unrelated content in compute capabilities output
Working around CUDA-level nvrm_gpu log statements to stdout on some
embedded platforms (ex. Drive PX2).

See-also: https://github.com/pytorch/pytorch/issues/11518#issue-359113249
2018-09-19 10:55:02 -04:00
Brad King
37ba34c0b0 FindCUDA/select_compute_arch: Restore two-component CUDA_VERSION
Since commit v3.12.0-rc1~332^2 (FindCUDA/select_compute_arch: Add
support for CUDA as a language, 2018-03-15) this module sets
`CUDA_VERSION` based on `CMAKE_CUDA_COMPILER_VERSION` when the language
is enabled.  Limit it to two components for consistency with the
normal `FindCUDA` documentation and behavior.

Fixes: #18231
2018-08-01 13:42:13 -04:00
Henry Schreiner
61b222f3ae CUDA/select_compute_arch: Fix detection on old CUDA with new card/driver
Fix version comparisons to handle patch components.  List and check
known archs for each version of CUDA so mismatching versions are not
suggested.

Fixes: #17921
2018-04-20 09:43:50 -04:00
Henry Fredrick Schreiner
e743fc8e91 FindCUDA/select_compute_arch: Add support for CUDA as a language
Even though this is an internal module, we can still prepare it to
be used in another public-facing module outside of `FindCUDA`.

Issue: #16586
2018-03-20 14:19:25 -04:00
Brad King
bc88329e5b Merge topic 'msvc2017-findcuda'
fab1b432 FindCUDA: Update to properly find MSVC 2017 compiler tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1631
2018-01-09 09:26:20 -05:00
Aaron Bray
fab1b432eb FindCUDA: Update to properly find MSVC 2017 compiler tools
An implementation that handles the different installation locations of
visual studio compiler tools
2018-01-08 11:35:36 -05:00
Luz Paz
3ab7bf8285 Various typo fixes
Some are user-facing. Others are source comments.
2018-01-04 06:52:01 +11:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Umar Arshad
8b09c20c3a FindCUDA: Fix CMP0007 warning in run_nvcc.cmake
Set `CMP0007` to `NEW` for the entire script.  The script comes with
CMake and is aware of the policy's behavior, so set the policy to ensure
that its warnings do not show up during the build phase.

Fixes: #16579
2017-10-04 08:07:37 -04:00
Robert Maynard
c1f4f13dbf FindCUDA: Use long brackets to handle spaces in CUDA_NVCC_COMPILE_DEFINITIONS
Fixes #16510. Quoting of compile definitions breaks string value definitions
2017-08-15 12:58:52 -04:00
Boris Fomitchev
cbf1393aa4 FindCUDA: Add CUDA9/Volta recognition 2017-08-10 11:10:07 -04:00
Bjoern Thiel
934eb497f2 FindCUDA: Fix PTX selection with multiple architectures 2017-02-22 10:35:44 -05:00
Pierre Moreau
645dd3ca53 FindCUDA: Fix typo in CUDA_DETECT_INSTALLED_GPUS doc string 2017-02-02 08:52:11 -05:00
Bjoern Thiel
c1f3086de7 FindCUDA: Enable CUDA_SELECT_NVCC_ARCH_FLAGS Auto for MSVC
Fixes: #16525
2017-01-25 10:31:27 -05:00
Boris Fomitchev
2dc9a754b5 FindCUDA: Support 2.1(2.0) architecture notation
Also tweak some messages and comments.
2016-08-23 10:47:27 -04:00
Peter Boettcher
7ded655f7b FindCUDA: Take NVCC include directories from target properties
Fixes issue where include directories specified on the target are
not passed on to NVCC.  This includes both target_include_directories()
as well as include directories added by dependency chaining.

Closes: #14201
2016-08-16 14:16:35 -04:00
Daniel Pfeifer
5d0d980d99 Use string(APPEND) in Modules
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'
2016-07-28 00:41:13 +02:00
Boris Fomitchev
7229ae728f FindCUDA: Refactor Android(Tegra) support
Reviewed-by: James Bigler <jamesbigler@gmail.com>
2016-06-09 09:25:55 -04:00
James Bigler
e739ef7b66 FindCUDA: Only warn about non-existent dependency files in verbose mode 2016-02-08 13:38:28 -07:00
James Bigler
81ecc72637 FindCUDA: Added some additional comments about non-existent dependency files. 2016-02-05 14:50:29 -07:00
James Bigler
4b561b4cb5 FindCUDA: Fix for when a non-existent dependency file is found.
Previously if a non-existent dependency file is found we set the file to "" and
then do if(NOT IS_DIRECTORY "${file}").  Later we call get_filename_component
on the empty file which returns basically the current build directory.

Having a dependency on the current build directory is really annoying, because
anything that compiles into that directory will change the file stamp and
cause your files to rebuild every time you call make. :(
2016-02-05 14:32:01 -07:00
James Bigler
1b0c77a33d FindCUDA: Add specific cuda_language_flag instead of using nvcc.
I was previously appending to nvcc_flags inside the file loop.  This
caused the flag to be appended multiple times which freaks out nvcc.
Now the flag is specifically handled per file.
2015-04-09 11:41:36 -04:00
Adam Strzelecki
84e3fde94d FindCUDA: Avoid if() auto-dereference in string comparisons
This silences possible CMP0054 warnings.
2014-09-24 10:10:42 -04:00
Adam Strzelecki
32bcec5fab FindCUDA: Fix OSX Clang & no C language enabled
When setting default CUDA_HOST_COMPILER we must dereference CMAKE_C_COMPILER,
i.e. /usr/bin/clang should be used instead /usr/bin/cc which is symlink.
Otherwise CUDA thinks it is GCC and issues -dumpspecs which is unknown option
to Clang.

Also in case neither CMAKE_C_COMPILER is defined (project does not use C
language) nor CUDA_HOST_COMPILER is specified manually we should skip -ccbin
and let nvcc use its own default C compiler.
2014-06-30 11:23:36 -04:00
Rolf Eike Beer
7eacbaed4d Replace MATCHES ".+" tests with NOT STREQUAL "" 2014-04-14 18:17:23 +02:00
Rolf Eike Beer
5bd48ac534 Replace string(REGEX REPLACE) with string(REPLACE) where possible
The simple replacement is much faster.
2014-04-14 18:17:05 +02:00
Rolf Eike Beer
2622bc3f65 Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
The matches have already been calculated and can simply be taken from
CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very
similar regular expressions.
2014-04-14 18:16:58 +02:00
Andreas Mohr
ddac8d3d2d Fix spelling and typos (affecting binary data / module messages) 2013-05-07 08:39:19 -04:00
David Cole
3dea63d04d Merge topic 'topics/FindCUDA/Add-CUDA_HOST_COMPILER'
db207e4 FindCUDA: Added CUDA_HOST_COMPILER variable.
2012-09-18 16:41:20 -04:00
James Bigler
db207e4065 FindCUDA: Added CUDA_HOST_COMPILER variable.
Added a new CUDA variable for specifying the CUDA_HOST_COMPILER.  This will allow users to
be able to specify which host compiler to use for invoking NVCC with.  By default it will
use the compiler used for host compilation.  This is convenient for when you want to
specify a different compiler than the default compiler.  You end up using the same
compiler for both the NVCC compilation and the host compilation instead of using the
default compiler in the path for NVCC.
2012-08-20 15:14:37 -06:00
Kitware Robot
9db3116226 Remove CMake-language block-end command arguments
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
2012-08-13 14:19:16 -04:00
David Cole
9f18f64c7c Merge topic 'topics/FindCUDA/Quote-fixes'
c3c7a0c Fixes for handling quotes in args and other places (Fix Bug 11726 and 12099).
2011-12-06 15:08:12 -05:00
James Bigler
c3c7a0cfb8 Fixes for handling quotes in args and other places (Fix Bug 11726 and 12099). 2011-12-05 17:16:05 -07:00
James Bigler
83d4eeadac Add work around for CUDA in UNC paths.
Nvcc can emit '/path' instead of '//path' which can cause a lot of grief later.  We test
to see if the file exists, if it doesn't then we see if the file exists with '/'
prepended.  Files that don't exist won't be added to the list.
2011-12-05 16:54:06 -07:00
James Bigler
d2d3672f1c Define __CUDACC__ during dependency scanning, since NVCC doesn't. 2010-01-28 12:58:22 -05:00
James Bigler
2316e04d13 Reordered the arguments, so that user generated arguments go last and thus get precedence. 2010-01-08 12:14:21 -05:00