mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 11:22:21 -06:00
Help/guide: fix MathFunctionsTargets.cmake path in importing-exporting
It is using ${CMAKE_INSTALL_LIBDIR} and an extra "/MathFunctions" path
suffix since these commits:
- e58a76de51 Help/guide: fix importing-exporting CMake install destinations
- 26cf661b64 Help/guide: use GNUInstallDirs in importing-exporting example
This commit is contained in:
@@ -285,9 +285,9 @@ command.
|
||||
:end-before: # include CMakePackageConfigHelpers macro
|
||||
|
||||
This command generates the ``MathFunctionsTargets.cmake`` file and arranges
|
||||
to install it to ``lib/cmake``. The file contains code suitable for
|
||||
use by downstreams to import all targets listed in the install command from
|
||||
the installation tree.
|
||||
to install it to ``${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions``. The file
|
||||
contains code suitable for use by downstreams to import all targets listed in
|
||||
the install command from the installation tree.
|
||||
|
||||
The ``NAMESPACE`` option will prepend ``MathFunctions::`` to the target names
|
||||
as they are written to the export file. This convention of double-colons
|
||||
@@ -317,7 +317,8 @@ were built in its own tree. For example:
|
||||
.. code-block:: cmake
|
||||
:linenos:
|
||||
|
||||
include(${INSTALL_PREFIX}/lib/cmake/MathFunctionTargets.cmake)
|
||||
include(GNUInstallDirs)
|
||||
include(${INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions/MathFunctionTargets.cmake)
|
||||
add_executable(myexe src1.c src2.c )
|
||||
target_link_libraries(myexe PRIVATE MathFunctions::MathFunctions)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user