Commit c28c2865 authored by Martin Heistermann's avatar Martin Heistermann
Browse files

Improve plugin.cmake dependency handling.

- Fix definition of _FOUND macro for lowercase dependencies.
- Support dependencies that are targets, tkae
  INTERFACE_INCLUDE_DIRECTORIES from their properties instead of looking
  for global variables.
parent 488ead16
...@@ -207,7 +207,7 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -207,7 +207,7 @@ macro (_check_plugin_deps _prefix _optional )
if ( ${_optional} STREQUAL "TRUE" ) 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 # Optional dependency found and recursive found, so add definition to enable it
if ( ${_optional} STREQUAL "TRUE" ) if ( ${_optional} STREQUAL "TRUE" )
...@@ -276,6 +276,12 @@ macro (_check_plugin_deps _prefix _optional ) ...@@ -276,6 +276,12 @@ macro (_check_plugin_deps _prefix _optional )
if (${_val}_FOUND OR ${_VAL}_FOUND) if (${_val}_FOUND OR ${_VAL}_FOUND)
foreach (_name ${_val} ${_VAL}) foreach (_name ${_val} ${_VAL})
if (TARGET ${_name})
get_target_property(TARGET_INCDIRS ${_name} INTERFACE_INCLUDE_DIRECTORIES)
if (TARGET_INCDIRS)
list (APPEND ${_prefix}_DEPS_INCDIRS ${TARGET_INCDIRS})
endif()
endif()
if (DEFINED ${_name}_INCLUDE_PATH) if (DEFINED ${_name}_INCLUDE_PATH)
list (APPEND ${_prefix}_DEPS_INCDIRS "${${_name}_INCLUDE_PATH}") list (APPEND ${_prefix}_DEPS_INCDIRS "${${_name}_INCLUDE_PATH}")
endif () endif ()
......
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