Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Translate -openssl-linked option to CMake option
Forum Updated to NodeBB v4.3 + New Features

Translate -openssl-linked option to CMake option

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 930 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cobra91151
    wrote on 16 Sept 2022, 11:36 last edited by
    #1

    Hello!

    I want to build Qt 6.3.2 with OpenSSL libs directly linked to Qt. 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 to Qt. So, I would like to know the cmake option to make it linked to Qt? Thank you.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Cobra91151
      wrote on 16 Sept 2022, 12:09 last edited by
      #2

      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 the Qt to OpenSSL libs.
      Now, the output is:

      OpenSSL ................................ yes
         Qt directly linked to OpenSSL ........ yes
       OpenSSL 1.1 ............................ yes
      

      The issue is resolved.

      1 Reply Last reply
      1

      1/2

      16 Sept 2022, 11:36

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved