Jelajahi Sumber

ENH: Test find_package re-find feature

Recently we taught find_package to re-find a package if its
<package>_DIR result variable was set to a location not containing the
package (instead of reporting an error as before).  This tests the
feature.
Brad King 17 tahun lalu
induk
melakukan
bb2c08546c
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 3 0
      Tests/FindPackageTest/CMakeLists.txt

+ 3 - 0
Tests/FindPackageTest/CMakeLists.txt

@@ -49,6 +49,9 @@ ENDFOREACH(p)
 SET(CMAKE_FIND_FRAMEWORK LAST)
 SET(CMAKE_FIND_APPBUNDLE FIRST)
 
+# Set the wrong answer for a find to make sure it re-finds.
+set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0)
+
 # Look for packages with new-style signatures.
 FIND_PACKAGE(foo NO_MODULE)
 FIND_PACKAGE(Foo CONFIGS FooConfig.cmake)