qt5base-lts/cmake/Finddouble-conversion.cmake
Simon Hausmann e9c45bbddd Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io>
Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-by: Kevin Funk <kevin.funk@kdab.com>
Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Done-by: Simon Hausmann <simon.hausmann@qt.io>
Done-by: Tobias Hunger <tobias.hunger@qt.io>
Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-by: Volker Krause <volker.krause@kdab.com>
Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2018-11-01 11:48:46 +00:00

31 lines
1.1 KiB
CMake

# Fallback find module for double-conversion
# if double-conversion is built with CMake it'll install a config module, which we prefer
# if it's built with Scons (their default), we search ourselves
find_package(double-conversion CONFIG)
if (double-conversion_FOUND)
return()
endif()
find_path(DOUBLE_CONVERSION_INCLUDE_DIR
NAMES
double-conversion.h
PATH_SUFFIXES
double-conversion
)
find_library(DOUBLE_CONVERSION_LIBRARY NAMES double-conversion)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
double-conversion DEFAULT_MSG
DOUBLE_CONVERSION_LIBRARY DOUBLE_CONVERSION_INCLUDE_DIR)
if(double-conversion_FOUND AND NOT TARGET double-conversion::double-conversion)
add_library(double-conversion::double-conversion UNKNOWN IMPORTED)
set_target_properties(double-conversion::double-conversion PROPERTIES
IMPORTED_LOCATION "${DOUBLE_CONVERSION_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${DOUBLE_CONVERSION_INCLUDE_DIR}")
endif()
mark_as_advanced(DOUBLE_CONVERSION_INCLUDE_DIR DOUBLE_CONVERSION_LIBRARY)