-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
58 lines (41 loc) · 1.17 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
cmake_minimum_required(VERSION 3.19)
# Basic project configuration
project("Calculator"
LANGUAGES CXX
)
# Set c++ language standard to C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") # works
#[===[ LIBRARY ]===]
add_library("CalcLib" STATIC
"lib/Calc.cpp"
"lib/Pocketcalculator.cpp"
"lib/Sevensegment.cpp"
)
target_include_directories("CalcLib" PUBLIC
"lib"
)
# Specify library "CuteFramework"
# It is a header-only library, featuring no object files
add_library("CuteFramework" INTERFACE)
find_package(PkgConfig REQUIRED)
pkg_check_modules(gtkmm REQUIRED IMPORTED_TARGET gtk4 gtkmm-4.0 glibmm-2.68)
# Set the include directory paths for "CuteFramework"
# INTERFACE enables dependent targets to also use that include path
target_include_directories("CuteFramework" INTERFACE "CUTE")
#[===[ TESTS ]===]
add_executable("CalcTest"
"test/calc_test.cpp"
)
target_link_libraries("CalcTest" PRIVATE
"CalcLib"
"CuteFramework"
)
add_test(NAME "CalcTest" COMMAND "CalcTest")
#[===[ APPLICATION ]===]
add_executable("Calculator"
"app/main.cpp"
)
target_link_libraries("Calculator" PRIVATE
"CalcLib" PUBLIC PkgConfig::gtkmm
)