diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-08-10 10:57:24 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-10 21:17:06 +0000 |
commit | 25ba921d50a0ed2249dd68c7dab8b36272ff97d7 (patch) | |
tree | fac0ed269bc535a38d05ad596e8b3c324415f813 | |
parent | db169494bd95079848fc5afaa48a4b35e490312e (diff) | |
download | qtbase-25ba921d50a0ed2249dd68c7dab8b36272ff97d7.tar.gz |
CMake: Fix detection of system double-conversion
...if the double-conversion CMake package cannot be loaded.
The find_path call must specify the header exactly as it is included.
The select_library_configurations call always failed, because the
command expects the presence of DOUBLE_CONVERSIONS_LIBRARY_DEBUG,
DOUBLE_CONVERSIONS_LIBRARY_RELEASE, or both.
Upstream double-conversion's MSVC build system does not specify a naming
scheme for the debug build, and there are no debug/release binaries to
download that suggest a naming scheme. Therefore we assume the usual
'd' suffix for the debug library like we do everywhere else.
Lastly, we need to set DOUBLE_CONVERSION_INCLUDE_DIRS.
Fixes: QTBUG-105501
Change-Id: I71ff5238f353541b8bf5ac6792b86134deba20d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a29af6656f1c33355c4cbfe8587b8f6eae691a21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | cmake/FindWrapSystemDoubleConversion.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cmake/FindWrapSystemDoubleConversion.cmake b/cmake/FindWrapSystemDoubleConversion.cmake index 164e79ed54..0d00a0c644 100644 --- a/cmake/FindWrapSystemDoubleConversion.cmake +++ b/cmake/FindWrapSystemDoubleConversion.cmake @@ -28,14 +28,19 @@ if(NOT __double_conversion_found) find_path(DOUBLE_CONVERSION_INCLUDE_DIR NAMES - double-conversion.h - PATH_SUFFIXES - double-conversion + double-conversion/double-conversion.h ) - find_library(DOUBLE_CONVERSION_LIBRARY NAMES double-conversion) + + find_library(DOUBLE_CONVERSION_LIBRARY_RELEASE NAMES double-conversion) + + # We assume a possible debug build of this library to be named with a d suffix. + # Adjust accordingly if a different naming scheme is established. + find_library(DOUBLE_CONVERSION_LIBRARY_DEBUG NAMES double-conversiond) + include(SelectLibraryConfigurations) select_library_configurations(DOUBLE_CONVERSION) mark_as_advanced(DOUBLE_CONVERSION_INCLUDE_DIR DOUBLE_CONVERSION_LIBRARY) + set(DOUBLE_CONVERSION_INCLUDE_DIRS "${DOUBLE_CONVERSION_INCLUDE_DIR}") if(DOUBLE_CONVERSION_LIBRARIES AND DOUBLE_CONVERSION_INCLUDE_DIRS) set(__double_conversion_found TRUE) |