Hello experts,
currently trying to move from qmake to cmake. Starting point in my Framework 
was using qmake2cmake tool. This generated a bunch of heavy cmake files, 
stripped them down and got it working that my integrated internal libs are 
building on windows.
I have managed to get building and running working under MSVC. Now I stuck with 
Android, my libraries and UI components in applets are building, also the final 
shared lib for EuroSoft_live is building but build process stops with following 
error:
­čĹÄ Fehler: Cannot find application binary in build dir 
D:/Projects/QtEuroSoftProjectQt6/build/Android_Qt_5_15_10_Clang_Multi_Abi-Debug/android-build//libs/armeabi-v7a/libEuroSoftProject_armeabi-v7a.so<https://v7a.so/>.

Project structure:
EuroSoftProject
CMakeLists.txt
- applications
CMakeLists.txt
- EuroSoft_live
CMakeLists.txt
- applets
- libraries
..

Why does the compiler search for libEuroSoftProject... and not for 
libEuroSoft_live...? When i remove the project tag from root CMakeLists.txt it 
searches for libProject... The final libEuroSoft_live is already exisiting in 
build-dir/android-build/libs/armeabi-v7a/...

Do you have any advice for me?

Regards Michael

SYSTRONIK Elektronik u. Systemtechnik GmbH, Gewerbestr. 57, D-88636 Illmensee
Registergericht Ulm - HRB 710423, Sitz der Gesellschaft Illmensee, USt-IdNr. DE 
811 264 405
Gesch├Ąftsf├╝hrer: Dipl.-VW Elmar Fritz, Ing. Ramon J. van Tuijl, Dipl.-Ing. (FH) 
Richard Skoberla

Diese E-Mail enth├Ąlt vertrauliche und/oder rechtlich gesch├╝tzte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder die E-Mail irrt├╝mlich erhalten 
haben, informieren
Sie bitte sofort den Absender und l├Âschen Sie die E-Mail. Das unerlaubte 
Kopieren sowie die unbefugte Weitergabe der E-Mail ist nicht gestattet.

This e-mail may contain confidential and / or privileged information. If you 
are not the intended recipient or the e-mail may contain error, inform you 
immediately ask the sender and delete the e-mail. Unauthorized copying, 
unauthorized disclosure of e-mail is strictly forbidden.
cmake_minimum_required(VERSION 3.16)
set(APPLICATION_COPYRIGHT "2015-2022")
set(APPLICATION_NAME "EuroSoft live")
set(ORGANIZATION_DOMAIN "www.systronik.com")
set(ORGANIZATION_NAME "Systronik")
set(APPLICATION_VERSION 2.11.0)

include(${CMAKE_CURRENT_SOURCE_DIR}/../../global_conf.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../global_functions.cmake)

project(EuroSoft_live VERSION ${APPLICATION_VERSION} LANGUAGES CXX)

# Set up AUTOMOC and some sensible defaults for runtime execution
# When using Qt 6.3, you can replace the code block below with
# qt_standard_project_setup()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt5 Qt6 COMPONENTS Core REQUIRED)
find_package(Qt5  COMPONENTS Bluetooth Charts Concurrent Gui Multimedia Network 
Qml Quick Script Sql WebSockets WebChannel Widgets Xml REQUIRED)
if(ANDROID)
    find_package(Qt5 COMPONENTS AndroidExtras PrintSupport REQUIRED)
endif()
if(MSVC OR MACOS)
    find_package(Qt5 COMPONENTS SerialPort PrintSupport REQUIRED)
endif()

# Resources:

file (GLOB_RECURSE 3rdarty_headers CONFIGURE_DEPENDS 
"../../libraries/3rdparty/*.h")

set (3rdparty_includeDirs "")
foreach (_headerFile ${3rdarty_headers})
    get_filename_component(_dir ${_headerFile} PATH)
    list (APPEND EuroSoftUi_includeDirs ${_dir})
endforeach()
list (REMOVE_DUPLICATES 3rdparty_includeDirs)

include_directories(
    ..
    ${3rdparty_includeDirs}
    ../../libraries/EuroSoft/..
    ../../libraries/EuroSoftUi/..
)

set(EuroSoft_live_src
    ../../libraries/EuroSoftUi/supporting/ComponentInitializer.cpp 
../../libraries/EuroSoftUi/supporting/ComponentInitializer.h
    EuroSoftLiveController.cpp EuroSoftLiveController.h
    EuroSoftLiveViewQml.cpp EuroSoftLiveViewQml.h
    main.cpp
)

set(EuroSoft_live_rc
    EuroSoft_live.qrc
    ../../libraries/EuroSoft/EuroSoft.qrc
    ../../libraries/EuroSoftUi/EuroSoftUi.qrc
    ../../libraries/EuroSoftUi/EuroSoftUi_resources.qrc
    ../../applets/measurement/measurement.qrc
    ../../applets/settings/settings.qrc
    ../../libraries/3rdparty/3rdparty.qrc
    ../../textdata/ApplicationMetaData/EuroSoftProject_metadata.qrc
    ../../translations/compiled/EuroSoftProject_translations.qrc
    ../../translations/compiled/qtbase_translations.qrc
    ../../translations/compiled/qtconnectivity_translations.qrc
    ../../translations/compiled/qtquickcontrols_translations.qrc
)

if(MSVC)
    set(EuroSoft_live_rc
        ${EuroSoft_live_rc}
        
../../libraries/EuroSoft/loggerconfig/supporting/images/CapbsSensIcons.qrc
    )
    enable_language("RC")

    add_executable(${PROJECT_NAME} WIN32
        ${EuroSoft_live_src}
        ${EuroSoft_live_rc}
        ${CMAKE_CURRENT_SOURCE_DIR}/windows/icon.rc
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/EuroSoft/Win10Compatibility.manifest
    )
elseif(ANDROID)
    set(ANDROID_MIN_SDK_VERSION CACHE INTERNAL 23)
    set(ANDROID_PACKAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/android CACHE INTERNAL 
"")
    set(QT_ANDROID_BUILD_ALL_ABIS CACHE INTERNAL ON)
    set(QT_ANDROID_APP_NAME CACHE INTERNAL "${APPLICATION_NAME}")
    set(QT_ANDROID_APP_VERSION CACHE INTERNAL "${APPLICATION_VERSION}")
    set(QT_ANDROID_APP_VERSION_CODE CACHE INTERNAL 123456)
    set(QT_ANDROID_APPLICATION_BINARY CACHE INTERNAL "EuroSoft_live")

    file(GLOB_RECURSE ANDROID_SOURCES
      ${QT_ANDROID_PACKAGE_SOURCE_DIR}/AndroidManifest.xml
      ${QT_ANDROID_PACKAGE_SOURCE_DIR}/build.gradle
      ${QT_ANDROID_PACKAGE_SOURCE_DIR}/gradle.properties
      ${QT_ANDROID_PACKAGE_SOURCE_DIR}/gradle/wrapper/gradle-wrapper.jar
      ${QT_ANDROID_PACKAGE_SOURCE_DIR}/gradle/wrapper/gradle-wrapper.properties
      ${QT_ANDROID_PACKAGE_SOURCE_DIR}/gradlew
      ${QT_ANDROID_PACKAGE_SOURCE_DIR}/res/values/libs.xml
      ${QT_ANDROID_PACKAGE_SOURCE_DIR}/src/*.java
    )
    add_library(${PROJECT_NAME} SHARED
        ${EuroSoft_live_src}
        ${EuroSoft_live_rc}
        ${ANDROID_SOURCES})

    if(QT_ANDROID_BUILD_ALL_ABIS)
        set_target_properties(${PROJECT_NAME} PROPERTIES ANDROID_ABIS 
"armeabi-v7a;arm64-v8a")
    endif()

    add_custom_command(
            TARGET ${PROJECT_NAME} PRE_LINK
            COMMAND ${CMAKE_COMMAND} -E copy_directory
                    
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/EuroSoft/nativetools/platforms/android
                    
${CMAKE_CURRENT_SOURCE_DIR}/android/src/com/systronik/platforms/android)

#    set(COPY_TO_PATH 
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/libEuroSoftProject_${ANDROID_ABI}.so)
#    add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
#                       COMMAND ${CMAKE_COMMAND} -E copy
#                           $<TARGET_FILE:${PROJECT_NAME}>
#                           ${COPY_TO_PATH}
#                       COMMENT "Copying '${PROJECT_NAME}' library to 
'${COPY_TO_PATH}'")


    #set(COPY_PATH 
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/../../android-build/libs/${ANDROID_ABI})
    set(COPY_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
    add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
        ${COPY_PATH}/lib${PROJECT_NAME}_${ANDROID_ABI}.so
        ${COPY_PATH}/libEuroSoftProject_${ANDROID_ABI}.so
    )
else()
    add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
        EuroSoft_live_src
        EuroSoft_live_rc)
endif()

target_include_directories(${PROJECT_NAME} PRIVATE
    ../../applets/measurement/..
    ../../applets/settings/..
    ${3rdparty_includeDirs}
    ../../libraries/EuroSoft/..
    ../../libraries/EuroSoftUi/..
)

target_compile_definitions(${PROJECT_NAME} PRIVATE
    DISABLE_LIBRARY_FEATURES
    EXTERNAL_COMPILER
    NCREPORT_IMPORT
    NCREPORT_NO_QPRINTER
    QT_DISABLE_DEPRECATED_BEFORE=0x050F00
    APPLICATION_COPYRIGHT="2015-2022"
    APPLICATION_NAME="EuroSoft live"
    ORGANIZATION_DOMAIN="www.systronik.com"
    ORGANIZATION_NAME="Systronik"
    APPLICATION_VERSION="2.11.0"

)

if(${build_lib_measurementApplets})
    target_compile_definitions(${PROJECT_NAME} PUBLIC
        ENABLE_MEASUREMENT_APPLETS
    )
endif()

target_link_libraries(${PROJECT_NAME} PRIVATE
    Qt::Bluetooth
    Qt::Charts
    Qt::Concurrent
    Qt::Core
    Qt::Gui
    Qt::Multimedia
    Qt::Network
    Qt::Qml
    Qt::Quick
    Qt::Script
    Qt::Sql
    Qt::WebSockets
    Qt::Widgets
    Qt::Xml
)

if(CMAKE_BUILD_TYPE STREQUAL Release)
    target_compile_definitions(${PROJECT_NAME} PRIVATE
        QT_NO_DEBUG_OUTPUT
    )
endif()
if(NOT MACOS)
    set_target_properties(${PROJECT_NAME} PROPERTIES
        MACOSX_BUNDLE FALSE
    )
endif()

if(MSVC)
    target_compile_definitions(${PROJECT_NAME} PRIVATE
        BUILD_DLL
        QCUSTOMPLOT_USE_OPENGL
        MP
    )

    target_link_libraries(${PROJECT_NAME} PRIVATE
        ${CMAKE_CURRENT_BINARY_DIR}/../../applets/measurement/measurement.lib
        ${CMAKE_CURRENT_BINARY_DIR}/../../applets/settings/settings.lib
        ${CMAKE_CURRENT_BINARY_DIR}/../../libraries/EuroSoft/EuroSoft.lib
        ${CMAKE_CURRENT_BINARY_DIR}/../../libraries/EuroSoftUi/EuroSoftUi.lib
        
${CMAKE_CURRENT_BINARY_DIR}/../../libraries/3rdparty/QCustomPlot/QCustomPlot.lib
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/QuickDownload/lib/win/QuickDownload${LIB_SUFFIX}.lib
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/SCodes/lib/win/SCodes${LIB_SUFFIX}.lib
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/S6600RemoteDisplay/lib/win/S6600RemoteDisplay${LIB_SUFFIX}.lib
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/ncreport/lib/win/NCReport${LIB_SUFFIX}2.lib
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/ncreport/lib/win/NCReportZint${LIB_SUFFIX}2.lib
        Qt::PrintSupport
        Qt::WebChannel
        SetupAPI
        hid
        user32
        opengl32.lib
    )
endif()

if(ANDROID)
    target_compile_definitions(${PROJECT_NAME} PRIVATE
        QCUSTOMPLOT_USE_OPENGL
    )

    target_link_libraries(${PROJECT_NAME} PRIVATE
        ${CMAKE_CURRENT_BINARY_DIR}/../../applets/measurement/libmeasurement.a
        ${CMAKE_CURRENT_BINARY_DIR}/../../applets/settings/libsettings.a
        ${CMAKE_CURRENT_BINARY_DIR}/../../libraries/EuroSoft/libEuroSoft.a
        ${CMAKE_CURRENT_BINARY_DIR}/../../libraries/EuroSoftUi/libEuroSoftUi.a
        
${CMAKE_CURRENT_BINARY_DIR}/../../libraries/3rdparty/QCustomPlot/libQCustomPlot.a
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/QuickDownload/lib/android_${ANDROID_ABI}/libQuickDownload${LIB_SUFFIX}.a
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/SCodes/lib/android_${ANDROID_ABI}/libSCodes${LIB_SUFFIX}.a
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/S6600RemoteDisplay/lib/android_${ANDROID_ABI}/libS6600RemoteDisplay${LIB_SUFFIX}.a
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/ncreport/lib/android_${ANDROID_ABI}/libNCReport${LIB_SUFFIX}_${ANDROID_ABI}.so
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/ncreport/lib/android_${ANDROID_ABI}/libNCReportZint${LIB_SUFFIX}_${ANDROID_ABI}.so
        Qt::WebChannel
        Qt::AndroidExtras
        Qt::PrintSupport
        EGL
        GLESv2
    )

    list(APPEND CUSTOM_ANDROID_EXTRA_LIBS 
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/ncreport/lib/android_${ANDROID_ABI}/libNCReport${LIB_SUFFIX}_${ANDROID_ABI}.so)
    list(APPEND CUSTOM_ANDROID_EXTRA_LIBS 
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/ncreport/lib/android_${ANDROID_ABI}/libNCReportZint${LIB_SUFFIX}_${ANDROID_ABI}.so)
    list(REMOVE_DUPLICATES CUSTOM_ANDROID_EXTRA_LIBS)
    string(REPLACE ";" "," CUSTOM_ANDROID_EXTRA_LIBS_STRING 
"${CUSTOM_ANDROID_EXTRA_LIBS}")
    set(ANDROID_EXTRA_LIBS "${CUSTOM_ANDROID_EXTRA_LIBS_STRING}" CACHE INTERNAL 
"")
endif()

if(IOS)
    target_compile_definitions(${PROJECT_NAME} PRIVATE
        QT_NO_PRINTER
    )

    target_link_libraries(${PROJECT_NAME} PRIVATE
        "-framework Photos"
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/ncreport/lib/ios/libNCReport.a
        
${CMAKE_CURRENT_SOURCE_DIR}/../../libraries/3rdparty/ncreport/lib/ios/libNCReportZint.a
    )
endif()

if(MACOS)
    target_compile_definitions(${PROJECT_NAME} PRIVATE
        QT_NO_PRINTER
    )

    target_link_libraries(${PROJECT_NAME} PRIVATE
        "-framework NCReport"
        NCReportZint
    )
endif()

if(MACOS OR MSVC)
    target_link_libraries(${PROJECT_NAME} PRIVATE
        Qt::SerialPort
    )
endif()

if(MSVC)

endif()

#install(TARGETS ${PROJECT_NAME}
#    BUNDLE DESTINATION .
#    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})


# Consider using qt_generate_deploy_app_script() for app deployment if
# the project can use Qt 6.3. In that case rerun qmake2cmake with
# --min-qt-version=6.3.
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
  • [Interest] Qm... Michael Heiser | SYSTRONIK Elektronik und Systemtechnik GmbH
    • Re: [Int... Alexey Edelev
      • Re: ... Michael Heiser | SYSTRONIK Elektronik und Systemtechnik GmbH
        • ... Michael Heiser | SYSTRONIK Elektronik und Systemtechnik GmbH

Reply via email to