Skip to content

Commit

Permalink
Clean up CMAKE
Browse files Browse the repository at this point in the history
  • Loading branch information
mleleszi committed Jun 14, 2024
1 parent 4938798 commit 8890bf8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
13 changes: 2 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

18 changes: 18 additions & 0 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
1 change: 0 additions & 1 deletion src/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "redis_type.h"


// TODO: log req/resp
RedisType::RedisValue Controller::handleCommand(const std::vector<RedisType::BulkString> &command) {
if (command.empty()) { return RedisType::SimpleError("ERR empty command"); }

Expand Down
10 changes: 0 additions & 10 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit 8890bf8

Please sign in to comment.