Qt World Summit: Submit your Presentation

XCode not building dependencies

  • I have a large Qt application that I build and run on Windows/Linux/iOS. I recently switch from a SUBDIRS project with an ordered build structure to a dependency-based build structure. My Windows and Linux builds are fine, but my iOS build refuses to follow the dependency tree and build the dependencies. Here is my top-level project file:

    CONFIG += c++11
    TEMPLATE = subdirs
    SUBDIRS = \
        tap_display_app \ # main executable
        aop_logger \
        aop_xml \
        aop_serial \
        aop_comm_base \
        aop_util \
        aop_measure \
        MoreMath \
        MathUtilities \
        DataCollection \
        DebugLogger \
        BufferedSharedMemory \
        AvionicsBus \
        AircraftDataModel \
        WindModel \
        TableLookups \
        configuration \
        AtosUtils \
        dna \
        aop_data \
        aop_comm \
        tap_data \
        tap_messaging \
        RouteContainer \
        arinc_io_adapter \
        aop_interface \
    tap_display_app.subdir = tap_display_app
    aop_logger.subdir = aop_logger
    aop_xml.subdir = aop_xml
    aop_comm_base.subdir = aop_comm_base
    aop_util.subdir = aop_util
    aop_measure.subdir = aop_measure
    MoreMath.subdir = MoreMath
    MathUtilities.subdir = MathUtilities
    DataCollection.subdir = DataCollection
    DebugLogger.subdir = DebugLogger
    BufferedSharedMemory.subdir = BufferedSharedMemory
    AvionicsBus.subdir = AvionicsBus
    AircraftDataModel.subdir = AircraftDataModel
    WindModel.subdir = WindModel
    TableLookups.subdir = TableLookups
    configuration.subdir = configuration
    AtosUtils.subdir = AtosUtils
    dna.subdir = dna
    aop_interface.subdir = aop_interface
    aop_data.subdir = aop_data
    aop_comm.subdir = aop_comm
    RouteContainer.subdir = RouteContainer
    tap_data.subdir = tap_data
    tap_common.subdir = tap_common
    arinc_io_adapter.subdir = arinc_io_adapter
    tap_messaging.subdir = tap_messaging
    tap_display_app.depends = aop_comm_base aop_data aop_interface aop_logger aop_measure aop_serial aop_util aop_xml configuration tap_common tap_data tap_messaging DataCollection TableLookups WindModel
    aop_serial.depends = aop_logger aop_xml
    aop_comm_base.depends = aop_serial
    aop_util.depends = aop_logger aop_xml aop_serial
    aop_measure.depends = aop_util
    AvionicsBus.depends = BufferedSharedMemory MoreMath DebugLogger
    MathUtilities.depends = MoreMath
    DataCollection.depends = MathUtilities
    AircraftDataModel.depends = DebugLogger MoreMath
    WindModel.depends = MoreMath
    configuration.depends = aop_logger aop_measure aop_serial aop_util AtosUtils
    dna.depends = aop_comm_base aop_interface aop_logger
    aop_interface.depends = aop_comm aop_comm_base aop_data aop_logger aop_measure aop_serial aop_util aop_xml configuration AvionicsBus RouteContainer
    aop_data.depends = aop_logger aop_measure aop_serial aop_util aop_xml configuration DataCollection MathUtilities MoreMath WindModel
    aop_comm.depends = aop_comm_base aop_data
    tap_data.depends = aop_data aop_logger aop_measure aop_serial aop_util aop_xml tap_common TableLookups WindModel
    tap_common.depends = aop_util aop_serial
    arinc_io_adapter.depends = aop_data aop_interface aop_logger aop_measure aop_serial aop_util AvionicsBus
    tap_messaging.depends = aop_comm_base aop_logger aop_measure aop_serial aop_util aop_xml tap_common tap_data

    The "tap_display_app" is the application's main executable and Xcode defaults to it as its first build target, which is correct. However, when I initiate the build, it only builds the main executable and then fails to link because none of the dependencies were built.

    Any idea why its ignoring the dependencies? Its probably important to point out that it works fine when in Qt Creator. Its only when I create the XCode project files that things go bad. I use the following to generate the XCode project files (from Terminal):

    qmake -spec macx-xcode -recursive

    Please don't tell me to go back to an ordered build.

  • On linux i make
    qmake file.pro
    Why all this -spec macx-xcode -recursive??
    build this tree in the same way as linux
    qmake && make
    thats all..
    or each dir a static lib...
    OSX Mac is linux in the core..

  • @patrik08 I'm not building for Mac, I am building for iOS. You cannot simply run "make". You need to generate XCode project files and tweak them in order to build for iOS. The -recursive is necessary or else the resulting project files will only contain the top-level project and not the projects in the subdirectories

  • I never open Xcode... only:
    xcodebuild -project QtAndSwift.xcodeproj -configuration "Release"

    xcodebuild i like make ...
    any time to open Xcode .. it takes too much time

  • @patrik08 Have you ever actually built for iOS though? There are settings that need to be set, which I have yet to figure out how to do with qmake. For example, selecting the target to be built, setting our team for provisioning, disabling bitcode and installing the target on a device. If I could do these things without running XCode, then perhaps your solution would be helpful.

  • Try to build a simply hello world for IOS in cmake
    its easy
    && xcodebuild
    The New QT Creator have also a better Cmake support ... well done..

    David & Goliad...
    like MuPDF vs poppler load a 20MB pdf
    the differences make an impression

  • @patrik08 Thats an excellent example. I may be able to use it.

  • Qt Champions 2020

    Guys, is any qmake's workaround for this issue? Because I'm too faced with this: https://bugreports.qt.io/browse/QTBUG-71566

    It makes the qmake && qt unusable at all in real development.

  • Lifetime Qt Champion

    @kuzulis Did you test the command provided after the UPD comment on the bug report ?

  • Qt Champions 2020

    That command provided by QtCreator and called automatically.. I have updated the bug-report.

Log in to reply