External projects common dependencies not handled correctly
Currently CMake script doesn't correctly handle external projects, which are dependencies of several plugins (e.g. Paraconf, Config validator and FlowVR depend on YAML, but only Paraconf adds YAML external project, this leads to error when USE_PARACONF=SYSTEM
and USE_YAML=EMBEDDED
).
One possible solution would be to add a macro/function, which contains all dependencies common to plugins:
macro(add_external name)
if("${name}" STREQ "YAML")
ExternalProject_Add(YAML ...)
set(YAML_ADDED TRUE)
elseif(...)
...
else()
message(FATAL_ERROR "Invalid project name")
endif()
endmacro()
And use it when adding plugin ExternalProject:
...
if(NOT "${USE_YAML}" STREQUAL SYSTEM)
if (NOT ${YAML_ADDED})
add_external(YAML)
endif()
add_dependency(... YAML)
endif()