-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (38 loc) · 1.04 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
cmake_minimum_required(VERSION 3.10)
project(
PTPE
VERSION 0.1
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 20)
set(PTPE_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)
set(
PTPE_SOURCE
${PROJECT_SOURCE_DIR}/src/components/time.cpp
${PROJECT_SOURCE_DIR}/src/helpers/fixed_endian_typed.cpp
)
add_compile_options(-Wall -Wextra -fno-rtti)
add_library(PTPe STATIC ${PTPE_SOURCE})
target_include_directories(PTPe PUBLIC ${PTPE_INCLUDE_DIR})
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.13.0.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(
PTPeTest
${PROJECT_SOURCE_DIR}/tests/instance_test.cpp
${PROJECT_SOURCE_DIR}/tests/messages_test.cpp
${PROJECT_SOURCE_DIR}/tests/time_test.cpp
)
target_link_libraries(
PTPeTest
GTest::gtest_main
PTPe
)
include(GoogleTest)
gtest_discover_tests(PTPeTest)