diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-03-16 15:59:19 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-03-17 09:00:02 +0100 |
commit | 86ff21be229b3245af5105a711308315250bed68 (patch) | |
tree | 0d13c2bbe07337fa4bfe2c74ba78420c858c24e7 /cmake/FindWrapJasper.cmake | |
parent | e2bed44b317951494d30feb2910a05ba87ea1b63 (diff) | |
download | qtimageformats-86ff21be229b3245af5105a711308315250bed68.tar.gz |
FindWrap[Jasper|WebP].cmake: bail out on existing targets
Add the common bail out code we have in other FindWrap*.cmake files.
Pick-to: 6.1
Change-Id: I6096b31fcf6a2181b22b74ccf285ce22e14c197b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/FindWrapJasper.cmake')
-rw-r--r-- | cmake/FindWrapJasper.cmake | 7 |
1 files changed, 7 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) |