From d36ec4670770022c0ec8337f6df4de292ca941db Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 25 Feb 2022 18:13:54 +0100 Subject: build: add ctre library dependency --- CMakeLists.txt | 2 +- lib/CMakeLists.txt | 9 +++++++++ lib/ctre/CMakeLists.txt | 4 ++++ src/CMakeLists.txt | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 lib/CMakeLists.txt create mode 100644 lib/ctre/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 920e275..481d035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,5 +7,5 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) project(game-of-life CXX) -# add_subdirectory(lib) +add_subdirectory(lib) add_subdirectory(src) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 0000000..16c32fd --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,9 @@ +include(FetchContent) + +FetchContent_Declare( + ctre + GIT_REPOSITORY "https://github.com/hanickadot/compile-time-regular-expressions" + GIT_TAG v3.5 +) + +add_subdirectory(ctre) diff --git a/lib/ctre/CMakeLists.txt b/lib/ctre/CMakeLists.txt new file mode 100644 index 0000000..1f05163 --- /dev/null +++ b/lib/ctre/CMakeLists.txt @@ -0,0 +1,4 @@ +message(STATUS "Fetching ctre...") + +FetchContent_MakeAvailable(ctre) + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 04f3e02..1e4d106 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,7 +32,8 @@ target_compile_options( -pedantic -fsanitize=address -fno-exceptions ) - target_include_directories(${PROJECT_NAME} PRIVATE .) +target_link_libraries_system(${PROJECT_NAME} ctre) + target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=address) -- cgit v1.2.3-18-g5258