qt5base-lts/cmake/FindWrapDoubleConversion.cmake
Alexandru Croitor b0772b41c2 CMake: Display found information in some of the Find modules
Change-Id: I5d92f2f1a552888361a2939577c2b0177c62b596
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-26 22:14:48 +02:00

23 lines
928 B
CMake

# 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()
set(WrapDoubleConversion_FOUND OFF)
find_package(double-conversion QUIET)
if (double-conversion_FOUND)
include(FeatureSummary)
set_package_properties(double-conversion PROPERTIES TYPE REQUIRED)
add_library(WrapDoubleConversion::WrapDoubleConversion INTERFACE IMPORTED)
target_link_libraries(WrapDoubleConversion::WrapDoubleConversion
INTERFACE double-conversion::double-conversion)
set(WrapDoubleConversion_FOUND ON)
return()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WrapDoubleConversion DEFAULT_MSG WrapDoubleConversion_FOUND)