Skip to content

Commit 6917094

Browse files
authored
Merge pull request #204 from FeignClaims/fix/find_dependencies_macro
fix: `target_find_dependencies` should be a macro
2 parents 832a28e + ec730b4 commit 6917094

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

docs/src/target_find_dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ target_find_dependencies(<target_name>
1111
)
1212
```
1313

14-
This function calls `find_package(${dependency} [CONFIG] REQUIRED)` for all dependencies required and binds them to the target.
14+
This macro calls `find_package(${dependency} [CONFIG] REQUIRED)` for all dependencies required and binds them to the target.
1515

1616
Properties named `PROJECT_OPTIONS_<PRIVATE|PUBLIC|INTERFACE>[_CONFIG]_DEPENDENCIES` will be created in `target_name` to represent corresponding dependencies.
1717
When adding the target to `package_project`, directories in this property will be automatically added.

src/PackageProject.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ endfunction()
325325
:parser: myst_parser.sphinx_
326326
327327
#]]
328-
function(target_find_dependencies target)
328+
macro(target_find_dependencies target)
329329
set(_options)
330330
set(_oneValueArgs)
331331
set(_MultiValueArgs
@@ -357,10 +357,10 @@ function(target_find_dependencies target)
357357
set_or_append_target_property(${target} "PROJECT_OPTIONS_${property}_DEPENDENCIES" "${args_${property}}")
358358
endmacro()
359359

360-
_property_for(PRIVATE)
361-
_property_for(PUBLIC)
362-
_property_for(INTERFACE)
363-
_property_for(PRIVATE_CONFIG)
364-
_property_for(PUBLIC_CONFIG)
365-
_property_for(INTERFACE_CONFIG)
366-
endfunction()
360+
_Property_for(PRIVATE)
361+
_Property_for(PUBLIC)
362+
_Property_for(INTERFACE)
363+
_Property_for(PRIVATE_CONFIG)
364+
_Property_for(PUBLIC_CONFIG)
365+
_Property_for(INTERFACE_CONFIG)
366+
endmacro()

0 commit comments

Comments
 (0)