[CMake] fix depenency management & integration for toml++
Some checks failed
buildbot/IOCore-macos-builder Build done.
buildbot/IOCore-linux-builder Build done.

This commit is contained in:
S David 2024-07-11 15:36:50 -04:00
parent a6ed27cd0d
commit 378792421b
3 changed files with 17 additions and 9 deletions

View File

@ -23,9 +23,9 @@ Enabled by default if ccache is found]=]
ON
)
IF( NOT CMAKE_BUILD_TYPE )
if( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Debug )
ENDIF()
endif()
set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
@ -117,7 +117,7 @@ if (fmt_DIR)
list(APPEND CMAKE_MODULE_PATH ${fmt_DIR})
endif()
CPMAddPackage(NAME tomlplusplus
CPMFindPackage(NAME tomlplusplus
URL https://github.com/marzer/tomlplusplus/archive/refs/tags/v3.4.0.zip
URL_HASH SHA256=ad2a4cd786e25305d802e7490ea65a2531195e5834bf6b4fa5a323421fd81f9b
)
@ -125,7 +125,7 @@ if (tomlplusplus_DIR)
list(APPEND CMAKE_MODULE_PATH ${tomlplusplus_DIR})
endif()
CPMAddPackage(NAME nlohmann_json
CPMFindPackage(NAME nlohmann_json
URL https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.zip
URL_HASH SHA256=04022b05d806eb5ff73023c280b68697d12b93e1b7267a0b22a1a39ec7578069
)

View File

@ -25,8 +25,10 @@ set(LIBRARY_DEP_LIBS
${STACKTRACE_DEP_LIBS}
)
target_link_libraries(IOCore PUBLIC ${LIBRARY_DEP_LIBS})
target_link_libraries(IOCore PUBLIC fmt::fmt-header-only)
target_link_libraries(IOCore PUBLIC
fmt::fmt-header-only
tomlplusplus::tomlplusplus
)
add_library(IOCoreStatic STATIC)
add_library(IOCore::Static ALIAS IOCoreStatic )
@ -39,8 +41,14 @@ set_target_properties(IOCoreShared PROPERTIES OUTPUT_NAME "IOCore")
target_link_libraries(IOCoreStatic PRIVATE IOCore)
target_link_libraries(IOCoreShared PRIVATE IOCore)
target_link_libraries(IOCoreStatic PUBLIC fmt::fmt-header-only)
target_link_libraries(IOCoreShared PUBLIC fmt::fmt-header-only)
target_link_libraries(IOCoreStatic PUBLIC
fmt::fmt-header-only
tomlplusplus::tomlplusplus
)
target_link_libraries(IOCoreShared PUBLIC
fmt::fmt-header-only
tomlplusplus::tomlplusplus
)
target_include_directories(IOCoreStatic INTERFACE ${IOCore_INCLUDE_OUTPUT_DIR})
target_include_directories(IOCoreShared INTERFACE ${IOCore_INCLUDE_OUTPUT_DIR})

View File

@ -36,7 +36,7 @@ include(Catch)
catch_discover_tests(test-runner)
add_custom_target(ctest
command ctest -c $configuration --test-dir . --output-on-failure
command ctest -C $configuration --test-dir . --output-on-failure
)
add_dependencies(ctest
test_bin