diff options
author | Brad King <brad.king@kitware.com> | 2017-03-02 14:26:08 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-03-02 14:26:08 (GMT) |
commit | 6c332bd84ce320e4163130a052af7b9950b38318 (patch) | |
tree | b5d7f78c1d2a9d6a8d6154f8a2111455789316f6 /Tests | |
parent | 5d81817b7168d16190848807d2cfb73ed14b8ee7 (diff) | |
parent | 503f25d490e56dfc1d3dc894e1fc1bd3e7e89e81 (diff) | |
download | CMake-6c332bd84ce320e4163130a052af7b9950b38318.zip CMake-6c332bd84ce320e4163130a052af7b9950b38318.tar.gz CMake-6c332bd84ce320e4163130a052af7b9950b38318.tar.bz2 |
Merge topic 'find_library-custom-lib-suffix'
503f25d4 find_library: Allow custom lib suffix be used as find path
Diffstat (limited to 'Tests')
7 files changed, 14 insertions, 1 deletions
diff --git a/Tests/CMakeOnly/find_library/CMakeLists.txt b/Tests/CMakeOnly/find_library/CMakeLists.txt index 9958650..9c1aad8 100644 --- a/Tests/CMakeOnly/find_library/CMakeLists.txt +++ b/Tests/CMakeOnly/find_library/CMakeLists.txt @@ -24,7 +24,7 @@ endmacro() macro(test_find_library_subst expected) get_filename_component(dir ${expected} PATH) get_filename_component(name ${expected} NAME) - string(REGEX REPLACE "lib/?64" "lib" dir "${dir}") + string(REGEX REPLACE "lib/?[36X][24Y][Z]*" "lib" dir "${dir}") test_find_library(", searched as ${dir}" "${expected}" NAMES ${name} PATHS ${CMAKE_CURRENT_SOURCE_DIR}/${dir} @@ -79,3 +79,16 @@ test_find_library("" A/libtestA.a NAMES testB testA NAMES_PER_DIR PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B ) + +set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX "XYZ") +foreach(libXYZ + lib/XYZ/libtest1.a + lib/A/libXYZ/libtest2.a + lib/libtest3.a + libXYZ/A/lib/libtest4.a + libXYZ/A/libXYZ/libtest5.a + libXYZ/A/libtest6.a + libXYZ/libtest7.a + ) + test_find_library_subst(${libXYZ}) +endforeach() diff --git a/Tests/CMakeOnly/find_library/lib/A/libXYZ/libtest2.a b/Tests/CMakeOnly/find_library/lib/A/libXYZ/libtest2.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/A/libXYZ/libtest2.a diff --git a/Tests/CMakeOnly/find_library/lib/XYZ/libtest1.a b/Tests/CMakeOnly/find_library/lib/XYZ/libtest1.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/XYZ/libtest1.a diff --git a/Tests/CMakeOnly/find_library/libXYZ/A/lib/libtest4.a b/Tests/CMakeOnly/find_library/libXYZ/A/lib/libtest4.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CMakeOnly/find_library/libXYZ/A/lib/libtest4.a diff --git a/Tests/CMakeOnly/find_library/libXYZ/A/libXYZ/libtest5.a b/Tests/CMakeOnly/find_library/libXYZ/A/libXYZ/libtest5.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CMakeOnly/find_library/libXYZ/A/libXYZ/libtest5.a diff --git a/Tests/CMakeOnly/find_library/libXYZ/A/libtest6.a b/Tests/CMakeOnly/find_library/libXYZ/A/libtest6.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CMakeOnly/find_library/libXYZ/A/libtest6.a diff --git a/Tests/CMakeOnly/find_library/libXYZ/libtest7.a b/Tests/CMakeOnly/find_library/libXYZ/libtest7.a new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/CMakeOnly/find_library/libXYZ/libtest7.a |