diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-05 14:28:31 +0200 |
---|---|---|
committer | Kevin Funk <kevin.funk@kdab.com> | 2019-06-05 12:30:47 +0000 |
commit | ace549587073d387823815b02ec85a28da408844 (patch) | |
tree | 0e0ff29a17b62ded3086ba5560c2dfc4838b2e45 /cmake/FindWrapDoubleConversion.cmake | |
parent | 37467028bb07c14311ac2cf9741c274d5b44b388 (diff) |
Fix a few of the Wrap modules to protect against double creation of
targets. This created issues when trying to build standalone examples.
Change-Id: Iaaea2b537793ae25fbf3143cc205574446aa4ad1
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Diffstat (limited to 'cmake/FindWrapDoubleConversion.cmake')
-rw-r--r-- | cmake/FindWrapDoubleConversion.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/FindWrapDoubleConversion.cmake b/cmake/FindWrapDoubleConversion.cmake index 1164f6ba44..9c804a3eec 100644 --- a/cmake/FindWrapDoubleConversion.cmake +++ b/cmake/FindWrapDoubleConversion.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 WrapDoubleConversion::WrapDoubleConversion) + set(WrapDoubleConversion_FOUND ON) + return() +endif() + add_library(WrapDoubleConversion::WrapDoubleConversion INTERFACE IMPORTED) find_package(double-conversion) |