summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-2/+2
| | | | Port dependent code to the change.
* cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-44/+47
|
* cmTarget: Implement GetProperty in terms of cmState::SnapshotStephen Kelly2016-10-161-3/+10
|
* cmTarget: Group code for checking written properties togetherStephen Kelly2016-10-161-25/+25
|
* cmTarget: Move sanity checks and computed property access to callersStephen Kelly2016-10-161-18/+5
| | | | | | | | | | | | | | | The GetProperty method is now just accessing contained data, meaning it can be implemented in cmState. Remove the cmMakefile context from the signature as a result and remove the overload with the same signature. Add a GetComputedProperty to cmTarget so that templates can be properly instantiated. Otherwise the Commands would need to be able to reach the specializations which are currently in cmTarget.cxx. As a side-effect, the CMP0026 warning now gives a backtrace to the target when issued from a generator expression.
* cmTargetPropertyComputer: Template some methods on the TargetStephen Kelly2016-10-151-0/+128
| | | | Implement the methods for cmTarget in the cmTarget source.
* cm{,Generator}Target: Add global generator accessorsStephen Kelly2016-10-151-0/+5
| | | | | Provide 'static polymorphism' between the types in this aspect so that they can be used indiscriminately in a C++ template.
* cmTargetPropertyComputer: Unify whitelist handling from cmTargetStephen Kelly2016-10-151-21/+9
|
* cmTargetPropertyComputer: Move whitelist check from cmTargetStephen Kelly2016-10-151-31/+3
|
* cmTargetPropertyComputer: Extract into new filesStephen Kelly2016-10-151-245/+1
|
* cmTargetPropertyComputer: Implement GetProperty without cmMakefileStephen Kelly2016-10-151-24/+32
| | | | Only a cmMessenger and a backtrace are needed.
* cmTarget: Extract GetLocation methodStephen Kelly2016-10-151-38/+54
|
* cmTarget: Extract GetSources methodStephen Kelly2016-10-151-83/+92
|
* cmTarget: Extract location computation methodsStephen Kelly2016-10-151-54/+44
|
* cmTarget: Split property computation into separate classStephen Kelly2016-10-151-49/+75
| | | | | Everything related to property computation will be moved here and eventually shared with cmGeneratorTarget.
* cmTarget: Move IMPORTED check to callersStephen Kelly2016-10-151-6/+7
| | | | This way the policy can be checked without depending on cmTarget.
* cmTarget: Move SOURCES property computation before the restStephen Kelly2016-10-151-85/+85
| | | | The SOURCES have to be computed.
* cmTarget: Use static storage for computed propertiesStephen Kelly2016-10-151-12/+21
| | | | Avoid having to populate a mutable container to return a value.
* cmTarget: Remove target name from parameter listStephen Kelly2016-10-071-4/+3
| | | | Use the member state instead.
* cmTarget: Inline MergeLinkLibraries into only callerStephen Kelly2016-10-071-13/+0
|
* cmTarget: Remove useless link library stateStephen Kelly2016-10-071-4/+0
|
* cmTarget: Remove addition of zero when merging link librariesStephen Kelly2016-10-071-1/+0
| | | | The size is always zero when this is called.
* cmTarget: Add assert about link dataStephen Kelly2016-10-071-0/+1
| | | | | | | | MergeLinkLibraries is called only from cmMakefile::AddGlobalLinkInformation which is only called immediately after creating a target.
* Add a BUILD_RPATH target property specifying build-tree RPATH entriesRuslan Baratov2016-10-031-0/+1
| | | | | | Users may need to add custom `RPATH` entries to be able to run binaries from their build tree without setting `LD_LIBRARY_PATH`. Provide a way to do this that does not affect the install-tree `RPATH`.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+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.
* Fix XCODE_ATTRIBUTE_..._LOCATION target property lookupBrad King2016-09-221-1/+2
| | | | | | | | | | | | | | | Refactoring in commit v3.5.0-rc1~272^2~16 (cmGeneratorTarget: Add API for property keys, 2015-10-25) changed the Xcode generator implementation of `XCODE_ATTRIBUTE_...` properties to use the target `GetProperty` method on each `XCODE_ATTRIBUTE_...` property listed by `GetPropertyKeys` instead of looping over the property entries directly. This made the lookup of property names of the form `XCODE_ATTRIBUTE_..._LOCATION` accidentally trigger the computed property logic for the undocumented/legacy `<CONFIG>_LOCATION` property. Of course the computed property value is not the same as the value stored in the `XCODE_ATTRIBUTE_..._LOCATION` property. Fix the computed property logic to avoid triggering on `XCODE_ATTRIBUTE_...` attributes. Closes: #16319
* Convert: Remove last uses of HOME enum valueStephen Kelly2016-09-191-2/+2
|
* cmTarget: Remove unused support for partial constructionBrad King2016-09-151-21/+2
| | | | | We no longer need to support partial construction for cmTarget instances of type GLOBAL_TARGET. Require all constructor arguments up front.
* cmTarget: Inline SetType method at only remaining call siteBrad King2016-09-141-9/+6
|
* cmTarget: Construct with basic information up frontBrad King2016-09-141-9/+10
| | | | | Avoid having partially constructed cmTarget instances around, except for the special case of GLOBAL_TARGET construction.
* cmTarget: Add method to get a copy adapted for a directoryBrad King2016-09-141-0/+9
| | | | | The "global" targets are built once for the top directory and then copied into all directories. Add a helper method to make the copy.
* Convert: Replace trivial conversion with new methodStephen Kelly2016-08-271-1/+2
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-14/+27
|
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-161-4/+8
|
* Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exportsYury Zhuravlev2016-07-111-1/+2
| | | | | For executables with ENABLE_EXPORTS set, export all symbols when instructed to do so by WINDOWS_EXPORT_ALL_SYMBOLS.
* use CM_NULLPTRDaniel Pfeifer2016-06-281-84/+84
|
* Use <unordered_set> where availableDaniel Pfeifer2016-06-271-1/+5
|
* Merge topic 'link_what_you_use'Brad King2016-06-171-0/+1
|\ | | | | | | | | | | a0902efa Help: Add notes for topic 'link_what_you_use' 96242f80 Add options to run `ldd -u -r` as a "link-what-you-use" tool
| * Add options to run `ldd -u -r` as a "link-what-you-use" toolBill Hoffman2016-06-171-0/+1
| | | | | | | | | | | | | | Create a LINK_WHAT_YOU_USE target property and corresponding CMAKE_LINK_WHAT_YOU_USE variable to enable this behavior. Extend link commands by running `ldd -u -r` to detect shared libraries that are linked but not needed.
* | Add missing braces around statements.Daniel Pfeifer2016-06-101-1/+2
| | | | | | | | | | Apply fixits of clang-tidy's readability-braces-around-statements checker.
* | Prefer std::ostream& over derivatives as parametersDaniel Pfeifer2016-06-081-2/+1
|/
* Fix crash on $<TARGET_PROPERTY:...,LOCATION> genex (#16134)Brad King2016-06-021-3/+9
| | | | | | | | | | | | | | | | | | Policy CMP0026 deprecated the LOCATION property, and we have long provided a $<TARGET_FILE:...> generator expression. However, if a project tries to use $<TARGET_PROPERTY:...,LOCATION> we should at least not crash. The compatibility implementation of the LOCATION property uses cmGlobalGenerator::CreateGenerationObjects to create the structures needed to evaluate the property before generation starts. The implementation assumed that accessing the property could only be done during configuration (via the typical get_property command use case). The $<TARGET_PROPERTY:...,LOCATION> genex causes the LOCATION property to be accessed during generation. Calling CreateGenerationObjects during generation blows away all the objects currently being used for generation and is not safe. Add a condition to call it only when configuration is not finished.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-699/+474
| | | | | | | | | | | | | 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-51/+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.
* Help clang-format wrap after braces on long initializer listsBrad King2016-05-061-0/+1
| | | | | | Add a long comment inside a few braced initializer lists in order to convince clang-format to break after the opening brace and format the list without indenting every value past the opening brace.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Add options to run clang-tidy with the compilerDaniel Pfeifer2016-04-131-0/+2
| | | | | | Create a <LANG>_CLANG_TIDY target property (initialized by a CMAKE_<LANG>_CLANG_TIDY variable) to specify a clang-tidy command line to be run along with the compiler.
* Drop Visual Studio 6 generatorBrad King2016-03-091-298/+0
| | | | | | This generator has been deprecated since CMake 3.3. Remove it. Update documentation, modules, and tests to drop content specific to this generator.
* Xcode: Add support for combined install on iOSRuslan Baratov2015-12-101-0/+1
| | | | | | | | | | | | This patch solves the problem of installing both: Device and Simulator libraries on iOS. Before only one of them was installed. If the IOS_INSTALL_COMBINED property is set on a target, a special install hook will be activated which builds the corresponding target and combines both at the install location. The original patch was contributed by Ruslan Baratov, and polished by Gregor Jasny.