-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
43 lines (37 loc) · 1.12 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
cmake_minimum_required(VERSION 3.28)
project(buffalo VERSION 1.0.3)
set(CMAKE_CXX_STANDARD 23)
# External Libs
include(FetchContent)
FetchContent_Declare(
ctre
GIT_REPOSITORY https://github.com/hanickadot/compile-time-regular-expressions.git
GIT_TAG v3.9.0
)
FetchContent_MakeAvailable(ctre)
# Buffalo
add_library(buffalo INTERFACE
include/buffalo/buffalo.h
)
target_include_directories(buffalo INTERFACE include)
target_link_libraries(buffalo INTERFACE ctre::ctre)
# Tests
option(BUFFALO_ENABLE_TESTS "Include googletest and enable test target" ON)
if(BUFFALO_ENABLE_TESTS)
FetchContent_Declare(
GTEST
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main
)
FetchContent_MakeAvailable(GTEST)
add_executable(buffalo-test
test/buffalo.test.cpp
)
target_link_libraries(buffalo-test PRIVATE buffalo GTest::gtest_main)
target_include_directories(buffalo-test PRIVATE include)
endif()
# Examples
add_executable(example-calculator
examples/calculator.cpp
)
target_link_libraries(example-calculator PRIVATE buffalo)