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

沒有留言:

張貼留言

2007 to 2023 HP and Dell Servers Comparison

  HP Gen5 to Gen11  using ChatGPT HP ProLiant Gen Active Years CPU Socket Popular HP CPUs Cores Base Clock Max RAM Capacity Comparable Dell ...