summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Deduplicate the isGeneratorExpression method.Stephen Kelly2013-02-071-9/+1
| | | | This API seems like the most appropriate.
* Add the $<LINKED:...> generator expression.Stephen Kelly2013-01-311-6/+60
| | | | | | This is both a short form of using a TARGET_DEFINED expression together with a TARGET_PROPERTY definition, and a way to strip non-target content from interface properties when exporting.
* Add a way to exclude INTERFACE properties from exported targets.Stephen Kelly2013-01-311-3/+4
| | | | | | | | | | | | Projects set interface requirements upstream, and existing downstreams use of target_link_libraries will consume those interfaces. This can create a backward compatibility concern as the result may be changing the order of include directories of downstreams, or another side-effect of using the INTERFACE properties. Provide a way for them to emulate the behavior of a version-based policy in the config file.
* Advance more when preprocessing exported strings.Stephen Kelly2013-01-311-1/+1
| | | | | | When evaluating TARGET_PROPERTY here, we can skip to the comma location. We need to calculate it though as the string may have just been changed.
* Merge topic 'fix-TARGET_PROPERTY-extraction'Brad King2013-01-291-11/+3
|\ | | | | | | | | 5daaa5c Fix TARGET_PROPERTY target extractions.
| * Fix TARGET_PROPERTY target extractions.Stephen Kelly2013-01-291-11/+3
| | | | | | | | | | | | | | We need to make sure we can export targets which have content such as $<0:$<TARGET_PROPERTY:not_a_target,INTERFACE_INCLUDE_DIRECTORIES> That means making not finding a target non-fatal here.
* | Add the INSTALL_PREFIX genex.Stephen Kelly2013-01-271-0/+10
|/
* Add the COMPATIBLE_INTERFACE_STRING property.Stephen Kelly2013-01-241-0/+6
|
* Merge topic 'export-new-style-files'Brad King2013-01-231-61/+61
|\ | | | | | | | | 02d4e53 Generate new-style cmake code during export.
| * Generate new-style cmake code during export.Stephen Kelly2013-01-201-61/+61
| | | | | | | | Use empty end*() commands and lowercase commands.
* | Export the COMPATIBLE_INTERFACE_BOOL content propertiesStephen Kelly2013-01-211-0/+74
|/
* Export the INTERFACE_PIC property.Stephen Kelly2013-01-151-0/+12
|
* Move the exported check for dependencies of targetsStephen Kelly2013-01-151-2/+3
| | | | | Check only once, in the Config.cmake file, instead of once in each Config-<cfg>.cmake file.
* Only generate one check per missing target.Stephen Kelly2013-01-151-11/+15
|
* Don't write a comment in the export file without the code.Stephen Kelly2013-01-151-0/+4
|
* Allow generator expressions in LINK_INTERFACE_LIBRARIES.Stephen Kelly2013-01-101-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Config and IMPORTED_ variants may also contain generator expressions. If 'the implementation is the interface', then the result of evaluating the expressions at generate time is used to populate the IMPORTED_LINK_INTERFACE_LIBRARIES property. 1) In the case of non-static libraries, this is fine because the user still has the option to populate the LINK_INTERFACE_LIBRARIES with generator expressions if that is what is wanted. 2) In the case of static libraries, this prevents a footgun, enforcing that the interface and the implementation are really the same. Otherwise, the LINK_LIBRARIES could contain a generator expression which is evaluated with a different context at build time, and when used as an imported target. That would mean that the result of evaluating the INTERFACE_LINK_LIBRARIES property for a static library would not necessarily be the 'link implementation'. For example: add_library(libone STATIC libone.cpp) add_library(libtwo STATIC libtwo.cpp) add_library(libthree STATIC libthree.cpp) target_link_libraries(libtwo $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>:libone>) target_link_libraries(libthree libtwo) If the LINK_LIBRARIES content was simply copied to the IMPORTED_LINK_INTERFACE_LIBRARIES, then libthree links to libone, but executables linking to libthree will not link to libone. 3) As the 'implementation is the interface' concept is to be deprecated in the future anyway, this should be fine.
* Split LINK_INTERFACE_LIBRARIES export handling into dedicated method.Stephen Kelly2013-01-101-3/+21
|
* Split the generator expression before extracting targets.Stephen Kelly2013-01-101-0/+45
| | | | | | | | | | | | Now that we're processing a LINK_INTERFACE_LIBRARIES string, it can contain targets. Make sure they are extracted for namespacing purposes. This needs to be restricted to strings which can actually have targets named in them. For example, this is not done for INTERFACE_COMPILE_DEFINITIONS, because even if there is a target named 'foo', the string 'foo' in that property means that '-Dfoo' will be set when compiling.
* Extract the AddTargetNamespace method.Stephen Kelly2013-01-101-95/+48
|
* Don't pass a position when determining if a target name is a literal.Stephen Kelly2013-01-101-1/+1
| | | | The lastPos refers to a position in a different string.
* Make linking APIs aware of 'head' targetStephen Kelly2013-01-081-1/+2
| | | | | | | | | | | The 'head' is the dependent target to be linked with the current target. It will be used to evaluate generator expressions with proper handling of mapped configurations and is used as the source target of properties. This requires that memoization is done with a key of a pair of target and config, instead of just config, because now the result also depends on the target. Removing the memoization entirely is not an option because it slows cmake down considerably.
* Add API to populate INTERFACE properties in exported targets.Stephen Kelly2013-01-051-0/+59
| | | | | The INTERFACE properties need to be preprocessed for context (build location or install location) and to extract target names etc.
* Add API to extract target names from a genex string.Stephen Kelly2013-01-051-0/+136
| | | | | | | The TARGET_NAME expression, which requires a literal, provides target names. $<TARGET_PROPERTY:tgt,prop> also provides target names in the cases where tgt is a literal, so that TARGET_NAME is not needed then in addition.
* Generate an early-return guard in target Export files.Stephen Kelly2012-11-301-0/+31
| | | | | | | | | | | | Previously it was necessary for writers of Config files which incude exported target files to write the guard themselves, but this was not immediately obvious or documented. Options for them would be to use a variable, or an INHERITED directory property in an effort to avoid accidental name clashes in all contexts in which find_package can be used. Getting this right requires boiler plate code, so generate a simpler check automatically instead.
* exports: define a CMAKE_FIND_PACKAGE_NAME var set by find_package()Alex Neundorf2012-09-301-1/+8
| | | | | | | | | This way the name of the searched package can be accessed in find-modules, config-files and more importantly in generated target export files. This is now used when a target export file detects that a required target does not exist. Alex
* exports: move the handling of missing targets into subclassesAlex Neundorf2012-09-301-65/+1
| | | | | | | | | | Before, cmExportFileGenerator::ComplainAboutMissingTarget() was a virtual function which had to be implemented in the subclasses. It is not anymore. Instead, there is now a virtual function HandleMissingTargets(), which is implemented in the two subclasses. This makes e.g. dealing correctly with APPEND mode easier. Alex
* exports: fix build with MSVC6Alex Neundorf2012-09-281-1/+1
| | | | | | it seems it doesn't like deleting const pointers Alex
* exports: first try at error handling if a target is missingAlex Neundorf2012-09-281-7/+30
| | | | | | | | | Now, if an imported target depends on a library which must come from some other export set, cmake generates a check which errors out if that target does not exist. I guess instead of completely erroring out it would be better to only make the find_package() fail. Alex
* exports: accept a missing target if it is exported exactly onceAlex Neundorf2012-09-281-9/+67
| | | | | | | | | | | If a target is exported, and a library it depends on is not part of the same export set, before this patch cmake errored out. With this patch, it now checks whether the missing target is exported somewhere else exactly once, and accepts in this case (because then it can determine the namespace for the missing target and use this). Alex
* Support building shared libraries or modules without soname (#13155)Modestas Vainius2012-04-301-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a boolean target property NO_SONAME which may be used to disable soname for the specified shared library or module even if the platform supports it. This property should be useful for private shared libraries or various plugins which live in private directories and have not been designed to be found or loaded globally. Replace references to <CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG> and hard-coded -install_name flags with a conditional <SONAME_FLAG> which is expanded to the value of the CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG definition as long as soname supports is enabled for the target in question. Keep expanding CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG in rules in case third party projects still use it. Such projects would not yet use NO_SONAME so the adjacent <TARGET_SONAME> will always be expanded. Make <TARGET_INSTALLNAME_DIR> NO_SONAME aware as well. Since -install_name is soname on OS X, this should not be a problem if this variable is expanded only if soname is enabled. The Ninja generator performs rule variable substitution only once globally per rule to put its own placeholders. Final substitution is performed by ninja at build time. Therefore we cannot conditionally replace the soname placeholders on a per-target basis. Rather than omitting $SONAME from rules.ninja, simply do not write its contents for targets which have NO_SONAME. Since 3 variables are affected by NO_SONAME ($SONAME, $SONAME_FLAG, $INSTALLNAME_DIR), set them only if soname is enabled.
* install(EXPORT): Improve target import failure message formatBrad King2011-11-221-13/+10
|
* install(EXPORT): Enforce existence of imported target filesAlex Neundorf2011-11-221-0/+66
| | | | | | | | | | Typical <package>Config.cmake files for find_package() rely only on the files generated by install(EXPORT). They might be wrong, for whatever reasons, like people manually deleted files, projects were packaged wrong by distributions, whatever. To protect against this, add checks that the file locations we are importing actually exist on disk. Alex
* Add support for CFBundle targets on the Mac (#11295)Richard Bateman2011-01-111-0/+6
| | | | | This commit enables building, for example, plugin bundles to be loaded by web browsers.
* 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.
* Define 'multiplicity' for cyclic dependenciesBrad King2009-09-011-0/+8
| | | | | | | | | 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.
* ENH: Export and import link interface languagesBrad King2009-07-111-0/+3
| | | | | | | | 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: Simplify cmTarget link interface storageBrad King2009-07-071-1/+1
| | | | | This makes the LinkInterface struct a member of cmTarget, pimplizes the config-to-interface map, and stores interface instances by value.
* ENH: Centralize default link interface computationBrad King2009-07-061-44/+1
| | | | | | 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: Allow a custom list of debug configurationsBrad King2008-09-041-5/+1
| | | | | | Create a DEBUG_CONFIGURATIONS global property as a way for projects to specify which configuration names are considered to be 'debug' configurations.
* ENH: protect the export files against inclusion with cmake 2.4Alexander Neundorf2008-04-271-0/+6
| | | | Alex
* BUG: Generated target export files should set the policy version to 2.6 ↵Brad King2008-03-311-5/+7
| | | | instead of the currently running version because they are 2.6 compatible.
* ENH: Add cmake_policy push/version/pop to import/export files.Brad King2008-03-131-0/+7
|
* COMP: Fix Borland 5.5 buildBrad King2008-02-241-3/+3
| | | | | | | - Its <iosfwd> header includes windows.h which defines GetCurrentDirectory - It defines 'interface' so we cannot use it as a variable name.
* ENH: Pass dependent library search path to linker on some platforms.Brad King2008-02-011-1/+1
| | | | | | | | | | | | | | | | - Move runtime path ordering out of cmComputeLinkInformation into its own class cmOrderRuntimeDirectories. - Create an instance of cmOrderRuntimeDirectories for runtime path ordering and another instance for dependent library path ordering. - Replace CMAKE_DEPENDENT_SHARED_LIBRARY_MODE with explicit CMAKE_LINK_DEPENDENT_LIBRARY_FILES boolean. - Create CMAKE_LINK_DEPENDENT_LIBRARY_DIRS boolean. - Create variables to specify -rpath-link flags: CMAKE_SHARED_LIBRARY_RPATH_LINK_<LANG>_FLAG CMAKE_EXECUTABLE_RPATH_LINK_<LANG>_FLAG - Enable -rpath-link flag on Linux and QNX. - Documentation and error message updates
* ENH: Support linking to shared libs with dependent libsBrad King2008-01-311-7/+24
| | | | | | | | | - Split IMPORTED_LINK_LIBRARIES into two parts: IMPORTED_LINK_INTERFACE_LIBRARIES IMPORTED_LINK_DEPENDENT_LIBRARIES - Add CMAKE_DEPENDENT_SHARED_LIBRARY_MODE to select behavior - Set mode to LINK for Darwin (fixes universal binary problem) - Update ExportImport test to account for changes
* COMP: Remove unused parameter.Brad King2008-01-311-6/+3
|
* BUG: Fixed previous commit in cmExportFileGenerator to separate libraries ↵Brad King2008-01-301-1/+4
| | | | correctly in the import link list.
* ENH: Implemented link-interface specification feature.Brad King2008-01-301-19/+58
| | | | | | | | | | | | - Shared libs and executables with exports may now have explicit transitive link dependencies specified - Created LINK_INTERFACE_LIBRARIES and related properties - Exported targets get the interface libraries as their IMPORTED_LINK_LIBRARIES property. - The export() and install(EXPORT) commands now give an error when a linked target is not included since the user can change the interface libraries instead of adding the target.
* ENH: Support exporting/importing of AppBundle targets.Brad King2008-01-281-4/+9
| | | | | | | | - Imported bundles have the MACOSX_BUNDLE property set - Added cmTarget::IsAppBundleOnApple method to simplify checks - Document BUNDLE keyword in INSTALL command - Updated IMPORTED_LOCATION property documentation for bundles - Updated ExportImport test to test bundles
* BUG: Fix export/import file generation to not store link dependencies of ↵Brad King2008-01-281-2/+16
| | | | executables or modules.