summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.h
Commit message (Collapse)AuthorAgeFilesLines
* Constify handling of target dependencies.Stephen Kelly2013-12-111-1/+1
|
* cmTarget: Require a compatible INTERFACE_AUTOUIC_OPTIONS from dependencies.Stephen Kelly2013-12-081-1/+0
| | | | | | | | | Revert the origin-tracking infrastructure from commit 98093c45 (QtAutoUic: Add INTERFACE_AUTOUIC_OPTIONS target property., 2013-11-20). Use the compatibility-tracking for compatible strings instead. If two different dependencies require different AUTOUIC_OPTIONS, cmake will now appropriately issue an error.
* cmTarget: Report origin of COMPATIBLE_INTERFACE properties.Stephen Kelly2013-12-081-0/+6
|
* Merge topic 'INTERFACE_AUTOUIC_OPTIONS'Brad King2013-12-021-0/+3
|\ | | | | | | | | | | | | | | 98093c4 QtAutoUic: Add INTERFACE_AUTOUIC_OPTIONS target property. 02542b4 QtAutoUic: Handle new -include command line parameter. 1242f4e Genex: Add {UPPER,LOWER}_CASE and MAKE_C_IDENTIFIER. 754b321 QtAutogen: Use config without prefix in map key.
| * QtAutoUic: Add INTERFACE_AUTOUIC_OPTIONS target property.Stephen Kelly2013-11-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transitively consume the property from linked dependents. Implement configuration-specific support by following the pattern set out for compile definitions and includes in cmQtAutoGenerators. Implement support for origin-tracking with CMAKE_DEBUG_TARGET_PROPERTIES. This is motivated by the needs of KDE, which provides a separate translation system based on gettext instead of the Qt linguist translation system. The Qt uic tool provides command line options for configuring the method used to translate text, and to add an include directive to the generated file to provide the method. http://thread.gmane.org/gmane.comp.kde.devel.frameworks/7930/focus=7992 Implement the interface to provide the uic options as a usage-requirement on the KI18n target, as designed for KDE.
* | Export: Report error on relative include with genex.Stephen Kelly2013-11-261-1/+2
|/ | | | | | | | | | | | Diagnostics which check the sanity of exported include paths previously skipped over any path containing a generator expression. Introduce a policy to issue an error message in such cases. The export files created in the OLD behavior are not usable, because they contain relative paths or paths to the source or build location which are not suitable for use on installation. CMake will report an error on import.
* cmTarget: Trivially make more API const.Stephen Kelly2013-11-191-14/+15
|
* cmTarget: Make GetExportMacro const.Stephen Kelly2013-11-191-2/+2
| | | | The std::string member is only used for memory management.
* cmTarget: Make NameResolvesToFramework const.Stephen Kelly2013-11-191-1/+1
|
* cmTarget: Make GetInterfaceLinkLibraries const.Stephen Kelly2013-11-191-1/+1
|
* cmTarget: Make GetTargetSourceFileFlags const.Stephen Kelly2013-11-191-2/+3
|
* cmTarget: Make custom command accessors API const.Stephen Kelly2013-11-191-3/+9
| | | | Add specific mutators instead of providing non-const refs.
* Make accessors for compile-related information const.Stephen Kelly2013-11-091-6/+6
| | | | These can be moved to cmGeneratorTarget in CMake 4.0.
* cmTarget: Make some accessors const.Stephen Kelly2013-11-031-7/+7
|
* Merge topic 'constify'Brad King2013-11-011-78/+85
|\ | | | | | | | | | | c4373b3 cmTarget: Make GetProperty() const. cfb6661 Don't call SetProperty from GetProperty.
| * cmTarget: Make GetProperty() const.Stephen Kelly2013-10-311-78/+85
| | | | | | | | | | | | This has follow-on effects for other methods and classes. Further work on making the use of const cmTarget pointers common can be done, particularly with a view to generate-time methods.
* | Move TraceDependencies to cmGeneratorTarget.Stephen Kelly2013-10-301-9/+4
|/
* Remove the Location member from cmTarget.Stephen Kelly2013-10-291-1/+0
| | | | | | | It is never used. Presumably it only exists so that a const char * can be returned from GetLocation. However, that is getting in the way now, so use a static std::string instead, which is already a common pattern in cmake.
* Move GenerateTargetManifest to cmGeneratorTarget.Stephen Kelly2013-10-271-3/+0
|
* cmTarget: Add interface for compatible numeric propertiesStephen Kelly2013-10-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the boost MPL library, one can set a define to increase the limit of how many variadic elements should be supported. The default for BOOST_MPL_LIMIT_VECTOR_SIZE is 20: http://www.boost.org/doc/libs/1_36_0/libs/mpl/doc/refmanual/limit-vector-size.html If the foo library requires that to be set to 30, and the independent bar library requires it to be set to 40, consumers of both need to set it to 40. add_library(foo INTERFACE) set_property(TARGET foo PROPERTY INTERFACE_boost_mpl_vector_size 30) set_property(TARGET foo PROPERTY COMPATIBLE_INTERFACE_NUMBER_MAX boost_mpl_vector_size) target_compile_definitions(foo INTERFACE BOOST_MPL_LIMIT_VECTOR_SIZE=$<TARGET_PROPERTY:boost_mpl_vector_size>) add_library(bar INTERFACE) set_property(TARGET bar PROPERTY INTERFACE_boost_mpl_vector_size 40) # Technically the next two lines are redundant, but as foo and bar are # independent, they both set these interfaces. set_property(TARGET bar PROPERTY COMPATIBLE_INTERFACE_NUMBER_MAX boost_mpl_vector_size) target_compile_definitions(bar INTERFACE BOOST_MPL_LIMIT_VECTOR_SIZE=$<TARGET_PROPERTY:boost_mpl_vector_size>) add_executable(user) target_link_libraries(user foo bar) Because the TARGET_PROPERTY reads the boost_mpl_vector_size property from the HEAD of the dependency graph (the user target), and because that property appears in the COMPATIBLE_INTERFACE_NUMBER_MAX of the dependencies of the user target, the maximum value for it is chosen for the compile definition, ie, 40. There are also use-cases for choosing the minimum value of a number. In Qt, deprecated API can be disabled by version. Setting the definition QT_DISABLE_DEPRECATED_BEFORE=0 disables no deprecated API. Setting it to 0x501000 disables API which was deprecated before Qt 5.1 etc. If two dependencies require the use of API which was deprecated in different Qt versions, then COMPATIBLE_INTERFACE_NUMBER_MIN can be used to ensure that both can compile.
* Create make rules for INTERFACE_LIBRARY targets.Stephen Kelly2013-10-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The result is that the depends of the target are created. So, add_library(somelib foo.cpp) add_library(anotherlib EXCLUDE_FROM_ALL foo.cpp) add_library(extra EXCLUDE_FROM_ALL foo.cpp) target_link_libraries(anotherlib extra) add_library(iface INTERFACE) target_link_libraries(iface INTERFACE anotherlib) Executing 'make iface' will result in the anotherlib and extra targets being made. Adding a regular executable to the INTERFACE of an INTERFACE_LIBRARY will not result in the executable being built with 'make iface' because of the logic in cmComputeTargetDepends::AddTargetDepend. So far, this is implemented only for the Makefile generator. Other generators will follow if this feature is possible for them. Make INTERFACE_LIBRARY targets part of the all target by default. Test this by building the all target and making the expected library EXCLUDE_FROM_ALL.
* cmTarget: Deprecate the LOCATION target property with a policy.Stephen Kelly2013-10-111-0/+2
| | | | | | | | | | | | The final location and name of a build-target is not determined until generate-time. However, reading the LOCATION property from a target is currently allowed at configure time. Apart from creating possibly-erroneous results, this has an impact on the implementation of cmake itself, and prevents some major cleanups from being made. Disallow reading LOCATION from build-targets with a policy. Port some existing uses of it in CMake itself to use the TARGET_FILE generator expression.
* Merge topic 'INTERFACE_LIBRARY-target-type'Brad King2013-10-081-0/+1
|\ | | | | | | | | | | | | ce0c303 install: Teach EXPORT option to handle INTERFACE_LIBRARY targets 435c912 export: Add support for INTERFACE_LIBRARY targets fe73226 Add the INTERFACE_LIBRARY target type.
| * Add the INTERFACE_LIBRARY target type.Stephen Kelly2013-10-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | cmTarget: Properly escape @ char in doxygen commentsSean McBride2013-10-081-3/+3
|/ | | | Found by clang's -Wdocumentation.
* Genex: Disallow LINKER_LANGUAGE only when used on a static library.Stephen Kelly2013-07-261-0/+3
| | | | | For shared libraries and executables, the linker_language is indepenedent of the linked libraries.
* target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signatureStephen Kelly2013-07-241-0/+8
| | | | | | | Add a new signature to help populate INTERFACE_LINK_LIBRARIES and LINK_LIBRARIES cleanly in a single call. Add policy CMP0023 to control whether the keyword signatures can be mixed with uses of the plain signatures on the same target.
* Merge topic 'drop-old-vs-dependency'Brad King2013-07-161-1/+1
|\ | | | | | | | | 4bb6e24 VS,Xcode: Drop incorrect legacy dependency trace (#14291)
| * VS,Xcode: Drop incorrect legacy dependency trace (#14291)Brad King2013-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the "vsProjectFile" argument from cmTarget::TraceDependencies. It appears to be the modern equivalent to a hunk added in commit ba68f771 (...added new custom command support, 2003-06-03): + name = libName; + name += ".dsp.cmake"; + srcFilesToProcess.push(name); but was broken by refactoring at some point. The current behavior tries to trace dependencies on a source file named the same as a target, which makes no sense. Furthermore, in code of the form add_executable(foo foo.c) add_custom_command(OUTPUT "${somewhere}/foo" ... DEPENDS foo) the "vsProjectFile" value "foo" matches source "${somewhere}/foo.rule" generated to hold the custom command and causes the command to be added to the "foo" target incorrectly. Simply drop the incorrect source file trace and supporting logic.
* | Merge topic 'tid-system-argument'Brad King2013-07-161-0/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property. 1925cff Add a SYSTEM parameter to target_include_directories (#14180) 286f227 Extend the cmTargetPropCommandBase interface property handling. 83498d4 Store system include directories in the cmTarget. f1fcbe3 Add Target API to determine if an include is a system include. 2679a34 Remove unused variable.
| * | Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.Stephen Kelly2013-07-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Store system include directories in the cmTarget.Stephen Kelly2013-07-021-0/+9
| |/ | | | | | | | | | | | | Entries from the cmMakefile are processed and maintained similarly to other include directories. The include_directories(SYSTEM) signature affects all following targets, and all prior targets in the same makefile.
* | Merge topic 'compile-defs-debugging'Brad King2013-07-151-1/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | d7dd010 Add target property debugging for COMPILE_DEFINITIONS 1841215 Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string. afc9243 Add an overload of cmIDEOptions::AddDefines taking a vector of strings. d95651e Overload cmLocalGenerator::AppendDefines to add a list.
| * | Add target property debugging for COMPILE_DEFINITIONSStephen Kelly2013-07-121-0/+3
| | | | | | | | | | | | | | | | | | | | | Use constructs similar to those for COMPILE_OPTIONS. This is a little different because there is a command to remove_definitions(), so we can't populate the equivalent target property until generate-time in cmGlobalGenerator.
| * | Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string.Stephen Kelly2013-07-111-1/+2
| |/ | | | | | | Refactor to create AddCompileDefinitions.
* | Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICYStephen Kelly2013-07-111-27/+19
| | | | | | | | | | | | Use preprocessor loops and add a unit test for the appropriate policies. All policies whose value is recorded at target creation time should be part of this list.
* | Introduce the INTERFACE_LINK_LIBRARIES property.Stephen Kelly2013-07-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This property replaces the properties which match (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?, and is enabled for IMPORTED targets, and for non-IMPORTED targets only with a policy. For static libraries, the INTERFACE_LINK_LIBRARIES property is also used as the source of transitive usage requirements content. Static libraries still require users to link to all entries in their LINK_LIBRARIES, but usage requirements such as INCLUDE_DIRECTORIES COMPILE_DEFINITIONS and COMPILE_OPTIONS can be restricted to only certain interface libraries. Because the INTERFACE_LINK_LIBRARIES property is populated unconditionally, we need to compare the evaluated result of it with the link implementation to determine whether to issue the policy warning for static libraries. For shared libraries, the policy warning is issued if the contents of the INTERFACE_LINK_LIBRARIES property differs from the contents of the relevant config-specific old LINK_INTERFACE_LIBRARIES property.
* | GenexEval: Add abstracted access to link interface for a target.Stephen Kelly2013-07-071-0/+3
|/ | | | | | This can be extended with special handling for static libraries so that we can process the link dependencies separately from the usage dependencies.
* Merge topic 'target-COMPILE_OPTIONS'Brad King2013-06-031-0/+6
|\ | | | | | | | | | | | | | | | | | | | | 24466f2 Add target_compile_options command. 80ca9c4 Add COMPILE_OPTIONS target property. 7cb2308 cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries 47f80d9 cmTarget: Rename struct to be more re-usable. 1319a14 Add <LANG>_COMPILER_ID generator expressions. 3549676 Add cmLocalGenerator::GetCompileOptions. f3ad863 VS6: Rename some variables to correspond to config values.
| * Add target_compile_options command.Stephen Kelly2013-06-021-0/+2
| | | | | | | | This command populates the COMPILE_OPTIONS target property.
| * Add COMPILE_OPTIONS target property.Stephen Kelly2013-06-021-0/+4
| | | | | | | | | | | | This method reads generator expressions from the COMPILE_OPTIONS target property, as well as INTERFACE_COMPILE_OPTIONS from linked dependents.
* | Merge topic 'rpath-on-mac'Brad King2013-06-031-0/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | dc1d025 OS X: Add test for rpaths on Mac. 8576b3f OS X: Add support for @rpath in export files. 00d71bd Xcode: Add rpath support in Xcode generator. 94e7fef OS X: Add RPATH support for Mac.
| * | OS X: Add RPATH support for Mac.Clinton Stimpson2013-06-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | RPATH support is activated on targets that have the MACOSX_RPATH property turned on. For install time, it is also useful to set INSTALL_RPATH to help find dependent libraries with an @rpath in their install name. Also adding detection of rpath conflicts when using frameworks.
* | | Merge topic 'framework-refactor'Brad King2013-06-031-13/+20
|\ \ \ | |/ / | | / | |/ |/| 373faae Refactor how bundles and frameworks are supported.
| * Refactor how bundles and frameworks are supported.Clinton Stimpson2013-05-231-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make handling of directory separators consistent between non-bundle and bundle code. Remove xcode specific flag from cmTarget when getting install_name. Add (more) consistent convenience functions in cmTarget to get directories inside of bundles and frameworks to add files to. This refactor also fixes bug #12263 where frameworks had the wrong install name when SKIP_BUILD_RPATH. Also make install_name for frameworks consistent between Makefile and Xcode generator.
* | Merge topic 'add-EXPORT_NAME-property'Brad King2013-05-221-0/+1
|\ \ | | | | | | | | | | | | b5d6f5d Add EXPORT_NAME property.
| * | Add EXPORT_NAME property.Stephen Kelly2013-05-181-0/+1
| | | | | | | | | | | | | | | | | | This allows for example, the buildsystem to use names like 'boost_any' instead of the overly generic 'any', and still be able to generate IMPORTED targets called 'boost::any'.
* | | Error on relative path in INCLUDE_DIRECTORIES target property.Stephen Kelly2013-05-211-0/+5
|/ / | | | | | | | | Add policy CMP0021 to preserve existing behavior in projects expecting it from earlier CMake versions.
* | Centralize maintenance of usage requirement include directoriesStephen Kelly2013-05-061-1/+0
|/ | | | | | Maintain a target's internal list of usage requirement include directories whenever the LINK_LIBRARIES property is set by either target_link_libraries or set_property.
* Fix the evaluation of per-config COMPILE_DEFINITIONS (#14037)Stephen Kelly2013-03-251-1/+1
| | | | | | | | | | | | | | The API for retrieving per-config COMPILE_DEFINITIONS has long existed because of the COMPILE_DEFINITIONS_<CONFIG> style properties. Ensure that the provided configuration being generated is also used to evaluate the generator expressions in cmTarget::GetCompileDefinitions. Both the generic COMPILE_DEFINITIONS and the config-specific variant need to be evaluated with the requested configuration. This has the side-effect that the COMPILE_DEFINITIONS does not need to be additionally evaluated with no configuration, so the callers can be cleaned up a bit too.