diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-11-22 12:16:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-11-25 15:00:35 (GMT) |
commit | bb1111eaa220eb534338410e2d1ffcf696f9ae44 (patch) | |
tree | 0ab92098a49fc6b65d06fa87d858e40b2f79d5df /Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt | |
parent | 96691d126bb1d1e3a9c7fc049429a36032a98346 (diff) | |
download | CMake-bb1111eaa220eb534338410e2d1ffcf696f9ae44.zip CMake-bb1111eaa220eb534338410e2d1ffcf696f9ae44.tar.gz CMake-bb1111eaa220eb534338410e2d1ffcf696f9ae44.tar.bz2 |
Help: Warn that paths should not be used in INTERFACE_ build properties.
Diffstat (limited to 'Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt')
-rw-r--r-- | Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt new file mode 100644 index 0000000..ceefa4d --- /dev/null +++ b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt @@ -0,0 +1,23 @@ + +Note that it is not advisable to populate the +|INTERFACE_PROPERTY_LINK| of a target with paths for dependencies. +That would hard-code into installed packages the include directory paths +for dependencies **as found on the machine the package was made on**. + +That is, code like this is incorrect for targets which will be used to +generate :manual:`cmake-packages(7)`: + +.. code-block:: cmake + + target_link_libraries(mylib INTERFACE + ${Boost_LIBRARIES};${OtherDep_LIBRARIES} + ) + +Dependencies must provide their own :ref:`IMPORTED targets <Imported Targets>` +which have their own :prop_tgt:`IMPORTED_LOCATION` populated +appropriately. That way, when a consumer uses the installed package, the +consumer will run the appropriate :command:`find_package` command to find +the dependencies on their own machine and populate the +:ref:`IMPORTED targets <Imported Targets>` with appropriate paths. See +:ref:`Creating Packages` for more. Note that many modules currently shipped +with CMake do not currently provide :ref:`IMPORTED targets <Imported Targets>`. |