Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. cmake equivalent for qmake's ANDROID_EXTRA_LIBS
Forum Update on Monday, May 27th 2025

cmake equivalent for qmake's ANDROID_EXTRA_LIBS

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 313 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.
  • F Offline
    F Offline
    Fausto01
    wrote on last edited by Fausto01
    #1

    Hello everyone,
    I'm porting a project from Qt 5.15 to Qt 6.8.1 but I'm running into some problems.
    In my app.pro file I have this line of code:

    ANDROID_EXTRA_LIBS += $$PWD/ssl/android/arm64-v8a/libcrypto.so $$PWD/ssl/android/arm64-v8a/libssl.so
    

    I need to port this in cmake and I found this: https://doc.qt.io/qt-6/android-openssl-support.html
    At some point it says:

    Alternatively, to add extra libraries, such as libcrypto and libssl. For CMake, use:

    set_target_properties(<target_name> PROPERTIES
    QT_ANDROID_EXTRA_LIBS "<path_to_libs_dir>/libcrypto_3.so" "<path_to_libs_dir>/libssl_3.so"
    )

    Or for qmake use:

    ANDROID_EXTRA_LIBS +=
    <path_to_libs_dir>/libcrypto_3.so
    <path_to_libs_dir>/libssl_3.so

    That's exactly what I need but when I put this line in my CMakeLists.txt

    set_target_properties(SamsungRC PROPERTIES
        QT_ANDROID_EXTRA_LIBS "ssl/android/arm64-v8a/libcrypto.so" "ssl/android/arm64-v8a/libssl.so"
    )
    

    I get this error:

    CMakeLists.txt:72: error: set_target_properties called with incorrect number of arguments.
    

    Is the documentation wrong or am I missing something?
    Thank you in advance

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Fausto01
      wrote on last edited by Fausto01
      #3

      I've found the solution! (Qt doc is wrong)

      set_target_properties(SamsungRC PROPERTIES
          QT_ANDROID_EXTRA_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/ssl/android/${ANDROID_ABI}/libcrypto_3.so;${CMAKE_CURRENT_SOURCE_DIR}/ssl/android/${ANDROID_ABI}/libssl_3.so"
      )
      

      The values in QT_ANDROID_EXTRA_LIBS need to be separated by a semicolon.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Michel de Boer
        wrote on last edited by
        #2

        Maybe this will work

        target_link_libraries(SamsungRC
            PRIVATE ssl/android/arm64-v8a/libcrypto
            PRIVATE ssl/android/arm64-v8a/libssl
        }
        

        I use this myself to add openssl to my app:

        if (ANDROID)
            FetchContent_Declare(
              android_openssl
              DOWNLOAD_EXTRACT_TIMESTAMP true
              URL      https://github.com/KDAB/android_openssl/archive/refs/heads/master.zip
        #      URL_HASH MD5=c97d6ad774fab16be63b0ab40f78d945 #optional
            )
            FetchContent_MakeAvailable(android_openssl)
            include(${android_openssl_SOURCE_DIR}/android_openssl.cmake)
        endif()
        
        if (ANDROID)
            add_android_openssl_libraries(appskywalker)
        endif()
        
        1 Reply Last reply
        0
        • F Offline
          F Offline
          Fausto01
          wrote on last edited by Fausto01
          #3

          I've found the solution! (Qt doc is wrong)

          set_target_properties(SamsungRC PROPERTIES
              QT_ANDROID_EXTRA_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/ssl/android/${ANDROID_ABI}/libcrypto_3.so;${CMAKE_CURRENT_SOURCE_DIR}/ssl/android/${ANDROID_ABI}/libssl_3.so"
          )
          

          The values in QT_ANDROID_EXTRA_LIBS need to be separated by a semicolon.

          1 Reply Last reply
          0
          • F Fausto01 has marked this topic as solved on

          • Login

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