summaryrefslogtreecommitdiff
path: root/ui/CMakeLists.txt
blob: b0f790d0fcf9c52f99744e37c456b47155bf4226 (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
61
62
63
64
65
66
67
68
69
70
# Library

add_library("ui"
  "src/init.cpp"
  "src/widgets/participant_row.cpp"
  "src/widgets/turn_order_view.cpp"
  "src/windows/participant_editor.cpp"
  "src/windows/tracker.cpp"
  "src/windows/tracker/actions.cpp"
  "src/windows/tracker/event_handlers.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

get_target_property(TRANSLATIONS_BINARY_DIR "lang" BINARY_DIR)

add_executable("ui-tests"
  "tests/gtk_test_init.cpp"

  "tests/widgets/participant_row.cpp"
  "tests/windows/participant_editor.cpp"
  "tests/windows/resources.cpp"
  "tests/windows/tracker.cpp"
)

target_compile_definitions("ui-tests" PUBLIC
  "TESTLOCALEDIR=\"${TRANSLATIONS_BINARY_DIR}\""
)

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

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

catch_discover_tests("ui-tests")