Skip to content
Snippets Groups Projects
Commit d061bd4d authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

fixed multiple components not properly being passed on to find_package

parent 5fd95c63
No related branches found
No related tags found
No related merge requests found
......@@ -26,13 +26,17 @@
#
#######################################################################################################################
MACRO(add_dependency dependency_project_name required_version components)
FUNCTION(add_dependency dependency_project_name required_version)
# collect additional arguments and put into the list of components
SET(components "")
foreach(arg IN LISTS ARGN)
SET(components ${components} ${arg})
endforeach()
FIND_PACKAGE(${dependency_project_name} ${required_version} COMPONENTS ${components})
include_directories(SYSTEM ${${dependency_project_name}_INCLUDE_DIRS} ${${dependency_project_name}_INCLUDE_DIR})
link_directories(${${dependency_project_name}_LIBRARY_DIRS})
link_directories(${${dependency_project_name}_LIBRARY_DIR})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${dependency_project_name}_CXX_FLAGS}")
ENDMACRO(add_dependency)
ENDFUNCTION(add_dependency)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment