-
Notifications
You must be signed in to change notification settings - Fork 5
/
gwenhywfar-config.cmake.in
82 lines (70 loc) · 2.91 KB
/
gwenhywfar-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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Macros cmake's CONFIGURE_PACKAGE_CONFIG_FILE() would create
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
message( WARNING "${_name} required component \"${comp}\" not found")
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
set_and_check(prefix "@prefix@")
set_and_check(exec_prefix "@exec_prefix@")
set_and_check(includedir "@includedir@")
set_and_check(GWENHYWFAR_INCLUDE_DIRS "@gwenhywfar_headerdir@")
if(WIN32)
set_and_check(GWENHYWFAR_LIBRARIES "@libdir@/libgwenhywfar.dll.a")
elseif(APPLE)
set_and_check(GWENHYWFAR_LIBRARIES "@libdir@/libgwenhywfar.@[email protected]")
else()
set_and_check(GWENHYWFAR_LIBRARIES "@libdir@/libgwenhywfar.so.@GWENHYWFAR_SO_EFFECTIVE@")
endif()
set(GWENHYWFAR_FOUND TRUE)
# find components
# Only for backwards compatibility. It is recommended to use
# find_package(gwengui-cpp) or
# find_package(gwengui-qt4)
list(FIND GWENHYWFAR_FIND_COMPONENTS "cpp" FIND_GWEN_COMPONENT_CPP)
if ( NOT ${FIND_GWEN_COMPONENT_CPP} EQUAL -1 )
find_package(gwengui-cpp "@GWENHYWFAR_VERSION_STRING@" EXACT)
if (gwengui-cpp_FOUND)
set( GWENHYWFAR_INCLUDE_DIRS ${GWENHYWFAR_INCLUDE_DIRS} ${GWENGUI_CPP_INCLUDE_DIRS} )
set( GWENHYWFAR_LIBRARIES ${GWENHYWFAR_LIBRARIES} ${GWENGUI_CPP_LIBRARIES} )
set( GWENHYWFAR_cpp_FOUND true )
endif()
endif()
list(FIND GWENHYWFAR_FIND_COMPONENTS "qt4" FIND_GWEN_COMPONENT_QT4)
if ( NOT ${FIND_GWEN_COMPONENT_QT4} EQUAL -1 )
find_package(gwengui-qt4 "@GWENHYWFAR_VERSION_STRING@" EXACT)
if ( gwengui-qt4_FOUND )
set( GWENHYWFAR_INCLUDE_DIRS ${GWENHYWFAR_INCLUDE_DIRS} ${gwengui-qt4_INCLUDE_DIRS} )
set( GWENHYWFAR_LIBRARIES ${GWENHYWFAR_LIBRARIES} ${gwengui-qt4_LIBRARIES} )
set( GWENHYWFAR_qt4_FOUND true )
endif()
endif()
list(FIND GWENHYWFAR_FIND_COMPONENTS "qt5" FIND_GWEN_COMPONENT_QT4)
if ( NOT ${FIND_GWEN_COMPONENT_QT5} EQUAL -1 )
find_package(gwengui-qt5 "@GWENHYWFAR_VERSION_STRING@" EXACT)
if ( gwengui-qt5_FOUND )
set( GWENHYWFAR_INCLUDE_DIRS ${GWENHYWFAR_INCLUDE_DIRS} ${gwengui-qt5_INCLUDE_DIRS} )
set( GWENHYWFAR_LIBRARIES ${GWENHYWFAR_LIBRARIES} ${gwengui-qt5_LIBRARIES} )
set( GWENHYWFAR_qt5_FOUND true )
endif()
endif()
check_required_components(GWENHYWFAR)
# The target is available since gwenhywfar 4.15.3
if(GWENHYWFAR_FOUND AND NOT TARGET gwenhywfar::core)
add_library(gwenhywfar::core UNKNOWN IMPORTED)
set_target_properties(gwenhywfar::core PROPERTIES
IMPORTED_LOCATION "${GWENHYWFAR_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${GWENHYWFAR_INCLUDE_DIRS}"
)
endif()
mark_as_advanced( GWENHYWFAR_INCLUDE_DIRS GWENHYWFAR_LIBRARIES )