yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

Add support for CMake + FetchContent

Open lambdaknight opened this issue 4 years ago • 1 comments
trafficstars

FetchContent_Declare(
        yaml-cpp
        GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
        GIT_TAG yaml-cpp-0.6.3
)
set(YAML_CPP_BUILD_TESTS OFF)
FetchContent_MakeAvailable(yaml-cpp)
target_link_libraries(${TARGET} yaml-cpp)

This works just fine. However, with the latest commit (a6bbe0e when submitted), this does not work. Please re-add the ability to use this with FetchContent.

lambdaknight avatar Jun 21 '21 13:06 lambdaknight

Hello,

cmake_minimum_required(VERSION 3.14.0)
project(dummy-project)

set(TARGET main)

add_executable(${TARGET} src/main.cpp)
set_property(TARGET ${TARGET} PROPERTY CXX_STANDARD 20)

include(FetchContent)

FetchContent_Declare(
        yaml-cpp
        GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
        GIT_TAG a6bbe0e50ac4074f0b9b44188c28cf00caf1a723
)

set(YAML_CPP_BUILD_TESTS OFF)
FetchContent_MakeAvailable(yaml-cpp)
target_link_libraries(${TARGET} yaml-cpp)

and GIT TAG yaml-cpp-0.7.0 builds successfully. Can you please open this issue up?

Regards.

Akaame avatar Aug 02 '21 20:08 Akaame