Skip to content
Snippets Groups Projects
Commit b9b32d0e authored by Jens Georg's avatar Jens Georg
Browse files

Add public dependencies to Config.cmake

To add public dependencies to the generated config, use e.g.

list(APPEND ${PROJECT_NAME}_PUBLIC_DEPENDENCIES "Boost COMPONENTS system thread chrono")
parent 16e78c41
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,8 @@ FIND_LIBRARY(@PROJECT_NAME@_LIBRARY @PROJECT_NAME@ ...@@ -34,6 +34,8 @@ FIND_LIBRARY(@PROJECT_NAME@_LIBRARY @PROJECT_NAME@
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
@@PROJECT_NAME@_PUBLIC_DEPENDENCIES_L@
# Since this file is already part of the installation to be found, the configuration can be hard-coded at # Since this file is already part of the installation to be found, the configuration can be hard-coded at
# installation time # installation time
set(@PROJECT_NAME@_VERSION "@@PROJECT_NAME@_SOVERSION@") set(@PROJECT_NAME@_VERSION "@@PROJECT_NAME@_SOVERSION@")
......
...@@ -53,6 +53,11 @@ foreach(LIBRARY ${LIST}) ...@@ -53,6 +53,11 @@ foreach(LIBRARY ${LIST})
endif() endif()
endforeach() endforeach()
set(${PROJECT_NAME}_PUBLIC_DEPENDENCIES_L "")
foreach(DEPENDENCY ${${PROJECT_NAME}_PUBLIC_DEPENDENCIES})
string(APPEND ${PROJECT_NAME}_PUBLIC_DEPENDENCIES_L "find_package(${DEPENDENCY} REQUIRED)\n")
endforeach()
# we have nested @-statements, so we have to parse twice: # we have nested @-statements, so we have to parse twice:
# create the cmake find_package configuration file # create the cmake find_package configuration file
......
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