qt5base-lts/cmake/FindWrapDoubleConversion.cmake
Alexandru Croitor 3ffad972c1 CMake: Fix double-conversion usage on macOS
We reported that double-conversion was found on macOS if the std
library supported sscanf_l and _snprintf_l, but that's different
from what qmake does.

This caused not to compile and link the bundled double-conversion
sources, and caused tst_qvariant to fail when doing double conversions
on macOS.

Remove the extra config tests, and make it work like in qmake, so that
the bundled code is used instead. This makes tst_qvariant pass.

Amends 729a73a9cf

Change-Id: I7ddaed5fe6916f483fb3de1962657d7fb6fb40be
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:21:18 +02:00

20 lines
787 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)
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()