Qt 6.12 LTS is out! See what's new in the release
blog
Translate -openssl-linked option to CMake option
-
Hello!
I want to build
Qt 6.3.2withOpenSSLlibs 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
cmakeoutput I get:OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ yesAs you can see, the
OpenSSLis not directly linked toQt. So, I would like to know the cmake option to make it linked toQt? Thank you. -
Ok. I have found this
cmakeoption in the cmake trace.
I have to use the following option:-DFEATURE_openssl_linked=ONto directly link theQttoOpenSSLlibs.
Now, the output is:OpenSSL ................................ yes Qt directly linked to OpenSSL ........ yes OpenSSL 1.1 ............................ yesThe issue is resolved.