Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions projects/rocprofiler-sdk/external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,26 @@ rocprofiler_checkout_git_submodule(
REPO_URL https://github.com/jbeder/yaml-cpp.git
REPO_BRANCH "master")

add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL)

# Prefer system-provided yaml-cpp over vendored one
option(ROCPROF_USE_SYS_YAML_CPP
"Use system-provided yaml-cpp instead of vendored external/yaml-cpp" ON)

if (ROCPROF_USE_SYS_YAML_CPP)
find_package(yaml-cpp CONFIG REQUIRED)
else()
add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL)
endif()


target_link_libraries(rocprofiler-sdk-yaml-cpp
INTERFACE $<BUILD_INTERFACE:yaml-cpp::yaml-cpp>)
target_include_directories(
rocprofiler-sdk-yaml-cpp
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/yaml-cpp/include>)
INTERFACE yaml-cpp::yaml-cpp)

if (NOT ROCPROF_USE_SYS_YAML_CPP)
target_include_directories(
rocprofiler-sdk-yaml-cpp
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/yaml-cpp/include>)
endif()

# checkout submodule if not already checked out or clone repo if no .gitmodules file
rocprofiler_checkout_git_submodule(
Expand Down
Loading