-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.cmake.in
52 lines (42 loc) · 1.31 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
49
50
51
52
#https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-a-package-configuration-file
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
set(QtLab_INCLUDE_DIR @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@)
set(_supported_components
Core
IO
Hamamatsu
NI
PI
PI-Widgets
Serial
Serial-Widgets
ThorlabsMC
Widgets
)
foreach(_comp ${_supported_components})
if (";${QtLab_FIND_COMPONENTS};" MATCHES ${_comp})
include("${CMAKE_CURRENT_LIST_DIR}/${_comp}Targets.cmake"
RESULT_VARIABLE QtLab_${_comp}_FOUND)
endif()
endforeach()
if(";${QtLab_FIND_COMPONENTS};" MATCHES Widgets)
find_dependency(Qt5 REQUIRED Widgets)
endif()
if(";${QtLab_FIND_COMPONENTS};" MATCHES Serial)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS SerialPort)
endif()
set(QtLab_FOUND True)
foreach(_comp ${QtLab_FIND_COMPONENTS})
if (NOT ";${_supported_components};" MATCHES ${_comp})
set(QtLab_FOUND False)
message(STATUS "Unsupported component: ${_comp}")
set(QtLab_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
endif()
endforeach()
check_required_components(QtLab)
if(NOT ${QtLab_FOUND})
message(STATUS "Could not locate QtLab")
endif()