-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 969 Bytes
/
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
cmake_minimum_required(VERSION 3.11)
project(BigFloat
VERSION 1.0.0
DESCRIPTION "Library that implements fixed point numbers"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-O0 -g")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_CXX_FLAGS "-Ofast -pthread")
else()
message("Unknown build type")
endif()
#Just build the library target
add_library(BigFloat BigFloat.cpp BigFloat.h)
option(TESTS_ENABLE "Enable tests" ON)
if (TESTS_ENABLE)
#Test target
Include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.4.0 # or a later release
)
FetchContent_MakeAvailable(Catch2)
add_executable(tests tests.cpp BigFloat)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)
endif()
#Calc Pi tagret
add_executable(CalcPi main.cpp BigFloat)