Minimal code that spdlog can be used
main.cpp
#include <spdlog/spdlog.h>
int main() {
spdlog::info("Welcome to spdlog!");
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(untitled9)
set(CMAKE_CXX_STANDARD 17)
add_executable(untitled9 main.cpp)
include(FetchContent)
set(GITHUB_URL_ROOT https://github.com/)
FetchContent_Declare(spdlog URL ${GITHUB_URL_ROOT}/gabime/spdlog/archive/v1.8.1.tar.gz)
FetchContent_MakeAvailable(spdlog)
target_link_libraries(untitled9 PUBLIC spdlog)
End
沒有留言:
張貼留言