diff options
author | Brad King <brad.king@kitware.com> | 2017-02-28 20:57:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-28 20:57:54 (GMT) |
commit | baed38107eff0da23fc91b18d926fab9a4750f8c (patch) | |
tree | a28360869133a1a61bcd9eca1edb13f613b1e323 /Tests | |
parent | 220b799c8a7ff6039254c90bbeba1890d816b523 (diff) | |
parent | 6f5aede71642b05a351d5cf92e0c884ed9b4fd3c (diff) | |
download | CMake-baed38107eff0da23fc91b18d926fab9a4750f8c.zip CMake-baed38107eff0da23fc91b18d926fab9a4750f8c.tar.gz CMake-baed38107eff0da23fc91b18d926fab9a4750f8c.tar.bz2 |
Merge branch 'find-libarch-not-symlink' into release
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/find_library/LibArchLink-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/LibArchLink.cmake | 24 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/RunCMakeTest.cmake | 3 |
3 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_library/LibArchLink-stderr.txt b/Tests/RunCMake/find_library/LibArchLink-stderr.txt new file mode 100644 index 0000000..139e077 --- /dev/null +++ b/Tests/RunCMake/find_library/LibArchLink-stderr.txt @@ -0,0 +1,2 @@ +TOP_LIBRARY='[^']*/Tests/RunCMake/find_library/LibArchLink-build/lib/libtop.a' +SUB_LIBRARY='[^']*/Tests/RunCMake/find_library/LibArchLink-build/lib/sub/libsub.a' diff --git a/Tests/RunCMake/find_library/LibArchLink.cmake b/Tests/RunCMake/find_library/LibArchLink.cmake new file mode 100644 index 0000000..c91381d --- /dev/null +++ b/Tests/RunCMake/find_library/LibArchLink.cmake @@ -0,0 +1,24 @@ +set(CMAKE_SIZEOF_VOID_P 4) +set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS ON) +list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) + +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink lib ${CMAKE_CURRENT_BINARY_DIR}/lib32) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libtop.a" "top") +find_library(TOP_LIBRARY + NAMES top + PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib + NO_DEFAULT_PATH + ) +message("TOP_LIBRARY='${TOP_LIBRARY}'") + +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/sub) +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink . ${CMAKE_CURRENT_BINARY_DIR}/lib/sub/32) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/sub/libsub.a" "sub") +find_library(SUB_LIBRARY + NAMES sub + PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib/sub + NO_DEFAULT_PATH + ) +message("SUB_LIBRARY='${SUB_LIBRARY}'") diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake index 5733965..e7e8db3 100644 --- a/Tests/RunCMake/find_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake @@ -1,6 +1,9 @@ include(RunCMake) run_cmake(Created) +if(CMAKE_HOST_UNIX) + run_cmake(LibArchLink) +endif() if(WIN32 OR CYGWIN) run_cmake(PrefixInPATH) endif() |