This repository has been archived by the owner on Jul 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
81 lines (59 loc) · 2.08 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
cmake_minimum_required(VERSION 3.15)
project(Procdraw)
enable_testing()
set(CMAKE_CXX_STANDARD 17)
add_compile_definitions(UNICODE _UNICODE PLOG_OMIT_LOG_DEFINES)
# Dependencies
find_package(Catch2 REQUIRED)
find_path(PLOG_INCLUDE_DIR plog/Log.h)
find_package(pugixml REQUIRED)
find_path(WIL_INCLUDE_DIR wil/com.h)
# procdraw_lib
add_library(procdraw_lib
src/lib/Colour.cpp
src/lib/D3D11Graphics.cpp
src/lib/Interpreter.cpp
src/lib/Printer.cpp
src/lib/ProcdrawApp.cpp
src/lib/ProcdrawMath.cpp
src/lib/Reader.cpp
src/lib/WinUtils.cpp)
target_include_directories(procdraw_lib
PUBLIC ${WIL_INCLUDE_DIR})
# procdraw executable
add_executable(procdraw WIN32
src/winmain/WinMain.cpp)
target_link_libraries(procdraw
procdraw_lib
d3d11.lib
D3DCompiler.lib)
target_include_directories(procdraw
PRIVATE ${PLOG_INCLUDE_DIR})
# Tests
get_filename_component(PROCDRAW_TEST_DATA_DIR "${PROJECT_SOURCE_DIR}/src/tests/test_data" ABSOLUTE)
get_filename_component(PROCDRAW_DOCS_FILE "${PROJECT_SOURCE_DIR}/docs/docs.xml" ABSOLUTE)
add_definitions(-DPROCDRAW_TEST_DATA_DIR="${PROCDRAW_TEST_DATA_DIR}")
add_definitions(-DPROCDRAW_DOCS_FILE="${PROCDRAW_DOCS_FILE}")
add_executable(procdraw_tests
src/tests/ColourTests.cpp
src/tests/DocsTester.cpp
src/tests/DocsTesterTests.cpp
src/tests/FunctionDocsTests.cpp
src/tests/InterpreterReadTests.cpp
src/tests/InterpreterPrintTests.cpp
src/tests/InterpreterTests.cpp
src/tests/InterpreterTypesTests.cpp
src/tests/ProcdrawDocs.cpp
src/tests/ProcdrawMathTests.cpp
src/tests/TestsMain.cpp)
target_link_libraries(procdraw_tests
procdraw_lib
Catch2::Catch2
pugixml)
# Register CTest tests
add_test(NAME validate-xml
COMMAND invoke validate-xml)
add_test(NAME check-file-headers
COMMAND invoke check-file-headers)
add_test(NAME procdraw_tests
COMMAND procdraw_tests)