-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
73 lines (62 loc) · 1.95 KB
/
CMakeLists.txt
File metadata and controls
73 lines (62 loc) · 1.95 KB
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
cmake_minimum_required(VERSION 3.14)
project(extended_range_arithmetic)
# GoogleTest requires at least C++23
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.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()
endif()
ADD_LIBRARY(extended_range_arithmetic_module
${PROJECT_SOURCE_DIR}/src/extended_range_arithmetic/FloatExp2Int64/FloatExp2Int64.cpp
${PROJECT_SOURCE_DIR}/src/extended_range_arithmetic/WideRangeNumber64/WideRangeNumber64.cpp
${PROJECT_SOURCE_DIR}/src/extended_range_arithmetic/Xnumber64/Xnumber64.cpp
${PROJECT_SOURCE_DIR}/src/extended_range_arithmetic/IntExp2Int64/IntExp2Int64.cpp
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_executable(
FloatExp2Int64.test
${PROJECT_SOURCE_DIR}/src/extended_range_arithmetic/FloatExp2Int64/FloatExp2Int64.test.cpp
)
target_link_libraries(
FloatExp2Int64.test
extended_range_arithmetic_module
)
target_link_libraries(
FloatExp2Int64.test
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(FloatExp2Int64.test)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_executable(
IntExp2Int64.test
${PROJECT_SOURCE_DIR}/src/extended_range_arithmetic/IntExp2Int64/IntExp2Int64.test.cpp
)
target_link_libraries(
IntExp2Int64.test
extended_range_arithmetic_module
)
target_link_libraries(
IntExp2Int64.test
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(IntExp2Int64.test)
endif()
add_executable(
PerformanceTest-ArraySize
${PROJECT_SOURCE_DIR}/src/PerformanceTest-ArraySize.cpp
)
target_link_libraries(
PerformanceTest-ArraySize
extended_range_arithmetic_module
)