Closed S-Dafarra closed 2 years ago
Perhaps we could try to reproduce this without FetchContent?
I mean, is the following one:
CMakeLists.txt:
find_package(GLFW3 REQUIRED)
find_package(GLFW3 REQUIRED)
working?
If this one is working, we could try the following:
CMakeLists.txt:
find_package(GLFW3 REQUIRED)
add_subdirectory(nested)
nested/CMakeLists.txt
:
find_package(GLFW3 REQUIRED)
Perhaps we could try to reproduce this without FetchContent?
I mean, is the following one:
CMakeLists.txt:
find_package(GLFW3 REQUIRED) find_package(GLFW3 REQUIRED)
working?
Good point. This does not work already
Great!
Fixed in https://github.com/robotology/ycm/pull/398 and released in 0.13.2 .
For example, the following code
fails with the error
Everything works fine if the dependency fetched with
FetchContent
is placed first.I guess this is because the target
GLFW3::GLFW3
is always added even if it exists already (https://github.com/robotology/ycm/blob/1860bad63dcdf6727c1ce0746561e1cada0dccef/find-modules/FindGLFW3.cmake#L105)cc @traversaro @drdanz