summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* Fix CMake Internal Error from cmTarget::GetOutputInfo - triggered by calling ↵David Cole2009-09-251-10/+14
| | | | GetLocation on a utility target - caused by custom command output file with same name as custom target. The fix is to avoid calling GetLocation unless the target is of a type that is expected to have a location...
* Save source dependencies from custom command traceBrad King2009-09-071-5/+41
| | | | | | | | In each target we trace dependencies among custom commands to pull in all source files and build rules necessary to complete the target. This commit teaches cmTarget to save the inter-source dependencies found during its analysis. Later this can be used by generators that need to topologically order custom command rules.
* Cleanup source file dependency tracing logicBrad King2009-09-041-52/+56
| | | | | | | | | | In cmTarget we trace the dependencies of source files in the target to bring in all custom commands needed to generate them. We clean up the implementation to use simpler logic and better method names. The new approach is based on the observation that a source file is actually an input (dependency) of the rule that it runs (compiler or custom) even in the case that it is generated (another .rule file has the rule to generate it).
* Cleanup cmTarget source file list representationBrad King2009-09-041-8/+16
| | | | | | This teaches cmTarget to use a set of cmSourceFile pointers to guarantee unique insertion of source files in a target. The order of insertion is still preserved in the SourceFiles vector.
* Define 'multiplicity' for cyclic dependenciesBrad King2009-09-011-0/+64
| | | | | | | | | We create target property "LINK_INTERFACE_MULTIPLICITY" and a per-config version "LINK_INTERFACE_MULTIPLICITY_<CONFIG>". It sets the number of times a linker should scan through a mutually dependent group of static libraries. The largest value of this property on any target in the group is used. This will help projects link even for extreme cases of cyclic inter-target dependencies.
* Create cmTarget DLL query methodsBrad King2009-08-111-3/+9
| | | | | | | We creates methods IsDLLPlatform() and HasImportLibrary(). The former returns true on Windows. The latter returns whether the target has a DLL import library. It is true on Windows for shared libraries and executables with exports.
* Do not always propagate linker language preferenceBrad King2009-07-301-11/+22
| | | | | | | | | | | | The commit "Consider link dependencies for link language" taught CMake to propagate linker language preference from languages compiled into libraries linked by a target. It turns out this should only be done for some languages, such as C++, because normally the language of the program entry point (main) should be used. We introduce variable CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES to tell CMake whether a language should propagate its linker preference across targets. Currently it is true only for C++.
* Refactor target linker language selectionBrad King2009-07-301-29/+56
| | | | | | This factors the decision logic out of cmTarget::ComputeLinkClosure into dedicated class cmTargetSelectLinker. We replace several local variables with a single object instance, and organize code into methods.
* ENH: Export and import link interface languagesBrad King2009-07-111-0/+42
| | | | | | | | Now that languages are part of the link interface of a target we need to export/import the information. A new IMPORTED_LINK_INTERFACE_LANGUAGES property and per-config IMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG> property specify the information for imported targets. The export() and install(EXPORT) commands automatically set the properties.
* ENH: Update LINKER_LANGUAGE and HAS_CXX docsBrad King2009-07-101-9/+15
| | | | | This updates the documentation of these properties to account for the new automatic linker language computation.
* ENH: Consider link dependencies for link languageBrad King2009-07-101-19/+116
| | | | | | | | | | | This teaches cmTarget to account for the languages compiled into link dependencies when determining the linker language for its target. We list the languages compiled into a static archive in its link interface. Any target linking to it knows that the runtime libraries for the static archive's languages must be available at link time. For now this affects only the linker language selection, but later it will allow CMake to automatically list the language runtime libraries.
* ENH: only 5 failing tests for VS 10Bill Hoffman2009-07-101-0/+1
|
* BUG: Use link language for target name computationBrad King2009-07-081-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | The commit "Do not compute link language for LOCATION" was wrong. The variables CMAKE_STATIC_LIBRARY_PREFIX_Java CMAKE_STATIC_LIBRARY_SUFFIX_Java are used for building Java .jar files. This commit re-enables the feature and documents the variables: CMAKE_EXECUTABLE_SUFFIX_<LANG> CMAKE_IMPORT_LIBRARY_PREFIX_<LANG> CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG> CMAKE_SHARED_LIBRARY_PREFIX_<LANG> CMAKE_SHARED_LIBRARY_SUFFIX_<LANG> CMAKE_SHARED_MODULE_PREFIX_<LANG> CMAKE_SHARED_MODULE_SUFFIX_<LANG> CMAKE_STATIC_LIBRARY_PREFIX_<LANG> CMAKE_STATIC_LIBRARY_SUFFIX_<LANG> Instead of making separate, repetitive entries for the _<LANG> variable documentation, we just mention the per-language name in the text of the platform-wide variable documentation. Internally we keep undocumented definitions of these properties to satisfy CMAKE_STRICT mode.
* ENH: Pass config to cmTarget::GetLinkerLanguageBrad King2009-07-081-4/+4
| | | | | | This passes the build configuration to most GetLinkerLanguage calls. In the future the linker language will account for targets linked in each configuration.
* ENH: Pass config to cmTarget RPATH install methodsBrad King2009-07-081-3/+4
| | | | | This passes the build configuration to cmTarget methods IsChrpathUsed and NeedRelinkBeforeInstall. Later these methods will use the value.
* ENH: Do not compute link language for LOCATIONBrad King2009-07-081-15/+0
| | | | | | | | | | | | | The LOCATION property requires the full file name of a target to be computed. Previously we computed the linker language for a target to look up variables such as CMAKE_SHARED_LIBRARY_SUFFIX_<LANG>. This led to locating all the source files immediately instead of delaying the search to generation time. In the future even more computation will be needed to get the linker language, so it is better to avoid it. The _<LANG> versions of these variables are undocumented, not set in any platform file we provide, and do not produce hits in google. This change just removes the unused feature outright.
* ENH: Introduce cmTarget::LinkImplementation APIBrad King2009-07-081-67/+96
| | | | | | | | The new method centralizes loops that process raw OriginalLinkLibraries to extract the link implementation (libraries linked into the target) for each configuration. Results are computed on demand and then cached. This simplifies link interface computation because the default case trivially copies the link implementation.
* COMP: Pimplize cmTarget ImportInfo and OutputInfoBrad King2009-07-081-8/+33
| | | | | | These member structures are accessed only in the cmTarget implementation so they do not need to be defined in the header. This cleanup also aids Visual Studio 6 in compiling them.
* BUG: Do not recompute link interfacesBrad King2009-07-071-3/+3
| | | | | | The config-to-interface map in cmTarget should use case-insensitive configuration names. The change avoids repeating work if the given configuration has a different case than one already computed.
* BUG: Fix CMP0003 wrong-config link dir supportBrad King2009-07-071-1/+1
| | | | | | | This fixes a dumb logic error introduced by the centralization of link interface computation. It prevented link directories from alternate configurations from getting listed by the OLD behavior of CMP0003 for targets linked as transitive dependencies.
* ENH: Simplify cmTarget link interface storageBrad King2009-07-071-51/+27
| | | | | This makes the LinkInterface struct a member of cmTarget, pimplizes the config-to-interface map, and stores interface instances by value.
* ENH: Simpler cmTarget::GetLinkerLanguage signatureBrad King2009-07-071-11/+7
| | | | | | | This method previously required the global generator to be passed, but that was left from before cmTarget had its Makefile member. Now the global generator can be retrieved automatically, so we can drop the method argument.
* ENH: Centralize default link interface computationBrad King2009-07-061-37/+65
| | | | | | When LINK_INTERFACE_LIBRARIES is not set we use the link implementation to implicitly define the link interface. These changes centralize the decision so that all linkable targets internally have a link interface.
* ENH: Move CMP0004 check into cmTargetBrad King2009-07-061-0/+59
| | | | | | This moves code implementing policy CMP0004 into cmTarget::CheckCMP0004. The implementation is slightly simpler and can be re-used outside of cmComputeLinkDepends.
* ENH: Exception safe link interface computationBrad King2009-07-061-7/+10
| | | | | | This fixes cmTarget::GetLinkInterface to compute and return the link interface in an exception-safe manner. We manage the link interface returned by cmTarget::ComputeLinkInterface using auto_ptr.
* ENH: Refactor target output dir computationBrad King2009-07-031-63/+54
| | | | | | This creates cmTarget::GetOutputInfo to compute, cache, and lookup target output directory information on a per-configuration basis. It avoids re-computing the information every time it is needed.
* ENH: Clarify COMPILE_DEFINITIONS separator in docsBrad King2009-06-241-1/+2
| | | | | The COMPILE_DEFINITIONS properties are semicolon-separated lists. Make this clear in the documentation. See issue #9199.
* ENH: On VMS use _dir and _tmp, not .dir and .tmpBrad King2009-06-101-0/+4
| | | | | | The VMS posix path emulation does not handle multiple '.' characters in file names in all cases. This avoids adding extra '.'s to file and directory names for target directories and generated files.
* ENH: Remove cmTarget internal type argumentsBrad King2009-05-011-64/+31
| | | | | | | | Internally cmTarget was passing the target type in several name computation signatures to support computation of both shared and static library names for one target. We no longer need to compute both names, so this change simplifies the internals by using the GetType method and dropping the type from method signatures.
* ENH: Remove cmTarget::GetExecutableCleanNamesBrad King2009-05-011-12/+0
| | | | This method was redundant with GetExecutableNames.
* ENH: Always imply CLEAN_DIRECT_OUTPUT target propBrad King2009-05-011-48/+0
| | | | | | | | | | | | | | This property was left from before CMake always linked using full path library names for targets it builds. In order to safely link with "-lfoo" we needed to avoid having both shared and static libraries in the build tree for targets that switch on BUILD_SHARED_LIBS. This meant cleaning both shared and static names before creating the library, which led to the creation of CLEAN_DIRECT_OUTPUT to disable the behavior. Now that we always link with a full path we do not need to clean old library names left from an alternate setting of BUILD_SHARED_LIBS. This change removes the CLEAN_DIRECT_OUTPUT property and instead uses its behavior always. It removes some complexity from cmTarget internally.
* ENH: Allow more specification of target file namesBrad King2009-05-011-28/+83
| | | | | | | | | | | | | | This creates target properties ARCHIVE_OUTPUT_NAME, LIBRARY_OUTPUT_NAME, and RUNTIME_OUTPUT_NAME, and per-configuration equivalent properties ARCHIVE_OUTPUT_NAME_<CONFIG>, LIBRARY_OUTPUT_NAME_<CONFIG>, and RUNTIME_OUTPUT_NAME_<CONFIG>. They allow specification of target output file names on a per-type, per-configuration basis. For example, a .dll and its .lib import library may have different base names. For consistency and to avoid ambiguity, the old <CONFIG>_OUTPUT_NAME property is now also available as OUTPUT_NAME_<CONFIG>. See issue #8920.
* ENH: Refactor target output file type computationBrad King2009-05-011-56/+60
| | | | | | | This creates method cmTarget::GetOutputTargetType to compute the output file type 'ARCHIVE', 'LIBRARY', or 'RUNTIME' from the platform and target type. It factors out logic from the target output directory computation code for later re-use.
* ENH: Allow IMPORTED_IMPLIB w/o IMPORTED_LOCATIONBrad King2009-04-081-23/+68
| | | | | | Linking to a Windows shared library (.dll) requires only its import library (.lib). This teaches CMake to recognize SHARED IMPORTED library targets that set only IMPORTED_IMPLIB and not IMPORTED_LOCATION.
* BUG: Fix imported target config guessBrad King2009-04-081-1/+1
| | | | | | | When an IMPORTED target provides no generic configuration and no match for a desired configuration then we choose any available configuration. This change corrects the choice when the first listed available configuration does not really have a location.
* ENH: Support preprocessor def values in VS6Brad King2009-03-231-1/+1
| | | | | | | | | The add_definitions() command and COMPILE_DEFINITIONS dir/tgt/src properties support preprocessor definitions with values. Previously values were not supported in the VS6 generator even though the native tool supports them. It is only values with spaces that VS6 does not support. This enables support and instead complains only for values with spaces. See issue #8779.
* ENH: Mention CMAKE_* variables in RPATH propertiesBrad King2009-03-191-4/+13
| | | | | | The RPATH target properties are initialized by CMAKE_<prop> variables at target creation time. This notes the feature in the property documentation. It is already noted in the variable documentation.
* ENH: Define RULE_LAUNCH_* propertiesBrad King2009-02-101-0/+19
| | | | | | | This defines global, directory, and target properties RULE_LAUNCH_COMPILE, RULE_LAUNCH_LINK, and RULE_LAUNCH_CUSTOM. Their values specify 'launcher' command lines which are prefixed to compile, link, and custom build rules by Makefile generators.
* ENH: Define target and source property LABELSBrad King2009-02-101-0/+5
| | | | | | This creates a new LABELS property for targets and source files. We write the labels of each target and its source files in target-specific locations in the build tree for future use.
* ENH: Define target-specific support directoriesBrad King2009-02-101-0/+11
| | | | | | | | | This creates method cmTarget::GetSupportDirectory to compute a target-specific support directory in the build tree. It uses the "CMakeFiles/<name>.dir" convention already used by the Makefile generators. The method will be useful for any code that needs to generate per-target information into the build tree for use by CMake tools that do not run at generate time.
* BUG: Fix LOCATION property for Mac AppBundlesBrad King2009-01-201-0/+10
| | | | | | | Previously cmTarget::GetLocation and cmTarget::GetFullPath would return for Mac AppBundles the top-level bundle directory but without the .app extension. We worked around this at the call sites. This fixes the methods and removes the work-arounds. See issue #8406.
* ENH: Enable LOCATION property for imported targetsBrad King2009-01-051-10/+26
| | | | | | | | | Previously we left the LOCATION property undefined for imported targets since it should no longer be used for non-imported targets. However, in the case we do not know the name of an available imported configuration, it is more readable to get the LOCATION property than LOCATION_<CONFIG> for a bogus configuration <CONFIG>. This enables LOCATION for imported targets and returns an unspecified available imported configuration.
* BUG: Fix <CONFIG>_POSTFIX property/variable docsBrad King2008-12-151-4/+13
| | | | | | | | The CMAKE_<CONFIG>_POSTFIX variable and <CONFIG>_POSTFIX property were not documented. This updates the CMAKE_DEBUG_POSTFIX and DEBUG_POSTFIX documentation to refer to the more general variable/property. It also clarifies that the variable is used as the property default only for non-executable targets. See issue #7868.
* ENH: add missing property definitionsBill Hoffman2008-10-071-0/+26
|
* STYLE: add documentation for the "TYPE" target propertyAlexander Neundorf2008-10-021-0/+7
| | | | Alex
* ENH: Allow link line computation for static libsBrad King2008-09-151-3/+0
| | | | | | In some cases it may be useful to compute a "link" line for a static library even though it will not be put in the generated build system. This removes the assertion which previously diallowed the case.
* ENH: Allow a custom list of debug configurationsBrad King2008-09-041-5/+29
| | | | | | Create a DEBUG_CONFIGURATIONS global property as a way for projects to specify which configuration names are considered to be 'debug' configurations.
* ENH: Create Info.plist files in OS X FrameworksBrad King2008-09-021-0/+20
| | | | | | | A Mac OS X Framework should provide a Resources/Info.plist file containing meta-data about the framework. This change generates a default Info.plist for frameworks and provides an interface for users to customize it.
* ENH: Disallow link-type keywords in link interfaceBrad King2008-08-191-0/+64
| | | | | | | | | The LINK_INTERFACE_LIBRARIES target property may not contain the "debug", "optimized", or "general" keywords. These keywords are supported only by the target_link_libraries (and link_libraries) command and are not a generic library list feature in CMake. When a user attempts to add one of these keywords to the property value, we now produce an error message that refers users to alternative means.