-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
34 lines (26 loc) · 2.83 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
project(MUD-Server)
#cmake_minimum_required(VERSION 3.24)
find_library(
LIBHIREDIS
NAMES libhiredis.so
HINTS ../
REQUIRED)
ADD_EXECUTABLE(server server/Server.cpp server/main.cpp server/utils/JsonParser.cpp server/logger/BasicLogger.cpp server/interface/IDataRepository.h server/EventHandler/ProcessRequestHandler.cpp server/interface/IController.h server/interface/ILogger.h server/interface/IRequestHandler.h server/controller/BasicController.cpp server/header/BasicController.h server/interface/IRequestDTO.h server/interface/IResponseDTO.h server/dto/RequestDto.cpp server/header/RequestDto.h server/dto/ResponseDto.cpp server/header/ResponseDto.h server/utils/JsonBuilder.cpp server/header/JsonBuilder.h server/repository/RedisRepository.cpp server/header/RedisRepository.h server/domain/User.cpp server/header/User.h server/utils/Coordinate.cpp server/header/Coordinate.h server/domain/Slime.cpp server/header/Slime.h server/domain/HpPotion.cpp server/header/HpPotion.h server/domain/StrPotion.cpp server/header/StrPotion.h server/interface/IUserRepository.h server/repository/UserRepository.cpp server/header/UserRepository.h server/controller/UserController.cpp server/header/UserController.h server/interface/IUserService.h server/service/UserService.cpp server/header/UserService.h server/interface/IUserController.h server/utils/RandomGridGenerator.cpp server/header/RandomGridGenerator.h server/EventHandler/EpollEventHandler.cpp server/header/EpollEventHandler.h server/controller/HealthController.cpp server/header/HealthController.h)
target_link_libraries(server ${LIBHIREDIS})
find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})
ADD_EXECUTABLE(client client/src/NaiveLogger.cpp client/interface/Logger.h client/src/Client.cpp client/src/App.cpp server/interface/IController.h server/header/ProcessRequestHandler.h client/src/User.cpp client/header/User.h client/src/JsonParser.cpp client/src/JsonBuilder.cpp)
target_link_libraries(client ${CURSES_LIBRARIES})
include(FetchContent)
FetchContent_Declare(
googletest
# Specify the commit you depend on and update it regularly.
URL https://github.com/google/googletest/archive/5376968f6948923e2411081fd9372e71a59d8e77.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# Now simply link against gtest or gtest_main as needed. Eg
add_executable(test test/main.cpp test/test_controller.cpp test/test_UserService.cpp server/utils/JsonBuilder.cpp server/utils/JsonParser.cpp server/domain/User.cpp server/domain/StrPotion.cpp server/domain/HpPotion.cpp server/utils/Coordinate.cpp server/utils/RandomGridGenerator.cpp test/test_HealthController.cpp)
target_link_libraries(test gtest_main)
add_test(NAME example_test COMMAND test)