Closed 2maz closed 4 years ago
Since the only use-case so far for this is having private dependencies, could we actually just have a private
true/false argument ?
Alternatively, if what you really want is flexibility, I would refactor the code to have a each_pkgconfig_link
enumerator that is used in different places to generate the CMake code (i.e. have your template generate its own specific target_link_libraries
). I don't think it makes sense to attempt extending this method to have some kind of weird 1:1 mapping with the target_link_libraries
command.
Alternatively, if what you really want is flexibility, I would refactor the code to have a each_pkgconfig_link enumerator that is used in different places to generate the CMake code (i.e. have your template generate its own specific target_link_libraries).
I go for that one then - see update
CMake Policy 0023 states that: "Plain and keyword target_link_libraries() signatures cannot be mixed."
Therefore this change permits the keyword use when needed through context.