diff options
-rw-r--r-- | cmake/FindWrapJasper.cmake | 7 | ||||
-rw-r--r-- | cmake/FindWrapWebP.cmake | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/cmake/FindWrapJasper.cmake b/cmake/FindWrapJasper.cmake index e25d21b..51a63e0 100644 --- a/cmake/FindWrapJasper.cmake +++ b/cmake/FindWrapJasper.cmake @@ -1,3 +1,10 @@ +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET WrapJasper::WrapJasper) + set(WrapJasper_FOUND TRUE) + return() +endif() + set(WrapJasper_FOUND OFF) find_package(Jasper) diff --git a/cmake/FindWrapWebP.cmake b/cmake/FindWrapWebP.cmake index b546529..487c18b 100644 --- a/cmake/FindWrapWebP.cmake +++ b/cmake/FindWrapWebP.cmake @@ -5,6 +5,13 @@ # So try config files first, and then use the regular find_library / find_path dance with pkg-config # paths as hints. +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET WrapWebP::WrapWebP) + set(WrapWebP_FOUND TRUE) + return() +endif() + find_package(WebP QUIET) if(TARGET WebP::webp AND TARGET WebP::webpdemux AND TARGET WebP::libwebpmux) set(WrapWebP_FOUND ON) |