summaryrefslogtreecommitdiff
path: root/ui/CMakeLists.txt
blob: e3d8941a69d2745685e80a7d1a9f2089fc53c246 (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
50
51
52
53
54
55
56
57
58
59
60
# Library

add_library("ui"
  "src/widgets/participant_row.cpp"
  "src/widgets/turn_order_view.cpp"
  "src/windows/participant_editor.cpp"
  "src/windows/tracker.cpp"

  $<TARGET_OBJECTS:ui-res>
)

add_library("turns::ui" ALIAS "ui")

target_compile_options("ui" PUBLIC
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wall>"
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wextra>"
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-Werror>"
  "$<$<CXX_COMPILER_ID:GNU,Clang>:-pedantic-errors>"
)

target_include_directories("ui" PUBLIC
  "include"
)

target_link_libraries("ui" PUBLIC
  "turns::core"
  "turns::lang"
  "PkgConfig::adwaita"
  "PkgConfig::gtkmm"
)

enable_coverage("ui")

# Resources

add_subdirectory("res")

# Tests

add_executable("ui-tests"
  "tests/widgets/participant_row.cpp"
  "tests/windows/participant_editor.cpp"
  "tests/windows/resources.cpp"
  "tests/windows/tracker.cpp"
)

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

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

catch_discover_tests("ui-tests")