You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I found that find_package(PDI) cannot be called twice. This can be problematic for complex dependencies. For example, assuming a package called APackageThatDependsOnPDI executes find_dependency(PDI 1.6...<2), the following cmake snippet returns an error in cmake >=3.26:
The error I get is add_executable cannot create imported target "PDI::pdirun" because another target with the same name already exists.. Of course one workaround is to add if/else guards but it adds more complexity on the user side and I don't think it is a common practice to do so.
Also curiously the following snippet does not return an error:
Hello, I found that
find_package(PDI)
cannot be called twice. This can be problematic for complex dependencies. For example, assuming a package calledAPackageThatDependsOnPDI
executesfind_dependency(PDI 1.6...<2)
, the following cmake snippet returns an error in cmake >=3.26:The error I get is
add_executable cannot create imported target "PDI::pdirun" because another target with the same name already exists.
. Of course one workaround is to addif
/else
guards but it adds more complexity on the user side and I don't think it is a common practice to do so.Also curiously the following snippet does not return an error:
I think the reason comes from the line
pdi/pdi/cmake/PDIConfig.cmake.in
Line 29 in 6415fbf
that includes a version of the module
CMakeFindDependencyMacro
that is not in line with the change of behavior introduced in 3.26, see https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html.The text was updated successfully, but these errors were encountered: