summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetPropCommandBase.cxx
Commit message (Collapse)AuthorAgeFilesLines
* target_sources(): Add FILE_SET modeKyle Edwards2021-10-271-2/+2
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* target_include_directories: Support AFTER optionAsit Dhal2020-12-191-0/+7
| | | | Fixes: #20134
* target_sources: Support custom targetsAsit Dhal2020-10-241-9/+25
| | | | Fixes: #21034
* Add INTERFACE libraries to generated buildsystem if they have SOURCESBrad King2020-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | INTERFACE libraries were created with the intention of collecting usage requirements for use by other targets via `target_link_libraries`. Therefore they were not allowed to have SOURCES and were not included in the generated buildsystem. In practice, this has become limiting: * Header-only libraries do have sources, they just do not compile. Developers should be able to edit those sources (the header files) in their IDE. * Header-only libraries may need to generate some of their header files via custom commands. Some projects work around these limitations by pairing each interface library with an `add_custom_target` that makes the header files and custom commands appear in the generated buildsystem and in IDEs. Lift such limitations by allowing INTERFACE libraries to have SOURCES. For those with sources, add a corresponding build target to the generated buildsystem. Fixes: #19145
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-2/+1
|
* cmTarget::GetProperty: return cmPropVitaly Stakhovsky2020-03-301-3/+5
|
* cmTarget: add std::string overloadsVitaly Stakhovsky2019-12-141-6/+3
|
* cmTarget*: Port away from cmCommandRegina Pfeifer2019-09-261-0/+12
|
* Precompile Headers: Add REUSE_FROM signatureCristian Adam2019-09-171-0/+13
| | | | | | | Add the ability to share precompiled headers artifacts between targets. Fixes: #19659
* target_*: Allow setting INTERFACE properties of UNKNOWN IMPORTED targetsAvraham Shukron2019-07-221-1/+2
| | | | | | | | Extend the change made by commit fe4b25ec2f (Teach target_* commands to set INTERFACE properties of IMPORTED targets, 2017-09-18, v3.11.0-rc1~433^2~2) to work with imported targets of type `UNKNOWN`. Fixes: #19434
* cmTargetPropCommandBase: Order target type condition by order in enumAvraham Shukron2019-07-221-4/+4
| | | | This improves readability.
* cmTargetPropCommandBase: check keywords after parsingBen Boeckel2018-10-261-9/+11
| | | | | | | | | | | | | The following was disallowed: add_library(iface INTERFACE) target_link_libraries(iface PUBLIC) just due to the mention of the `PUBLIC` keyword. Instead, only error if there are actually `PUBLIC` dependencies specified (and analogously for other restrictions). Update tests to expect this new behavior.
* cmTargetPropCommandBase: simplify code pathBen Boeckel2018-10-261-1/+1
| | | | The outside of the loop does the same return expression.
* cmTargetPropCommandBase: skip property setting if there's nothing to addBen Boeckel2018-10-261-0/+3
| | | | | | Some target types don't allow setting certain properties even if there is no value being set there. Guard against this by avoiding property setting when there is nothing to add.
* Teach target_* commands to set INTERFACE properties of IMPORTED targetsDeniz Bahadir2017-10-261-6/+4
| | | | | | | | | | | Now, several `INTERFACE_*` properties can be set on `IMPORTED` targets, not only via `set_property` and `set_target_properties` but also via `target_compile_definitions`, `target_compile_features`, `target_compile_options`, `target_include_directories`, `target_sources` and `target_link_libraries`. Fixes: #15689 Issue: #17197
* cmTargetPropCommandBase: Fix typo in error messageDeniz Bahadir2017-10-261-3/+2
|
* Add const-reference qualificationsPavel Solodovnikov2017-05-261-1/+1
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-0/+3
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-0/+1
|
* cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-7/+7
|
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-93/+64
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* cmState: Move TargetType enum from cmTarget.Stephen Kelly2015-10-141-7/+7
| | | | | | | Mostly automated: values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType") for i in "${values[@]}"; do git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
* cmTargetPropCommandBase: Change the interface to return bool.Stephen Kelly2014-04-071-6/+8
| | | | | This is needed for the target_compile_features command, which may fail at configure time if an invalid feature is specified.
* Remove some c_str() calls.Stephen Kelly2014-03-111-4/+4
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* cmTarget: Remove the project argument to FindTargetBen Boeckel2014-03-081-1/+1
| | | | All callers passed 0 in, so just remove the branch.
* stringapi: Use strings for property namesBen Boeckel2014-03-081-2/+3
| | | | Property names are always generated by CMake and should never be NULL.
* cmMakefile: make some methods take const std::string& instead of const char*Rolf Eike Beer2014-01-161-2/+2
| | | | | | | | Most callers already have a std::string, on which they called c_str() to pass it into these methods, which internally converted it back to std::string. Pass a std::string directly to these methods now, avoiding all these conversions. Those methods that only pass in a const char* will get the conversion to std::string now only once.
* Add the INTERFACE_LIBRARY target type.Stephen Kelly2013-10-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This target type only contains INTERFACE_* properties, so it can be used as a structural node. The target-specific commands enforce that they may only be used with the INTERFACE keyword when used with INTERFACE_LIBRARY targets. The old-style target properties matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for this target type. The name of the INTERFACE_LIBRARY must match a validity generator expression. The validity is similar to that of an ALIAS target, but with the additional restriction that it may not contain double colons. Double colons will carry the meaning of IMPORTED or ALIAS targets in CMake 2.8.13. An ALIAS target may be created for an INTERFACE library. At this point it can not be exported and does not appear in the buildsystem and project files are not created for them. That may be added as a feature in a later commit. The generators need some changes to handle the INTERFACE_LIBRARY targets returned by cmComputeLinkInterface::GetItems. The Ninja generator does not use that API, so it doesn't require changes related to that.
* Add the ALIAS target concept for libraries and executables.Stephen Kelly2013-08-021-0/+5
| | | | | | | | | | | | | | | | | * The ALIAS name must match a validity regex. * Executables and libraries may be aliased. * An ALIAS acts immutable. It can not be used as the lhs of target_link_libraries or other commands. * An ALIAS can be used with add_custom_command, add_custom_target, and add_test in the same way regular targets can. * The target of an ALIAS can be retrieved with the ALIASED_TARGET target property. * An ALIAS does not appear in the generated buildsystem. It is kept separate from cmMakefile::Targets for that reason. * A target may have multiple aliases. * An ALIAS target may not itself have an alias. * An IMPORTED target may not have an alias. * An ALIAS may not be exported or imported.
* Allow target commands to be invoked with no items (#14325).Stephen Kelly2013-07-311-3/+3
| | | | | | | | Code such as target_include_directories(foo PRIVATE ${items}) should not work or break based on whether items is defined or not.
* Add a SYSTEM parameter to target_include_directories (#14180)Stephen Kelly2013-07-021-8/+20
| | | | | | This is similar to the include_directories(SYSTEM) signature in that it allows telling the compiler to ignore warnings from such headers.
* Extend the cmTargetPropCommandBase interface property handling.Stephen Kelly2013-07-021-14/+22
| | | | | This can be used to handle INTERFACE SYSTEM include directories in particular.
* Whitelist target types in target_{include_directories,compile_definitions}Stephen Kelly2013-02-081-0/+9
| | | | | Setting include directories or compile definitions on a target created with add_custom_target does not make sense.
* Make subclasses responsible for joining content.Stephen Kelly2013-01-291-7/+6
| | | | | This way we can add handling of relative/absolute paths and of -D in compile definitions.
* Don't allow targets args in the new target commands.Stephen Kelly2013-01-291-21/+1
|
* Merge topic 'disallow-IMPORTED-interface-porcelain'Brad King2013-01-231-2/+2
|\ | | | | | | | | | | b98d14d Disallow porcelain to populate includes and defines of IMPORTED targets. 48a4cf2 Revert "Allow target_link_libraries with IMPORTED targets."
| * Disallow porcelain to populate includes and defines of IMPORTED targets.Stephen Kelly2013-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With similar reasoning to the parent commit, as downstreams, we can't determine what $<CONFIG> generator expressions would be appropriate. Upstream would have populated the INTERFACE_INCLUDE_DIRECTORIES with config-specific generator expressions, possibly appropriate for their DEBUG_CONFIGURATIONS. In theory, if we would add include directories for a DEBUG intent, we would have to match the upstream configurations for that. Rather than attempting to discover the appropriate configurations at this time, simplify the feature instead. The use of IMPORTED targets with these commands could still be added in the future if targets would export their DEBUG_CONFIGURATIONS somehow.
* | Make sure generator expressions can be used with target_include_directories.Stephen Kelly2013-01-161-0/+12
|/ | | | | Handle the case that a generator expression is used before treating a non-target as an error.
* Add the target_include_directories command.Stephen Kelly2013-01-101-0/+144
This is a convenience API to populate the corresponding properties.