summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_package/SetFoundResolved.cmake
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2019-01-15 20:12:32 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-16 14:59:46 (GMT)
commitb773e58099b2fc8ebdf8319172fb018d0139396d (patch)
tree1805666c4f186e22becc8ac40284828cfc2cd6ca /Tests/RunCMake/find_package/SetFoundResolved.cmake
parenta5e948a36f5d1c1cf6a0ea34b04bbc4b6058e7d9 (diff)
downloadCMake-b773e58099b2fc8ebdf8319172fb018d0139396d.zip
CMake-b773e58099b2fc8ebdf8319172fb018d0139396d.tar.gz
CMake-b773e58099b2fc8ebdf8319172fb018d0139396d.tar.bz2
find_package: add test coverage for CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
Diffstat (limited to 'Tests/RunCMake/find_package/SetFoundResolved.cmake')
-rw-r--r--Tests/RunCMake/find_package/SetFoundResolved.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_package/SetFoundResolved.cmake b/Tests/RunCMake/find_package/SetFoundResolved.cmake
new file mode 100644
index 0000000..8d56513
--- /dev/null
+++ b/Tests/RunCMake/find_package/SetFoundResolved.cmake
@@ -0,0 +1,17 @@
+# Create ./symlink pointing back here.
+execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+ PackageRoot "${CMAKE_CURRENT_SOURCE_DIR}/symlink")
+
+# Make find_package search through the symlink.
+set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/symlink")
+
+# Test preservation of symlinks.
+find_package(Resolved)
+message(WARNING "${Resolved_DIR}")
+
+# Test resolving symlinks.
+set(CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS ON)
+find_package(Resolved)
+message(WARNING "${Resolved_DIR}")
+
+file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/symlink")