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>
This commit is contained in:
Alexandru Croitor 2019-06-05 14:28:31 +02:00 committed by Kevin Funk
parent 37467028bb
commit ace5495870
3 changed files with 21 additions and 0 deletions

View File

@ -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 Atomic)
set(Atomic_FOUND ON)
return()
endif()
include(CheckCXXSourceCompiles)
set (atomic_test_sources "#include <atomic>

View File

@ -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)

View File

@ -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 WrapRt)
set(WrapRt_FOUND ON)
return()
endif()
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)