summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories
Commit message (Collapse)AuthorAgeFilesLines
* Tests: Bump CMake minimum required in tests to 3.5Brad King2023-03-012-2/+2
| | | | | | | | | | | | | | | | | | | CMake 3.27 deprecates compatibility with CMake < 3.5. Update tests that do not cover older interfaces to avoid the deprecation warning. Follow the pattern from: * commit 7b07ccdd2b (Tests/*Only: Update cmake_minimum_required versions, 2020-06-15, v3.19.0-rc1~629^2~1) * commit 72e7c45e98 (Tests: Bump CMake minimum required in tests to 2.8.12, 2020-12-22, v3.20.0-rc1~224^2) * commit f6b4db365a (Tests: bump cmake_minimum_required version to 2.8.12, 2021-04-04, v3.21.0-rc1~372^2) Also remove explicit `cmake_policy` settings made redundant by the version.
* Add SYSTEM target propertyDa Quexian2022-06-151-0/+54
| | | | | | | | If it is ON, treat INTERFACE_INCLUDE_DIRECTORIES as system include directories. Issue: #18040 Signed-off-by: Da Quexian <daquexian566@gmail.com>
* VS: Add support for SYSTEM include directoriesJosiah Bills2022-05-182-4/+5
| | | | Fixes: #17904
* Merge topic 'nvhpc-isystem'Brad King2021-11-031-0/+1
|\ | | | | | | | | | | | | 92624714c4 NVHPC: Support SYSTEM include directories Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6691
| * NVHPC: Support SYSTEM include directoriesRobert Maynard2021-11-021-0/+1
| | | | | | | | Fixed #22834
* | LCC: Add policy CMP0129 regarding interpreting LCC as GNUmakise-homura2021-10-211-1/+5
| | | | | | | | | | | | | | | | | | | | Due to MCST LCC compiler identification is now changed to LCC, there should be a way for old projects to still identify it as GNU, as it was before. This commits adds the policy: CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU. This policy controls such a behavior. OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
* | Merge topic 'lcc-compiler'Brad King2021-10-191-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 02b2607a5c Help: Add release note for MCST LCC compiler support e5d9fce03f LCC: Add dedicated support for MCST LCC compiler 2b9ef77944 CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecture 0995c75301 Tests/RPM: skip tests tat rely on debugedit if it's not found ea55ac9a51 Tests/RunCMake/CommandLine: Deal with locales that are different from English Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6608
| * | LCC: Add dedicated support for MCST LCC compilermakise-homura2021-10-151-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Divert LCC compiler as a new one, instead of treating it as GNU. Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been passing checks for GNU compilers, so it has been identified as GNU. Now, with intent of seriously upstreaming its support, it has been added as a separate LCC compiler, and its version displays not a supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead of GNU 7.3.0). This commit adds its support for detection, and also converts basically every check like 'is this compiler GNU?' to 'is this compiler GNU or LCC?'. The only places where this check is untouched, is where it regards other platforms where LCC is unavailable (primarily non-Linux), and where it REALLY differs from GNU compiler. Note: this transition may break software that are already ported to Elbrus, but hardly relies that LCC will be detected as GNU; still such software is not known.
* | Add property to mark IMPORTED targets as not SYSTEMBrad King2021-10-141-0/+7
|/ | | | | | | | | | | Add an `IMPORTED_NO_SYSTEM` target property to specify this. When enabled, do not treat the `INTERFACE_INCLUDE_DIRECTORIES` of an imported target as `SYSTEM` include directories. This is similar to the existing `NO_SYSTEM_FROM_IMPORTED` property, but works from the consumed target rather than the consumer. Fixes: #17364
* Tests/IncludeDirectories: support MSVC in system include testsBen Boeckel2021-06-173-12/+27
|
* Tests/IncludeDirectories: align sibling predicatesBen Boeckel2021-06-171-1/+2
|
* Tests/IncludeDirectories: factor out applying flags to targetsBen Boeckel2021-06-171-6/+10
|
* Tests/IncludeDirectories: fix copy pasta for otherlibBen Boeckel2021-06-171-1/+1
|
* Tests/IncludeDirectories: Include system headers via angle bracketsBrad King2021-06-173-3/+4
| | | | | This is typically how projects include them, and cl's `-external:{I,W}` flags suppress warnings only when included through angle brackets.
* cmDepends: disable long line dependencies for nmakeKai Wang2021-01-111-7/+1
| | | | | | | | | This is a follow-up to commit b696f78073 (cmDepends: merge dependers of depend makefile, 2020-12-18). NMake of visual studio has many versions that not support long line dependencies of make rule. Signed-off-by: Wangkai <wangkai86@huawei.com> Fixes: #21681
* Merge topic 'depend_make_refine'Brad King2021-01-061-1/+7
|\ | | | | | | | | | | | | b696f78073 cmDepends: merge dependers of depend makefile Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5631
| * cmDepends: merge dependers of depend makefileKai Wang2021-01-051-1/+7
| | | | | | | | | | | | | | | | | | | | | | Since one depender has multiple dependees, depend makefile generated same depender line by line, to reduce file size and refine make file parse speed, merge same dependers to one. And add a testcase for large depend.make which generated source file includes 20000 header files and run build and incremental build Signed-off-by: Wangkai <wangkai86@huawei.com> Signed-off-by: Zhaoyingdong <zhaoyingdong@huawei.com>
* | Tests: Bump CMake minimum required in tests to 2.8.12Chuck Atkins2020-12-232-2/+2
|/ | | | | | | Since 3.19, CMake generates a deprecation warning when using a minimum version less than 2.8.12. This eliminates those warnings generated during tests, which are typically hidden from the user and developer but are being generated nonetheless.
* Makefiles Generators: use compiler for dependencies generationMarc Chevrier2020-11-291-1/+5
| | | | | | | | | | | Each source compilation generates a dependencies file. These dependencies files are consolidated in one file per target. This consolidation is done as part of command 'cmake -E cmake_depends` launched before evaluation of makefile dependency graph. The consolidation uses the same approach as `CMake` dependencies management. Fixes: #21321
* cmGeneratorTarget: Include Cache now occurs per language+configRobert Maynard2020-09-255-0/+45
| | | | | Previously only occurred per config which broke per-language system includes.
* Tests: Enable coverage of special chars in include dirs for MakefilesBrad King2020-04-152-13/+31
| | | | Issue: #20555
* Tests: Add coverage for special characters in include directoriesBrad King2020-04-102-0/+29
| | | | | | | | | We have tests for special characters in preprocessor definitions and custom command line arguments. Add such a test for include directories. Currently the Makefiles generators do not escape paths in `depend.make` in all cases, so leave a FIXME comment and skip the test for those. Issue: #20555
* Ninja: Add multi-config variantKyle Edwards2019-12-131-1/+1
| | | | Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-2/+1
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* add_library: Now support aliasing unknown import targetsRobert Maynard2019-03-262-4/+15
| | | | Fixes #18327
* Tests: Teach tests when to treat clang-cl as MSVCZsolt Parragi2019-02-111-1/+1
| | | | | | | | | | | | | | | | | | | * Disable the system include unused variable test in ExportImport when clang is in MSVC compatible mode. * Disable CxxDialect testcase when clang is in MSVC compatible mode, as it doesn't support `typeof`. * Teach Module.WriteCompilerDetectionHeader to treat clang-cl as MSVC. * Disable the SystemIncludeDirectories testcase within IncludeDirectories when clang is in MSVC compatible mode. * Disable the CMakeOnly.CheckCXXCompilerFlag testcase when clang is in MSVC compatible mode. * Treat clang-cl as MSVC in LinkOptions.cmake in the try_run and try_compile testcases.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-1/+1
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Order SYSTEM include directories after non-system directoriesEphi Sinowitz2018-04-234-0/+7
| | | | | | | An effect of the `-isystem` flag is to search the directory after those specified via `-I` flags. Make behavior more consistent on compilers that do not have any `-isystem` flag by explicitly moving system include directories to the end.
* Genex: Fix COMPILE_LANGUAGE propagation through try_compileBrad King2018-03-121-8/+3
| | | | | | | | When evaluating include directories during export to a `try_compile` test project, thread the compile language through to the generator expression evaluator so it can support `$<COMPILE_LANGUAGE:...>`. Issue: #17811
* Genex: Fix COMPILE_LANGUAGE in SYSTEM include directoriesBrad King2018-03-121-0/+7
| | | | | | | | | When evaluating `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`, or evaluating `INTERFACE_INCLUDE_DIRECTORIES` on an imported target, thread the compile language through to the generator expression evaluator so that it can support `$<COMPILE_LANGUAGE:...>`. Fixes: #17811
* Xcode: Properly mark SYSTEM includes as suchGregor Jasny2016-12-272-5/+14
| | | | | | | | | We now populate the per-language flags in addition to the header search paths stored in HEADER_SEARCH_PATHS. This preserves include paths for GNU assembly files (cmake/cmake#16449) and also provides SYSTEM include semantics. Closes: cmake/cmake#15687
* Revert "Xcode: Obey SYSTEM keyword for includes (#15687)"Gregor Jasny2016-11-282-14/+5
| | | | | | | | Revert commit v3.7.0-rc1~266^2 (Xcode: Obey SYSTEM keyword for includes, 2015-08-31). It worked for C, C++, and Swift but not for GNU Assembly files for which Xcode has no property to set flags. Closes: #16449
* Xcode: Obey SYSTEM keyword for includes (#15687)Gregor Jasny2016-08-092-5/+14
| | | | | | | | | | | | | CMake used to put all header search paths into HEADER_SEARCH_PATHS attribute. Unfortunately this attribute does not support to declare a search path as a system include. As a hack one could add a -isystem /path to the cflags but then include ordering is not deterministic. A better approach was chosen with this patch by not filling HEADER_SEARCH_PATHS at all and to populate the C, C++, and Fortran flags directly. The include paths used by Xcode should be now identical to the ones used by Unix Makefiles and Ninja generator.
* Use string(APPEND) in TestsDaniel Pfeifer2016-07-271-2/+2
| | | | | | | Automate with: find Tests -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* Add a variable to specify language-wide system include directoriesBrad King2016-05-254-0/+11
| | | | | | | Create a `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` variable to specify system include directories for for `<LANG>` compiler command lines. This plays a role for include directories as the existing `CMAKE_<LANG>_STANDARD_LIBRARIES` variable does for link libraries.
* Revise C++ coding style using clang-formatKitware Robot2016-05-1610-11/+21
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Tests: Use C-Style comments in C sources and headersMarc Chevrier2015-09-251-3/+3
| | | | | Not all C compilers tolerate C++-style comments in C code, so do not use them in our tests.
* target_include_directories: Support relative SYSTEM include dirs (#15464)Gregor Jasny2015-08-111-0/+10
|
* IncludeDirectories: Respect SYSTEM flag when using CONFIG genex.Stephen Kelly2015-01-223-1/+23
| | | | | Update the Makefile and Ninja generators to use the config when requesting the include flags.
* cmTarget: Fix system include annotation propagation.Stephen Kelly2014-01-061-0/+4
| | | | | | | | | | | | Direct users of IMPORTED targets treat INTERFACE_INCLUDE_DIRECTORIES as SYSTEM, after commit a63fcbcb (Always consider includes from IMPORTED targets to be SYSTEM., 2013-08-29). It was intended that transitive use of an IMPORTED target would have the same behavior, but that did not work. The implementation processed only direct dependencies in cmTarget::FinalizeSystemIncludeDirectories. Implement transitive evaluation of dependencies by traversing the link interface of each target in the link implementation.
* Add a test for SYSTEM headers in INTERFACE libraries.Stephen Kelly2013-10-093-0/+51
|
* Clang: Add separate "AppleClang" compiler idBrad King2013-10-081-1/+1
| | | | | | | | | | | | Apple distributes their own Clang build with their own version numbers that differ from upstream Clang. Use the __apple_build_version__ symbol to identify the Apple Clang compiler and report the Apple Build Version as the fourth version component in CMAKE_<LANG>_COMPILER_VERSION. Add Compiler/AppleClang-<lang> and Platform/Darwin-AppleClang-<lang> modules that simply include the upstream equivalents. Fix comparisons of CMAKE_<LANG>_COMPILER_ID to Clang in CMake's own source and tests to account for AppleClang.
* Fix OLD behavior of CMP0021.Stephen Kelly2013-08-244-0/+31
| | | | | | | | | Exclude Ninja and Xcode from the CMP0021 test They do not behave the same as the makefile generator with relative paths. Don't overwrite the header file for in-source builds.
* Remove the LINK_LANGUAGE generator expression.Stephen Kelly2013-07-241-6/+6
| | | | | | | | | | | It accepted an optional argument to test for equality, but no way to get the linker language of a particular target. TARGET_PROPERTY provides this flexibility and STREQUAL provides the necessary API for equality test. Extend the CompileDefinitions test to cover accessing the property of another target.
* Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.Stephen Kelly2013-07-167-0/+82
| | | | | | | | Unlike other target properties, this does not have a corresponding non-INTERFACE variant. This allows propagation of system attribute on include directories from link dependents.
* Merge topic 'fix-genex-HEAD-target'Brad King2013-06-052-0/+11
|\ | | | | | | | | 5b22235 Genex: Fix the HEAD target used for evaluated expressions
| * Genex: Fix the HEAD target used for evaluated expressionsStephen Kelly2013-06-052-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the expression $<TARGET_PROPERTY:prop> appears in the content of a target property, the target that prop is read from is the 'head target' of the expression. In contexts such as evaluating the content of a target property during generation, such as INCLUDE_DIRECTORIES, the 'head target' is the one on which the initial request was made. If evaluating a generator expression which is not a target property content, the target must be explicitly specified. Such contexts include add_custom_command and file(GENERATE). The content might then look like $<TARGET_PROPERTY:tgt,prop> However, as there is no HeadTarget set, any generator expressions evaluated as part of reading prop from tgt which do not specify the tgt directly report an error. Modify the logic of the TARGET_PROPERTY generator expression so that in such contexts, the 'head target' is set to the appropriate target which was first encountered.
* | Merge topic 'test-INCLUDE_DIRECTORIES-genex-read'Brad King2013-05-313-0/+33
|\ \ | | | | | | | | | | | | 07f9e15 GenexEval: Test evaluation of INCLUDE_DIRECTORIES target property.
| * | GenexEval: Test evaluation of INCLUDE_DIRECTORIES target property.Stephen Kelly2013-05-303-0/+33
| |/