2003-07-24 19:33:06 +04:00
|
|
|
PROJECT(FindPackageTest)
|
|
|
|
|
|
|
|
# Look for a package that has a find module and may be found.
|
|
|
|
FIND_PACKAGE(OpenGL QUIET)
|
|
|
|
|
|
|
|
# Look for a package that has no find module and will not be found.
|
2007-08-08 21:05:27 +04:00
|
|
|
FIND_PACKAGE(NotAPackage QUIET)
|
2003-07-24 19:33:06 +04:00
|
|
|
|
|
|
|
# Look for a package that has an advanced find module.
|
|
|
|
FIND_PACKAGE(VTK QUIET)
|
|
|
|
|
|
|
|
ADD_EXECUTABLE(FindPackageTest FindPackageTest.cxx)
|
2007-10-26 17:55:40 +04:00
|
|
|
|
2007-12-19 19:06:47 +03:00
|
|
|
# test behaviour of cmFindBase wrt. the CMAKE_PREFIX_PATH variable
|
2007-10-26 17:55:40 +04:00
|
|
|
# foo.h should be found in ${CMAKE_CURRENT_SOURCE_DIR}/include:
|
|
|
|
|
2007-12-19 19:06:47 +03:00
|
|
|
SET(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}")
|
2007-10-26 17:55:40 +04:00
|
|
|
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
|
2007-12-19 19:06:47 +03:00
|
|
|
CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
|
2007-10-26 17:55:40 +04:00
|
|
|
ENDIF(NOT FOO_DIR)
|
|
|
|
|