-
Notifications
You must be signed in to change notification settings - Fork 18
/
Config.cmake.in
48 lines (40 loc) · 1.63 KB
/
Config.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
# Modeled after CMake's find_dependency macro, but for pkg-config
macro(find_pkg_config_dependency PREFIX IMPORTED_TARGET MODULE_SPEC)
find_dependency(PkgConfig)
if(NOT PkgConfig_FOUND)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because pkg-config could not be found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
return()
endif()
set(_ARG_QUIET)
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
set(_ARG_QUIET QUIET)
endif()
set(_ARG_REQUIRED)
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
set(_ARG_REQUIRED REQUIRED)
endif()
set(_ARG_IMPORTED_TARGET)
if(${IMPORTED_TARGET})
if(${CMAKE_VERSION} VERSION_LESS "3.6")
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because CMake >= 3.6 is required to import pkg-config dependencies.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
return()
endif()
set(_ARG_IMPORTED_TARGET IMPORTED_TARGET)
endif()
pkg_search_module(${PREFIX} ${_ARG_REQUIRED} ${_ARG_QUIET} ${_ARG_IMPORTED_TARGET} ${MODULE_SPEC})
if(NOT ${PREFIX}_FOUND)
set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because pkg-config dependency ${MODULE_SPEC} could not be found.")
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
return()
endif()
set(_ARG_QUIET)
set(_ARG_REQUIRED)
set(_ARG_IMPORTED_TARGET)
endmacro()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules")
@CONFIG_FIND_DEPENDENCIES@
include(${CMAKE_CURRENT_LIST_DIR}/@CONFIG_TARGETS_FILE@)