summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageTest
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-10-26 13:55:40 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-10-26 13:55:40 (GMT)
commit0398d8ad38c5a00aba7286fd511c15bad55f2987 (patch)
tree71a2886e9fd9f9ca732d10eae5b7956e621e387a /Tests/FindPackageTest
parent480b97a8e2f825f31e378025bce666d5bafc45ca (diff)
downloadCMake-0398d8ad38c5a00aba7286fd511c15bad55f2987.zip
CMake-0398d8ad38c5a00aba7286fd511c15bad55f2987.tar.gz
CMake-0398d8ad38c5a00aba7286fd511c15bad55f2987.tar.bz2
ENH: add support for CMAKE_FIND_PREFIX_PATH as discussed with Brad.
CMAKE_FIND_PREFIX_PATH is both an environment variable and a cmake variable, which is a list of base directories where FIND_PATH, FIND_FILE, FIND_PROGRAM and FIND_LIBRARY will search in the respective subdirectories Alex
Diffstat (limited to 'Tests/FindPackageTest')
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt12
-rw-r--r--Tests/FindPackageTest/include/foo.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 6f1a7e5..a58408c 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -10,3 +10,15 @@ FIND_PACKAGE(NotAPackage QUIET)
FIND_PACKAGE(VTK QUIET)
ADD_EXECUTABLE(FindPackageTest FindPackageTest.cxx)
+
+# test behaviour of cmFindBase wrt. the CMAKE_FIND_PREFIX_PATH variable
+# foo.h should be found in ${CMAKE_CURRENT_SOURCE_DIR}/include:
+
+SET(CMAKE_FIND_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}")
+FIND_PATH(FOO_DIR foo.h)
+
+IF(NOT FOO_DIR)
+ MESSAGE(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include
+ CMAKE_FIND_PREFIX_PATH = ${CMAKE_FIND_PREFIX_PATH}")
+ENDIF(NOT FOO_DIR)
+
diff --git a/Tests/FindPackageTest/include/foo.h b/Tests/FindPackageTest/include/foo.h
new file mode 100644
index 0000000..2392aee
--- /dev/null
+++ b/Tests/FindPackageTest/include/foo.h
@@ -0,0 +1 @@
+/* empty header file */