summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-18 13:21:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-02-18 13:21:50 (GMT)
commit4388c3f717c39c4d41aa5d46904c72bddd5c1ff5 (patch)
tree9285b2dbfa5ed86e5ea19f095769bf768c9dbf37 /Help
parent1939510ecbc68ce0a9711430ec60f544eb9a0844 (diff)
parentb6445ddeda9b4a608cd34d417f04aa2ee558ef76 (diff)
downloadCMake-4388c3f717c39c4d41aa5d46904c72bddd5c1ff5.zip
CMake-4388c3f717c39c4d41aa5d46904c72bddd5c1ff5.tar.gz
CMake-4388c3f717c39c4d41aa5d46904c72bddd5c1ff5.tar.bz2
Merge topic 'DOC-SelectLibraryConfiguration'
b6445ddeda Help: Add SelectLibraryConfigurations example to cmake-developer(7) Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Alex <leha-bot@yandex.ru> Merge-request: !5815
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-developer.7.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index af9a8ab..fe146de 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -350,6 +350,24 @@ look.
PATHS ${PC_Foo_LIBRARY_DIRS}
)
+Alternatively, if the library is available with multiple configurations, you can
+use :module:`SelectLibraryConfigurations` to automatically set the
+``Foo_LIBRARY`` variable instead:
+
+.. code-block:: cmake
+
+ find_library(Foo_LIBRARY_RELEASE
+ NAMES foo
+ PATHS ${PC_Foo_LIBRARY_DIRS}/Release
+ )
+ find_library(Foo_LIBRARY_DEBUG
+ NAMES foo
+ PATHS ${PC_Foo_LIBRARY_DIRS}/Debug
+ )
+
+ include(SelectLibraryConfigurations)
+ select_library_configurations(Foo)
+
If you have a good way of getting the version (from a header file, for
example), you can use that information to set ``Foo_VERSION`` (although
note that find modules have traditionally used ``Foo_VERSION_STRING``,