File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99function (packageProject )
1010
11- cmake_parse_arguments (PROJECT "" "NAME;VERSION;INCLUDE_DIR;INCLUDE_DESTINATION;BINARY_DIR" "" ${ARGN} )
11+ cmake_parse_arguments (PROJECT "" "NAME;VERSION;INCLUDE_DIR;INCLUDE_DESTINATION;BINARY_DIR;DEPENDENCIES " "" ${ARGN} )
1212
1313 include (CMakePackageConfigHelpers )
1414
Original file line number Diff line number Diff line change 11@PACKAGE_INIT@
22
33include (CMakeFindDependencyMacro )
4+
5+ foreach (dependency @PROJECT_DEPENDENCIES@)
6+ find_dependency (${dependency} )
7+ endforeach ()
8+
49include ("${CMAKE_CURRENT_LIST_DIR} /@PROJECT_NAME@Targets.cmake" )
510check_required_components ("@PROJECT_NAME@" )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ See [here](https://github.com/TheLartians/ModernCppStarter/blob/master/CMakeList
1414CPMAddPackage(
1515 NAME PackageProject.cmake
1616 GITHUB_REPOSITORY TheLartians/PackageProject.cmake
17- VERSION 1.0
17+ VERSION 1.1
1818)
1919
2020packageProject(
@@ -28,6 +28,8 @@ packageProject(
2828 INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
2929 # should match the target's INSTALL_INTERFACE include directory
3030 INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION}
31+ # comma separated list of all dependencies
32+ DEPENDENCIES ""
3133)
3234```
3335
You can’t perform that action at this time.
0 commit comments