diff options
author | Johan Andruejol <johan.andruejol@kitware.com> | 2021-02-15 19:53:23 (GMT) |
---|---|---|
committer | Johan Andruejol <johan.andruejol@kitware.com> | 2021-02-17 19:27:52 (GMT) |
commit | b6445ddeda9b4a608cd34d417f04aa2ee558ef76 (patch) | |
tree | 10d1147c7760bae3e46d2daa4b5257eb22295565 /Help | |
parent | 8cb703cdce74144769b2e39efca2f00ac4e63f1b (diff) | |
download | CMake-b6445ddeda9b4a608cd34d417f04aa2ee558ef76.zip CMake-b6445ddeda9b4a608cd34d417f04aa2ee558ef76.tar.gz CMake-b6445ddeda9b4a608cd34d417f04aa2ee558ef76.tar.bz2 |
Help: Add SelectLibraryConfigurations example to cmake-developer(7)
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-developer.7.rst | 18 |
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``, |