-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
74 lines (58 loc) · 1.77 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.1.0)
project(QtLab)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
message(STATUS "Custom include directories: ${INCLUDE_DIRS}")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options("/std:c++latest")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
else()
set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(OTHER_FILES
.gitignore
.clang-format
LICENSE.txt
README.md
)
add_custom_target(project-related-files SOURCES ${OTHER_FILES})
include(GNUInstallDirs)
option(BUILD_WIDGETS "Build widgets" ON)
option(QTLAB_DEMO "Demo mode" OFF)
add_subdirectory(qtlab/core)
add_subdirectory(qtlab/io)
add_subdirectory(qtlab/hw/hamamatsu)
add_subdirectory(qtlab/hw/ni)
add_subdirectory(qtlab/hw/pi)
add_subdirectory(qtlab/hw/serial)
if (UNIX)
add_subdirectory(qtlab/hw/thorlabs-mc)
endif(UNIX)
if(BUILD_WIDGETS)
add_subdirectory(qtlab/widgets)
add_subdirectory(qtlab/hw/pi-widgets)
add_subdirectory(qtlab/hw/serial-widgets)
endif()
add_subdirectory(docker)
include(CMakePackageConfigHelpers)
configure_package_config_file(
"Config.cmake.in"
"QtLabConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/QtLab
PATH_VARS
CMAKE_INSTALL_LIBDIR
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/QtLabConfigVersion.cmake
VERSION 0.0.1
COMPATIBILITY SameMajorVersion
)
### Install Config and ConfigVersion files
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/QtLabConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/QtLabConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/QtLab"
)