mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +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_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)
|
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)
|
FetchContent_MakeAvailable(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()
|
|
||||||
|
|
||||||
target_link_libraries(YOUR_LIBRARY PUBLIC yaml-cpp::yaml-cpp) # The library or executable that require yaml-cpp library
|
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