Translate -openssl-linked option to CMake option
-
wrote on 16 Sept 2022, 11:36 last edited by
Hello!
I want to build
Qt 6.3.2
withOpenSSL
libs directly linked toQt
. From the docs, there is an option --openssl-linked
(https://doc.qt.io/qt-6/ssl.html):By default, an OpenSSL-enabled Qt library dynamically loads any installed OpenSSL library at run-time. However, it is possible to link against the library at compile-time by configuring Qt with the -openssl-linked option.
I use this batch command:
cmake.exe --trace-expand --trace-redirect=cmake.trace -DCMAKE_BUILD_TYPE=%qtBuildMode% -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DCMAKE_PREFIX_PATH="C:\\LLVM\\x64\\static\\debug" -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DBUILD_qtwebengine=OFF -DOPENSSL_ROOT_DIR="%qtBuildOpenSSLRootPath%" -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_MSVC_STATIC_RT=TRUE -DINPUT_sql_mysql=ON -DMySQL_INCLUDE_DIR="%qtBuildMySqlIncludeDirsPath%" -DMySQL_LIBRARY="%qtBuildMySqlLibsPath%" -DCMAKE_INSTALL_PREFIX="%qtBuildPath%" -G Ninja %qtBuildSourcePath%
From the
cmake
output I get:OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ yes
As you can see, the
OpenSSL
is not directly linked toQt
. So, I would like to know the cmake option to make it linked toQt
? Thank you. -
wrote on 16 Sept 2022, 12:09 last edited by
Ok. I have found this
cmake
option in the cmake trace.
I have to use the following option:-DFEATURE_openssl_linked=ON
to directly link theQt
toOpenSSL
libs.
Now, the output is:OpenSSL ................................ yes Qt directly linked to OpenSSL ........ yes OpenSSL 1.1 ............................ yes
The issue is resolved.
1/2