summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Allow export of targets with INTERFACE_SOURCES.Stephen Kelly2015-02-101-43/+93
| | | | | | Use the same rules for paths in source and binary dirs in installed INTERFACE_SOURCES as are used for INTERFACE_INCLUDE_DIRECTORIES.
* Merge topic 'drop-ancient-workarounds'Brad King2015-01-121-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0f7bdd61 Remove VS 6 special case. 5e92c826 Remove some obsolete stuff. 15e42bb2 cmStandardIncludes: Remove obsolete cmOStringStream. 931e055d Port all cmOStringStream to std::ostringstream. f194a009 Remove unused cmIStringStream class. 3ec1bb15 cmStandardIncludes: Remove std namespace hack. bb3bce70 cmStandardIncludes: Remove ANSI_FOR_SCOPE hack. 28fa4923 cmStandardIncludes: Remove iostreams workaround for obsolete Compaq compiler. 837a8a63 cmStandardIncludes: Drop Comeau-related workaround. 4030ddfd Remove Borland-related undef. 17d6a6fd cmStandardIncludes: Remove comment about Borland. 26fb5011 Drop SGI as a CMake host compiler.
| * Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-7/+7
| | | | | | | | All compilers hosting CMake support the std class.
* | Use two-iterator std::set::insert where appropriate.Stephen Kelly2015-01-111-5/+1
|/
* cmExportFileGenerator: Make SetImportLinkProperty a templateBrad King2014-06-231-4/+4
| | | | | Allow the vector of property entries to have any element type that can convert to std::string.
* genex: remove the need for backtracesBen Boeckel2014-06-051-2/+1
| | | | | Rather than making dummy backtraces and passing them around, just make backtraces optional.
* CMP0052: Make the warning message more informative.Stephen Kelly2014-04-171-1/+4
| | | | | Print the reason for the offending entry in the INTERFACE_INCLUDE_DIRECTORIES.
* CMP0052: Do not warn when include dir is not in source or build treeBrad King2014-04-161-4/+6
| | | | | | | When the policy was added by commit 783bce29 (Export: Disallow exported interface includes in src/build tree, 2014-03-31) it accidentally left a code path that would warn when the include dir is in the install tree but *not* in the source or build tree. Fix that.
* Export: Disallow exported interface includes in src/build tree (#14592).Stephen Kelly2014-04-091-1/+37
| | | | | | | | | | | Allow directories in the source tree or build tree only if the install tree is a subdirectory of the source tree or build tree, as appropriate. Re-use the test files in the RunCMake.include_directories test to run in multiple scenarios. Bump the required CMake version in the test to 3.0 to ensure that the new policy warnings are emitted correctly.
* Remove some c_str() calls.Stephen Kelly2014-03-111-6/+6
| | | | | | 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.
* stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-12/+13
|
* stringapi: Use strings for variable namesBen Boeckel2014-03-081-1/+1
| | | | Variable names are always generated by CMake and should never be NULL.
* stringapi: Use strings for property namesBen Boeckel2014-03-081-6/+9
| | | | 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-1/+1
| | | | | | | | 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.
* Merge topic 'unicode-fstream'Brad King2014-01-071-3/+4
|\ | | | | | | | | 5730710 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
| * Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-3/+4
| | | | | | | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* | export: Rename some variables to reflect content type.Stephen Kelly2014-01-061-9/+9
|/ | | | This method is used with a list of languages.
* Constify handling of link targets.Stephen Kelly2013-12-111-1/+1
|
* Merge topic 'export-includes'Brad King2013-12-021-15/+55
|\ | | | | | | | | | | | | | | | | | | 5838aba Export: Report error on relative include with genex. 7a3e45b Export: Prefix relative items with genexes in INSTALL_INTERFACE. f088a32 Export: Process INSTALL_INTERFACE in INCLUDES DESTINATION. 9eedc85 Export: Process relative includes after genex evaluation. 80790f3 Export: Test existing behavior of exporting includes with genexes. 38afc82 target_include_directories: Allow relative path with genex
| * Export: Report error on relative include with genex.Stephen Kelly2013-11-261-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Export: Process INSTALL_INTERFACE in INCLUDES DESTINATION.Stephen Kelly2013-11-261-1/+4
| | | | | | | | | | | | | | | | | | | | Code such as install(TARGETS ... INCLUDES DESTINATION $<INSTALL_INTERFACE:include> ) should behave as if the INSTALL_INTERFACE wrapper were not present.
| * Export: Process relative includes after genex evaluation.Stephen Kelly2013-11-261-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | In code such as install(TARGETS ... INCLUDES DESTINATION $<FOO>include ) the generator expressions are evaluated at generate-time. Delay determining whether each entry is a relative path until after the generator expressions are evaluated. Such relative paths are based relative to the CMAKE_INSTALL_PREFIX.
* | INTERFACE_LIBRARY: Avoid codepaths which set unneeded properties.Stephen Kelly2013-11-251-15/+15
|/ | | | | | | | | | | | | As an INTERFACE_LIBRARY has no direct link dependencies, we can short-circuit in cmGeneratorExpressionEvaluator and in cmGlobalGenerator::CheckLocalGenerators. As they do not generate any output directly, any generate- or install- related code acn also be short-circuited. Many of the local generators already do this. Because only INTERFACE related properties make sense on INTERFACE_LIBRARY targets, avoid setting other properties, for example via defaults.
* Use new cmHasLiteralPrefix functionStephen Kelly2013-11-211-1/+1
|
* Merge branch 'policy-CMP0022-fixes' into policy-CMP0022-fixes-for-masterBrad King2013-11-031-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve conflict in Source/cmTarget.cxx by integrating the changes to the internal copy constructor from both sides. Also resolve a logical conflict by dropping the special case for INTERFACE_LIBRARY targets. Since cmTarget::SetMakefile already forces CMP0022 to NEW for such targets we need no special handling. Resolve conflict in Source/cmTargetLinkLibrariesCommand.h by dropping the documentation change. We will make the same change in the new location of the same documentation in a separate commit. Resolve conflicts in Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt Tests/RunCMake/CMP0022/RunCMakeTest.cmake by taking the side from the 'policy-CMP0022-fixes' branch.
| * Do not export INTERFACE_LINK_LIBRARIES from non-linkable targetsBrad King2013-11-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cmExportFileGenerator::SetImportLinkInterface exports the old LINK_INTERFACE_LIBRARIES property values it skips doing so for non-linkable targets because target->GetLinkInterface returns NULL for such targets. Since cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty looks at the INTERFACE_LINK_LIBRARIES property directly instead of using the computed link interface, teach it to skip exporting the property if target->IsLinkable returns false. Extend the RunCMake.CMP0022 test with a case covering this. Simply export an executable target that links to a library that is not exported.
| * CMP0022: Plain target_link_libraries must populate link interfaceBrad King2013-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CMP0022 NEW behavior is that the INTERFACE_LINK_LIBRARIES property exactly defines the link interface. The plain target_link_libraries signature says linking is transitive by default, so it should populate the property. Teach the target_link_libraries plain signature to populate the INTERFACE_LINK_LIBRARIES regardless of the CMP0022 setting. Refactor the cmTarget::ComputeLinkInterface checks that warn when the policy is not set to compare the new property to either the explicitly set old link interface properties or the link implementation fallback for all linkable target types, not just static libraries. This fixes a regression in 2.8.12.0 that caused target_link_libraries to not implement transitive linking in the plain signature once the policy CMP0022 is set to NEW.
* | cmTarget: Make GetProperty() const.Stephen Kelly2013-10-311-3/+3
| | | | | | | | | | | | 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.
* | cmTarget: Add interface for compatible numeric propertiesStephen Kelly2013-10-241-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | export(): Process the export() command at generate time.Stephen Kelly2013-10-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Make the API for adding targets string based so that it can easily use cmGeneratorTarget. Teach the cmIncludeCommand to generate the exported file at configure-time instead if it is to be include()d. The RunCMake.ExportWithoutLanguage test now needs a dummy header.h file as expected error from export() is now reported after the missing file error.
* | Merge topic 'INTERFACE_LIBRARY-target-type'Brad King2013-10-081-5/+11
|\ \ | | | | | | | | | | | | | | | | | | 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.
| * | export: Add support for INTERFACE_LIBRARY targetsStephen Kelly2013-10-081-5/+11
| |/
* | Export: Never treat private link libraries as public package dependencies.Stephen Kelly2013-09-241-1/+2
|/ | | | | | | | | | | | | | | Multiple libraries in a single buildsystem can be exported to multiple export-sets. If a library from one export set depends on a library from another export set, the export logic generates a check in the targets file to verify that the target in the other export set is found. That check is executed at downstream-find_package-time. However, a target may depend privately on a target in another export set. In that case, the depend used to also be listed in the required targets in the targets file. Change the export logic to ignore the private link entries instead.
* Export: Process generator expressions from INCLUDES DESTINATION.Stephen Kelly2013-07-311-3/+25
| | | | Configuration sensitive expressions are not permitted.
* Merge topic 'fix-export-includes-crash'Brad King2013-07-291-1/+1
|\ | | | | | | | | f868e47 Fix crash on export of target with empty INTERFACE_INCLUDE_DIRECTORIES.
| * Fix crash on export of target with empty INTERFACE_INCLUDE_DIRECTORIES.Stephen Kelly2013-07-291-1/+1
| | | | | | | | | | | | | | | | The new feature of install(TARGETS ... INCLUDES DESTINATION) introduced in commit 650e61f8 (Add a convenient way to add the includes install dir to the INTERFACE., 2013-01-05) introduced this crash. If the new feature is used with a target which has no INTERFACE_INCLUDE_DIRECTORIES, a segfault occurred.
* | Merge topic 'minor-cleanups'Brad King2013-07-291-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | b8dc7fa Genex: Disallow LINKER_LANGUAGE only when used on a static library. c8a10ba cmTarget: Fix iface libraries and languages for static libraries. f94bdb3 cmTarget: Remove duplicates when printing traces of tll signatures ff3d5fa Export: Fix typo of LINK_INTERFACE_LIBRARIES. 79a7a81 Docs: Document variables for default visibility values. 6f6391b Docs: Generalize and de-duplicate VISIBILITY_PREFIX docs. d8cb47f Docs: Trim trailing whitespace in generated doc. f10e648 Docs: Document existing target property debugging options. 4f4d69f Qt4Macros: Simplify some variable population. a413a40 Qt4Macros: Remove undefined varible use. b60a29e Qt4Macros: Remove unneeded generate CONDITION. e454cba Docs: Document file(GENERATE) CONDITION as optional.
| * Export: Fix typo of LINK_INTERFACE_LIBRARIES.Stephen Kelly2013-07-261-1/+1
| | | | | | | | Refer correctly to the old property, not the new one.
* | Merge topic 'install-interface-relative'Brad King2013-07-261-1/+2
|\ \ | | | | | | | | | | | | d777b8e Genex: Allow relative paths in INSTALL_INTERFACE.
| * | Genex: Allow relative paths in INSTALL_INTERFACE.Stephen Kelly2013-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | These paths can be prepended with the ${_IMPORT_PREFIX} generated in the export file. Such relative paths were previously an error.
* | | Merge topic 'install-interface-includes'Brad King2013-07-261-4/+8
|\ \ \ | |/ / | | / | |/ |/| 650e61f Add a convenient way to add the includes install dir to the INTERFACE.
| * Add a convenient way to add the includes install dir to the INTERFACE.Stephen Kelly2013-07-241-4/+8
| | | | | | | | | | | | | | Export the INCLUDES DESTINATION without appending to the INTERFACE_INCLUDE_DIRECTORIES of the target itself. That way, a target can be exported multiple times with different INCLUDES DESTINATION without unintended cross-pollution of export sets.
* | export: Error when exporting a target without a languageBen Boeckel2013-07-251-0/+10
| | | | | | | | | | | | | | | | First, it prevents a NULL dereference and second it reiterates that targets without languages are not supported by CMake. Add a RunCMake.ExportWithoutLanguage test exporting a library without a languages.
* | ExportTargets: add one more comment to the generated file.Alex Neundorf2013-07-191-1/+3
|/ | | | | | | | This patch adds a comment above the block which protects the exported targets file against multiple inclusion, to make the file easier to understand for readers. Alex
* Export: Generate INTERFACE_LINK_LIBRARIES property on targets.Stephen Kelly2013-07-081-0/+50
| | | | | | | | | | This property is generated only for targets which have recorded policy CMP0022 as NEW, and a compatibility mode is added to additionally export the old interfaces in that case too. If the old interfaces are not exported, the generated export files require CMake 2.8.12. Because the unit tests use a version which is not yet called 2.8.12, temporarily require a lower version.
* Merge topic 'rpath-on-mac'Brad King2013-06-031-1/+5
|\ | | | | | | | | | | | | | | 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 support for @rpath in export files.Clinton Stimpson2013-06-031-1/+5
| | | | | | | | | | Also expand the IMPORTED_SONAME property for targets to match the install_name.
* | Add EXPORT_NAME property.Stephen Kelly2013-05-181-5/+7
|/ | | | | | 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'.
* install(EXPORT): Ensure clean INTERFACE_INCLUDE_DIRECTORIESStephen Kelly2013-03-261-0/+111
| | | | | | | | | | Check that source and binary directories are not part of the INTERFACE_INCLUDE_DIRECTORIES for installed IMPORTED targets. This is limited to directories which do not contain generator expressions to evaluate. Such paths can only be checked at time of use of the imported target, which will be done in a follow up patch.
* Merge topic 'try_compile-targets'Brad King2013-02-251-0/+3
|\ | | | | | | | | | | | | 236133e Handle targets in the LINK_LIBRARIES of try_compile. 1c0597c Add a new Export generator for IMPORTED targets. f2ab17d Keep track of all targets seen while evaluating a genex.