From fffaffb439403d19331894cc89fefe742c4deb51 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 4 Jun 2020 17:10:51 +0200 Subject: CMake: Save OPENSSL_ROOT_DIR in QtBuildInternalsExtra This is needed so that other repos other than qtbase (like qtopcua) can still find_package(WrapOpenSSL) successfully. The path needs to be converted to a CMake path, to avoid issues on Windows with backslashes. Change-Id: I3d7652d93110f6b8f39a58a6c28aef6c7471aea7 Reviewed-by: Cristian Adam --- cmake/QtPostProcess.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmake') diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 02ab986a3d..feb20a50cd 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -423,6 +423,16 @@ endif()\n") "set(QT_EXTRA_RPATHS \"${QT_EXTRA_RPATHS}\" CACHE STRING \"\")\n") endif() + # The OpenSSL root dir needs to be saved so that repos other than qtbase (like qtopcua) can + # still successfully find_package(WrapOpenSSL) in the CI. + # qmake saves any additional include paths passed via the configure like '-I/foo' + # in mkspecs/qmodule.pri, so this file is the closest equivalent. + if(DEFINED OPENSSL_ROOT_DIR) + file(TO_CMAKE_PATH "${OPENSSL_ROOT_DIR}" openssl_root_cmake_path) + string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS + "set(OPENSSL_ROOT_DIR \"${openssl_root_cmake_path}\" CACHE STRING \"\")\n") + endif() + qt_generate_install_prefixes(install_prefix_content) string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "${install_prefix_content}") -- cgit v1.2.3