[cmake-commits] alex committed CMakeLists.txt 1.3 1.4

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 26 09:55:42 EDT 2007


Update of /cvsroot/CMake/CMake/Tests/FindPackageTest
In directory public:/mounts/ram/cvs-serv8459/Tests/FindPackageTest

Modified Files:
	CMakeLists.txt 
Log Message:
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


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/FindPackageTest/CMakeLists.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CMakeLists.txt	8 Aug 2007 17:05:27 -0000	1.3
+++ CMakeLists.txt	26 Oct 2007 13:55:40 -0000	1.4
@@ -10,3 +10,15 @@
 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)
+



More information about the Cmake-commits mailing list