diff --git a/BUILD.txt b/BUILD.txt index c4a8e0c7f9d..da53ba2f126 100644 --- a/BUILD.txt +++ b/BUILD.txt @@ -33,6 +33,7 @@ Doxygen's cmake configuration provides a number of options: - build_search Build external search tools (doxysearch and doxyindexer). - build_doc Build user manual. - use_libclang Add support for libclang parsing. +- use_sys_spdlog Use system spdlog instead of bundled. - win_static Link with /MT in stead of /MD on windows. - force_qt= Forces doxywizard to build using the specified major version, this can be Qt5 or Qt6 diff --git a/CMakeLists.txt b/CMakeLists.txt index c7778710d27..15a2fb96b57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") option(use_libc++ "Use libc++ as C++ standard library." ON) endif() option(use_libclang "Add support for libclang parsing." OFF) +option(use_sys_spdlog "Use system spdlog instead of bundled." OFF) option(static_libclang "Link to a statically compiled version of LLVM/libclang." OFF) option(win_static "Link with /MT in stead of /MD on windows" OFF) option(enable_console "Enable that executables on Windows get the CONSOLE bit set for the doxywizard executable [development]" OFF) @@ -63,6 +64,9 @@ if (use_libclang) find_package(LLVM CONFIG REQUIRED) find_package(Clang CONFIG REQUIRED) endif() +if (use_sys_spdlog) + find_package(spdlog CONFIG REQUIRED) +endif() if (build_wizard) if (force_qt STREQUAL "Qt6") if (CMAKE_SYSTEM MATCHES "Darwin") diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 62750a0fb0d..a689b4a7018 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -1,5 +1,7 @@ add_subdirectory(libmd5) add_subdirectory(liblodepng) add_subdirectory(libmscgen) -add_subdirectory(spdlog) +if (NOT use_sys_spdlog) + add_subdirectory(spdlog) +endif() add_subdirectory(sqlite3) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index abb11df7231..f54fbaa6452 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,11 +11,14 @@ include_directories( ${PROJECT_SOURCE_DIR}/libxml ${PROJECT_SOURCE_DIR}/vhdlparser ${PROJECT_SOURCE_DIR}/src - ${PROJECT_SOURCE_DIR}/deps/spdlog/include ${CLANG_INCLUDEDIR} ${GENERATED_SRC} ) +if (NOT use_sys_spdlog) + include_directories(${PROJECT_SOURCE_DIR}/deps/spdlog/include) +endif() + file(MAKE_DIRECTORY ${GENERATED_SRC}) if (${CMAKE_VERSION} VERSION_EQUAL "3.11.0" OR ${CMAKE_VERSION} VERSION_GREATER "3.11.0") @@ -389,7 +392,7 @@ target_link_libraries(doxygen PRIVATE xml doxygen_version vhdlparser - spdlog + spdlog::spdlog ${ICONV_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBS}