Commit 54f7dbbe authored by Jan Möbius's avatar Jan Möbius

Merge branch 'plugin-cmake-improvement' into 'master'

Improve plugin.cmake dependency handling.

See merge request !165
parents 488ead16 4d24c395
......@@ -207,7 +207,7 @@ macro (_check_plugin_deps _prefix _optional )
if ( ${_optional} STREQUAL "TRUE" )
if ( ${_VAL}_FOUND )
if ( ${_VAL}_FOUND OR ${_val}_FOUND)
# Optional dependency found and recursive found, so add definition to enable it
if ( ${_optional} STREQUAL "TRUE" )
......@@ -276,6 +276,9 @@ macro (_check_plugin_deps _prefix _optional )
if (${_val}_FOUND OR ${_VAL}_FOUND)
foreach (_name ${_val} ${_VAL})
if (TARGET ${_name})
list(APPEND ${_prefix}_DEPS_TARGETS ${_name})
endif()
if (DEFINED ${_name}_INCLUDE_PATH)
list (APPEND ${_prefix}_DEPS_INCDIRS "${${_name}_INCLUDE_PATH}")
endif ()
......@@ -677,6 +680,10 @@ function (_build_openflipper_plugin plugin)
endif()
endif()
if(${_PLUGIN}_DEPS_TARGETS)
target_link_libraries(Plugin-${plugin} ${${_PLUGIN}_DEPS_TARGETS})
endif()
# append compiler and linker flags from plugin dependencies
list(APPEND ${_PLUGIN}_DEPS_COMPILE_DEFINITIONS ${${_PLUGIN}_CDEFINITIONSADD} )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment