-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
91 lines (77 loc) · 1.88 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
cmake_minimum_required(VERSION 3.20)
project(dccs VERSION 0.1.0 LANGUAGES C CXX)
include(FetchContent)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(C_STANDARD 11)
# A few variables that we can set based on how we want to compile everything.
option(VIRTUALIZE_HVLIB "Virtualize the connection to the CAEN HV Wrapper Library (HVLIB)" OFF)
option(TEST_FAKEHV "Check testing of the FakeHV Library" OFF)
if (MSVC)
list(APPEND CMAKE_PREFIX_PATH C:/Qt/6.3.1/msvc2019_64)
elseif(APPLE)
list(APPEND CMAKE_PREFIX_PATH $ENV{HOME}/Qt/6.3.0/macos)
endif()
set(SPDLOG_FMT_EXTERNAL ON)
set(BUILD_SHARED_LIBS OFF)
# Pull any needed libraries before adding subdirectories, so that each of the
# subdirectories can use the libraries.
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG master
)
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.x
)
FetchContent_Declare(
json
URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz
)
FetchContent_MakeAvailable(fmt spdlog json)
find_package(
Qt6
REQUIRED COMPONENTS
Core
Gui
Widgets
SerialPort
)
qt_standard_project_setup()
#[[
qt_add_resources(
dccs
"icons"
PREFIX
"/resources/images"
FILES
link.svg
link-slash.svg
play.svg
stop.svg
)
#]]
add_executable(dccs source/main.cpp)
add_subdirectory(source/psu)
add_subdirectory(source/gui)
add_subdirectory(source/test/manual)
target_include_directories(
dccs
PRIVATE
source
)
target_link_libraries(
dccs
PRIVATE
PSUController
fmt::fmt
spdlog::spdlog
nlohmann_json::nlohmann_json
Qt::Gui
Qt::Core
Qt::Widgets
Qt::SerialPort
)