From c1c0b98b5c9cdaedba2ac0c02f6706f570612c1f Mon Sep 17 00:00:00 2001 From: Jie Date: Tue, 18 Jun 2024 11:16:30 +0800 Subject: [PATCH] add spdlog gtest --- CMakeLists.txt | 12 +++++++++++- main.cc | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2f809b..e746298 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,18 +8,28 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) include_directories(${PROJECT_SOURCE_DIR}/include) file(GLOB_RECURSE srcs ${PROJECT_SOURCE_DIR}/src/*.cc) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) + +include(FetchContent) + +include(spdlog) +include(gtest) + IF(UNIX) find_package(SFML 2.5 COMPONENTS system window graphics network audio REQUIRED) add_executable(${PROJECT_N} main.cc ${srcs} ) - target_link_libraries(${PROJECT_N} + target_link_libraries(${PROJECT_N} PRIVATE sfml-system sfml-window sfml-graphics sfml-network sfml-audio + + spdlog + gtest ) ELSE(WIN32) diff --git a/main.cc b/main.cc index 83f1070..1b8d00b 100644 --- a/main.cc +++ b/main.cc @@ -1,9 +1,11 @@ #include #include #include +#include int main(int argc, char** const argv){ + spdlog::info("Hello, World!"); sf::RenderWindow window(sf::VideoMode(800, 600), "mp"); sf::Texture texture; sf::Sprite sprite;