diff --git a/CMakeLists.txt b/CMakeLists.txt index fc6bd09..15c8403 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,9 @@ cmake_minimum_required(VERSION 3.27) project(cpp_redis) -set(CMAKE_CXX_STANDARD 20) - -include(FetchContent) - -# TODO: create separate CMAKE for dependencies -FetchContent_Declare( - spdlog - GIT_REPOSITORY https://github.com/gabime/spdlog.git - GIT_TAG v1.14.1 -) -FetchContent_MakeAvailable(spdlog) +set(CMAKE_CXX_STANDARD 23) +add_subdirectory(dependencies) add_subdirectory(src) add_subdirectory(tests) diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt new file mode 100644 index 0000000..69c9fc1 --- /dev/null +++ b/dependencies/CMakeLists.txt @@ -0,0 +1,18 @@ +include(FetchContent) + +# GoogleTest +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG v1.14.0 +) + +FetchContent_MakeAvailable(googletest) + +# spdlog +FetchContent_Declare( + spdlog + GIT_REPOSITORY https://github.com/gabime/spdlog.git + GIT_TAG v1.14.1 +) +FetchContent_MakeAvailable(spdlog) \ No newline at end of file diff --git a/src/controller.cpp b/src/controller.cpp index c69f40e..f2dd510 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -8,7 +8,6 @@ #include "redis_type.h" -// TODO: log req/resp RedisType::RedisValue Controller::handleCommand(const std::vector &command) { if (command.empty()) { return RedisType::SimpleError("ERR empty command"); } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 051f52f..498a062 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,13 +1,3 @@ -include(FetchContent) - -FetchContent_Declare( - googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG v1.14.0 -) - -FetchContent_MakeAvailable(googletest) - add_library(GTest::GTest INTERFACE IMPORTED) target_link_libraries(GTest::GTest INTERFACE gtest_main)