2022年3月7日 星期一

spdlog with cmake 3.14 FetchContent

 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

沒有留言:

張貼留言

202501 Debian USB LAN Card Bridge

 202501 Debian USB LAN Card Bridge ChatGPT Question I have a machine running debian 12 with a LAN port using a cable to connect to my office...