# pgtest **Repository Path**: runants/pgtest ## Basic Information - **Project Name**: pgtest - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-28 - **Last Updated**: 2025-06-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 1. cmake 引用包 ```cmake include(FetchContent) # 先获取 fmt FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_TAG 10.1.1 ) # 再获取 spdlog FetchContent_Declare( spdlog GIT_REPOSITORY https://github.com/gabime/spdlog.git GIT_TAG v1.14.1 ) FetchContent_MakeAvailable(fmt spdlog) target_link_libraries(pgtest PRIVATE spdlog::spdlog fmt::fmt) ``` ## 1.1 cmake 引用本地包 ```cmake find_package(spdlog REQUIRED) target_link_libraries(testcode PRIVATE spdlog::spdlog) ``` # 2. 查询文件 find . -name spdlog.h - 返回结果 `./cmake-build-debug/_deps/spdlog-src/include/spdlog/spdlog.h` - 执行打包命令 `x86_64-linux-musl-g++ -static -o hello main.cpp -I ./cmake-build-debug/_deps/spdlog-src/include`