summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |/
* | Merge topic 'language-generator-expressions'Brad King2013-05-243-0/+24
|\ \ | | | | | | | | | | | | 3241014 Add $<LINK_LANGUAGE> generator expression
| * | Add $<LINK_LANGUAGE> generator expressionStephen Kelly2013-05-243-0/+24
| | | | | | | | | | | | | | | | | | They can't be used when evaluating link libraries, but they can be used for include directories and compile definitions. Later they can be used for compile options.
* | | Merge topic 'fix-include_directories-whitespace-handling'Brad King2013-05-241-1/+4
|\ \ \ | | | | | | | | | | | | | | | | a97240b Tests/IncludeDirectories: Avoid shared library with no symbols
| * | | Tests/IncludeDirectories: Avoid shared library with no symbolsBrad King2013-05-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The parent commit added a empty_entry_test shared library to the IncludeDirectories test. Some toolchains fail to create a shared library with no user-defined symbols, so provide a dummy symbol.
* | | | Merge topic 'join-genex'Brad King2013-05-222-0/+6
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | | | | a7ba452 Add the JOIN generator expression. 96ec314 Make it possible for any genex to have arbitrary content at the end. bd638ee Rename the method determining if a genex accepts arbitrary content. dc742fe Extract the ProcessArbitraryContent method.
| * | Add the JOIN generator expression.Stephen Kelly2013-05-162-0/+6
| |/ | | | | | | | | | | This generator expression joins a list with a separator. The separator may contain arbitrary content, such as commas, which is ordinarily a delimiter in the generator expression syntax.
* | include_directories: Fix handling of empty or space-only entriesStephen Kelly2013-05-212-0/+12
|/ | | | | | | | | This is a regression introduced in commit 0d46e9a0 (Store includes from the same include_directories call together., 2013-01-20). Reported at http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/46695/focus=7847
* Fix clearing of the INCLUDE_DIRECTORIES DIRECTORY property.Stephen Kelly2013-04-101-0/+11
| | | | | This was broken by commit 18a3195a (Keep track of INCLUDE_DIRECTORIES as a vector of structs., 2012-11-19).
* Don't use LINKED where not needed.Stephen Kelly2013-02-121-1/+1
|
* Test workaround of bad interface include directories from depends.Stephen Kelly2013-01-311-0/+41
|
* Merge topic 'interface-includes-defines'Brad King2013-01-071-0/+31
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 894f52f Handle INTERFACE properties transitively for includes and defines. f5b1980 Populate the ExportedTargets member early in GenerateMainFile c67b812 Make cycles in target properties ignored, not an error. d0f950f Use mapped config properties to evaluate $<CONFIG> 26def17 Make all relevant targets available in the genex context. 0c657dc Add API to populate INTERFACE properties in exported targets. e04f737 Add API to extract target names from a genex string. b0c8f73 Add the TARGET_NAME generator expression. 77475fe Allow generator expressions to require literals. b2f1700 GenEx: Add expressions to specify build- or install-only values
| * Handle INTERFACE properties transitively for includes and defines.Stephen Kelly2013-01-051-0/+31
| | | | | | | | | | Contextually, the behavior is as if the properties content from another target is included in the string and then the result is evaluated.
* | Add test for custom command with a genex referring to a target.Stephen Kelly2013-01-071-0/+6
|/ | | | | This test failed before d8a59ea4 (Port cmGeneratorExpression to cmTarget from cmGeneratorTarget, 2012-10-27), and passes after.
* GexEx: Validate Target names and property names differently.Stephen Kelly2012-10-222-0/+12
| | | | | In the unit test, use the same IMPORTED_LOCATION trick that the ExportImport test uses.
* GenEx: Test the use of generator expressions to generate lists.Stephen Kelly2012-10-172-0/+6
| | | | | | We can't test this in the GeneratorExpression unit test because the ';' chars are processed specically by the CMake function argument parser.
* Process generator expressions in the INCLUDE_DIRECTORIES property.Stephen Kelly2012-09-283-0/+13
| | | | | This use of generator expressions, like all others to come which operate on target properties, must initalize the dag checker.
* Tests/IncludeDirectories: Files must end in a newline (#13314)Daniel R. Gomez2012-06-181-3/+1
| | | | The HP compiler really really wants source files to end with a newline.
* Extract and use the INCLUDE_DIRECTORIES target properties.Stephen Kelly2012-02-223-0/+38
| | | | | | | | | Eliminate callers of cmMakefile::GetIncludeDirectories. All callers of GetIncludeDirectories should go through the local generator object. Only the local generator calls cmTarget::GetIncludeDirectories directly.
* One more try. Use full path by default, and relative on broken compilers.Bill Hoffman2011-06-031-5/+29
|