[CMake] fix depenency management & integration for toml++
This commit is contained in:
parent
a6ed27cd0d
commit
378792421b
@ -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
|
||||
)
|
||||
|
@ -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})
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user