diff options
author | Christian Schmidbauer <ch.schmidbauer@gmail.com> | 2017-02-25 18:47:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-01 14:49:42 (GMT) |
commit | 503f25d490e56dfc1d3dc894e1fc1bd3e7e89e81 (patch) | |
tree | c5e35271ce09ec7fba4fcef5d176ed17676470e9 /Help | |
parent | 78104bd7bca4bd9b4b7a5c17622838a33843138e (diff) | |
download | CMake-503f25d490e56dfc1d3dc894e1fc1bd3e7e89e81.zip CMake-503f25d490e56dfc1d3dc894e1fc1bd3e7e89e81.tar.gz CMake-503f25d490e56dfc1d3dc894e1fc1bd3e7e89e81.tar.bz2 |
find_library: Allow custom lib suffix be used as find path
Add a new `CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable to allow use
of a custom suffix on `lib` directory names. This is a more general
option than that added by commit v3.7.0-rc1~504^2 (Teach find_library
and find_package to search lib32 paths, 2016-06-10). It allows the find
path to be more deterministic on custom setups.
See discussion in #10287 and #15994.
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/find_library.rst | 7 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst | 2 | ||||
-rw-r--r-- | Help/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS.rst | 2 | ||||
-rw-r--r-- | Help/release/dev/find_library-custom-lib-suffix.rst | 6 | ||||
-rw-r--r-- | Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst | 11 |
6 files changed, 29 insertions, 0 deletions
diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst index 1eb50f7..e912040 100644 --- a/Help/command/find_library.rst +++ b/Help/command/find_library.rst @@ -49,6 +49,13 @@ path to the framework ``<fullPath>/A.framework``. When a full path to a framework is used as a library, CMake will use a ``-framework A``, and a ``-F<fullPath>`` to link the framework to the target. +If the :variable:`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable is set all +search paths will be tested as normal, with the suffix appended, and with +all matches of ``lib/`` replaced with +``lib${CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX}/``. This variable overrides +the :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS` +and :prop_gbl:`FIND_LIBRARY_USE_LIB64_PATHS` global properties. + If the :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS` global property is set all search paths will be tested as normal, with ``32/`` appended, and with all matches of ``lib/`` replaced with ``lib32/``. This property is diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 259d87b..a25efe7 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -130,6 +130,7 @@ Variables that Change Behavior /variable/CMAKE_SYSROOT /variable/CMAKE_FIND_APPBUNDLE /variable/CMAKE_FIND_FRAMEWORK + /variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX /variable/CMAKE_FIND_LIBRARY_PREFIXES /variable/CMAKE_FIND_LIBRARY_SUFFIXES /variable/CMAKE_FIND_NO_INSTALL_PREFIX diff --git a/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst b/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst index ce18b65..8396026 100644 --- a/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst +++ b/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst @@ -8,3 +8,5 @@ Whether the :command:`find_library` command should automatically search :command:`find_library` command should automatically search the ``lib32`` variant of directories called ``lib`` in the search path when building 32-bit binaries. + +See also the :variable:`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable. diff --git a/Help/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS.rst b/Help/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS.rst index e52f8eb..ed343ba 100644 --- a/Help/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS.rst +++ b/Help/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS.rst @@ -8,3 +8,5 @@ FIND_LIBRARY_USE_LIB64_PATHS is a boolean specifying whether the :command:`find_library` command should automatically search the lib64 variant of directories called lib in the search path when building 64-bit binaries. + +See also the :variable:`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable. diff --git a/Help/release/dev/find_library-custom-lib-suffix.rst b/Help/release/dev/find_library-custom-lib-suffix.rst new file mode 100644 index 0000000..824b27e --- /dev/null +++ b/Help/release/dev/find_library-custom-lib-suffix.rst @@ -0,0 +1,6 @@ +find_library-custom-lib-suffix +------------------------------ + +* A :variable:`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable was added to + tell the :command:`find_library` command to search in a ``lib<suffix>`` + directory before each ``lib`` directory that would normally be searched. diff --git a/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst b/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst new file mode 100644 index 0000000..f7c6524 --- /dev/null +++ b/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst @@ -0,0 +1,11 @@ +CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX +------------------------------------ + +Specify a ``<suffix>`` to tell the :command:`find_library` command to +search in a ``lib<suffix>`` directory before each ``lib`` directory that +would normally be searched. + +This overrides the behavior of related global properties: + +* :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS` +* :prop_gbl:`FIND_LIBRARY_USE_LIB64_PATHS` |