I installed spdlog static lib using there doc and try to link it to my program using there example
the installation path is this:
/home/yaodav/Desktop/dnr_main_repo/lib/external
this is my CMAKE:
cmake_minimum_required(VERSION 3.19)
project(test_1)
set(CMAKE_CXX_STANDARD 17)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.75.0 COMPONENTS date_time system thread CONFIG)
if(Boost_FOUND)
message("Boost found ${Boost_VERSION}")
message("${Boost_LIBRARIES}")
endif()
find_library(CONNECTION
NAMES connlib
)
if(NOT CONNECTION)
message(FATAL_ERROR "CONNECTION library not found")
else()
message("CONNECTION library found")
endif()
if(NOT TARGET spdlog)
# Stand-alone build
find_package(spdlog REQUIRED)
endif()
find_package(Threads)
add_executable(test_1 main.cpp)
target_link_libraries(test_1 PRIVATE ${CONNECTION} ${Boost_LIBRARIES} Threads::Threads pq spdlog::spdlog)
but Im getting this error:
CMake Error at CMakeLists.txt:23 (find_package): By not providing "Findspdlog.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "spdlog", but CMake did not find one.
Could not find a package configuration file provided by "spdlog" with any of the following names:
spdlogConfig.cmake spdlog-config.cmake
Add the installation prefix of "spdlog" to CMAKE_PREFIX_PATH or set "spdlog_DIR" to a directory containing one of the above files. If "spdlog" provides a separate development package or SDK, be sure it has been installed.
so I added the spdlog_DIR
set(spdlog_DIR ../lib/external/spdlog
find_package(spdlog PATHS ${spdlog_DIR } REQUIRED)
with this error:
include could not find load file:
/home/yaodav/Desktop/dnr_main_repo/lib/external/spdlog/build/spdlogConfigTargets.cmake