Enhance TOML dependencies

This commit is contained in:
Mohamed Oulmahdi 2022-06-29 23:45:28 +02:00
parent a5cf6f38f3
commit 7af9b2fae3
1 changed files with 9 additions and 9 deletions

View File

@ -193,21 +193,21 @@ endif()
find_package(toml11 QUIET)
if(toml11_FOUND)
add_library(toml11_target INTERFACE)
add_dependencies(toml11_target INTERFACE toml11::toml11)
else()
target_link_libraries(toml11_target INTERFACE toml11::toml11)
else()
include(ExternalProject)
ExternalProject_add(toml11Project
URL "https://github.com/ToruNiina/toml11/archive/v3.4.0.tar.gz"
URL_HASH SHA256=bc6d733efd9216af8c119d8ac64a805578c79cc82b813e4d1d880ca128bd154d
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/toml11
-Dtoml11_BUILD_TEST:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/toml11
-Dtoml11_BUILD_TEST:BOOL=OFF
BUILD_ALWAYS ON)
add_library(toml11_target INTERFACE)
add_dependencies(toml11_target toml11Project)
target_include_directories(toml11_target SYSTEM INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/toml11/include)
endif()
add_library(toml11_target INTERFACE)
add_dependencies(toml11_target toml11Project)
target_include_directories(toml11_target SYSTEM INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/toml11/include)
endif()
################################################################################
# Coroutine implementation