summaryrefslogtreecommitdiff
path: root/res/CMakeLists.txt
blob: dd5b139e78c63a687792780ba857de711e00d31b (plain)
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
# Library

add_library("res")

target_add_glib_resources("res"
  PREFIX "ch/arknet/Turns"
  UI_FILES
  "widgets/participant_list_row.ui"
  "windows/create_participant.ui"
  "windows/main_window.ui"
  CSS_FILES
  "style.css"
  "style-dark.css"
)

target_compile_options("res" PRIVATE
  "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:-fprofile-arcs>"
  "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:-ftest-coverage>"
)

target_link_libraries("res" PUBLIC
  "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:gcov>"

  "PkgConfig::adwaita"
  "PkgConfig::gtkmm"
)

target_link_options("res" PRIVATE
  "$<$<AND:$<CXX_COMPILER_ID:GNU,Clang>,$<CONFIG:Debug>>:--coverage>"
)

add_library("turns::res" ALIAS "res")

# Tests

add_executable("res-tests"
  "tests/windows.cpp"
)

target_link_libraries("res-tests" PRIVATE
  "Catch2::Catch2"
  
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,--whole-archive>"
  "turns::res"
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,--no-whole-archive>"
  "turns::gtk-test-main"
)

catch_discover_tests("res-tests")