1 #! Wraps a find_package call by forwarding QUIET and REQUIRED arguments
2 #! from within the MITKConfig.cmake file.
4 #! mitkMacroFindDependency(<dep> [args])
8 set(_mitk_fd_dep ${dep})
10 message(FATAL_ERROR
"Missing argument.")
13 string(TOUPPER "${_mitk_fd_dep}
" _mitk_fd_dep_uc)
15 if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
16 set(_mitk_fd_quiet_arg QUIET)
18 set(_mitk_fd_required_arg)
19 if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
20 set(_mitk_fd_required_arg REQUIRED)
23 get_property(_mitk_fd_is_transitive GLOBAL PROPERTY
24 _CMAKE_${_mitk_fd_dep}_TRANSITIVE_DEPENDENCY
27 # Prefer config mode first because it finds external
28 # <proj>Config.cmake files pointed at by <proj>_DIR variables.
29 # Otherwise, existing Find<proj>.cmake files could fail.
30 # (e.g. in the case of GLEW and the FindGLEW.cmake file shipped
32 find_package(${_mitk_fd_dep} ${ARGN}
36 if(NOT (${_mitk_fd_dep}_FOUND OR ${_mitk_fd_dep_uc}_FOUND))
37 find_package(${_mitk_fd_dep} ${ARGN}
39 ${cmake_fd_required_arg}
43 if(NOT DEFINED _mitk_fd_is_transitive OR _mitk_fd_is_transitive)
44 set_property(GLOBAL PROPERTY _CMAKE_${_mitk_fd_dep}_TRANSITIVE_DEPENDENCY TRUE)
47 if (NOT (${_mitk_fd_dep}_FOUND OR ${_mitk_fd_dep_uc}_FOUND))
48 set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency ${_mitk_fd_dep} could not be found.
")
49 set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
52 set(_mitk_fd_required_arg)
53 set(_mitk_fd_quiet_arg)
mitkMacroFindDependency(dep)