mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 12:21:17 +00:00
Use FetchContent_MakeAvailable
This commit is contained in:
@@ -61,13 +61,7 @@ FetchContent_Declare(
|
||||
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
|
||||
GIT_TAG <tag_name> # Can be a tag (yaml-cpp-x.x.x), a commit hash, or a branch name (master)
|
||||
)
|
||||
FetchContent_GetProperties(yaml-cpp)
|
||||
|
||||
if(NOT yaml-cpp_POPULATED)
|
||||
message(STATUS "Fetching yaml-cpp...")
|
||||
FetchContent_Populate(yaml-cpp)
|
||||
add_subdirectory(${yaml-cpp_SOURCE_DIR} ${yaml-cpp_BINARY_DIR})
|
||||
endif()
|
||||
FetchContent_MakeAvailable(yaml-cpp)
|
||||
|
||||
target_link_libraries(YOUR_LIBRARY PUBLIC yaml-cpp::yaml-cpp) # The library or executable that require yaml-cpp library
|
||||
```
|
||||
|
Reference in New Issue
Block a user