summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-08-10 10:57:24 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2022-08-10 19:32:06 +0200
commita29af6656f1c33355c4cbfe8587b8f6eae691a21 (patch)
treef10fedc1b3e3832134a49dc52dadf8756a710edf /cmake
parent64ac64ba6bb2f70ab6aafb9af91b142a765956c7 (diff)
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 Pick-to: 6.2 6.3 6.4 Change-Id: I71ff5238f353541b8bf5ac6792b86134deba20d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindWrapSystemDoubleConversion.cmake13
1 files changed, 9 insertions, 4 deletions
diff --git a/cmake/FindWrapSystemDoubleConversion.cmake b/cmake/FindWrapSystemDoubleConversion.cmake
index 49600726e6..cb3a16c2c7 100644
--- a/cmake/FindWrapSystemDoubleConversion.cmake
+++ b/cmake/FindWrapSystemDoubleConversion.cmake
@@ -31,14 +31,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)