Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Adding a project to an existing project [solved]

Adding a project to an existing project [solved]

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 2 Posters 2.2k 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.
  • A Offline
    A Offline
    amontaz
    wrote on 23 Dec 2014, 16:52 last edited by
    #1

    Hi,

    I am new to Qt, so sorry if the question has been asked before (I couldn't find my answer).

    I have a project, containing 2 git sub-modules (sub-module A & B).
    Each of these sub-modules contain several other sub-modules ( Let's say A contains a, b ,c ,d & B contains a, b, c , e. A & B share some sub-modules).

    I added the sub-module A successfully and complied and ran my project. When I added the second sub-module, I got bunch of errors.

    I have the following problem:

    As A & B are sharing some same sub-modules ( a, b & c) and the sub-module's libraries are included in the header files, I get lots of errors mentioning repetitive definition of the same variables. In this case, I have my own project, sub-module A, and sub-module B. Is there any way to compile A & B independently inside my main project to prevent these kind of confusions?

    I don't want to change any of those sub-modules (A&B). I only can change my own project which uses A & B.

    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 23 Dec 2014, 21:53 last edited by
      #2

      Hi and welcome to devnet,

      How are you currently building your project ? What's your pro file setup ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        amontaz
        wrote on 23 Dec 2014, 22:10 last edited by
        #3

        Thanks

        I am building it using the hammer icon :)

        Here is my .pro file
        @
        QT += core gui

        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

        TARGET = GoLINC-esstest
        TEMPLATE = app
        CONFIG += debug
        DESTDIR = bin
        OBJECTS_DIR = build
        MOC_DIR = build
        UI_DIR = build

        QMAKE_CXXFLAGS = -std=c++0x

        #To be included in all future ESS projects
        include(esstestframework/essTestFramework.pri)

        INCLUDEPATH +=
        src/
        jbx7000-module-test/DCSupply/src/
        jbx7000-module-test/serialIPMI/src/
        curl-library/ \

        SOURCES +=
        src/main.cpp
        src/version.h \ #header file autogenerated by verGen at bottom
        src/golincrootmodule.cpp
        src/vlanConfig.cpp
        src/golincappmodule.cpp
        src/golincacc.cpp
        src/golinc_smm.cpp
        src/golinc_wcm.cpp
        src/golinc_psm.cpp
        curl-library/curlClass.cpp
        src/genericfunctions.cpp
        jbx7000-module-test/serialIPMI/IPMILib/ipmi_smm.c
        jbx7000-module-test/serialIPMI/IPMILib/smm_ipmi_cmds.c
        jbx7000-module-test/serialIPMI/IPMILib/ipmb.c
        jbx7000-module-test/src/SMMTest.cpp
        jbx7000-module-test/serialIPMI/src/serialIPMI.cpp
        jbx7000-module-test/serialIPMI/src/sendIPMI.cpp
        jbx7000-module-test/serialIPMI/IPMILib/smm_ipmi_cmds.c
        jbx7000-module-test/serialIPMI/IPMILib/ipmi_smm.c
        jbx7000-module-test/serialIPMI/IPMILib/flash_info.c
        jbx7000-module-test/serialIPMI/IPMILib/ipmb.c
        jbx7000-module-test/DCSupply/src/DCSupply.cpp

        HEADERS +=
        src/golincrootmodule.h
        src/vlanConfig.h
        src/golincappmodule.h
        src/golincacc.h
        src/golinc_smm.h
        src/golinc_wcm.h
        src/golinc_psm.h
        curl-library/curlClass.h
        src/genericfunctions.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmi_smm.h
        jbx7000-module-test/serialIPMI/IPMILib/smm_ipmi_cmd.h
        jbx7000-module-test/serialIPMI/IPMILib/smm_ipmi_cmds.h
        jbx7000-module-test/IserialIPMI/PMILib/iders_jbx7000_def.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmb.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmi-cmd-oem-common-spec.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmi-cmd-oem-iders-spec.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmi-netfn-spec.h
        jbx7000-module-test/GUI/splitString.h
        jbx7000-module-test/src/version.h
        jbx7000-module-test/src/SMMTest.h
        jbx7000-module-test/serialIPMI/src/serialIPMI.h
        jbx7000-module-test/serialIPMI/IPMILib/smm_ipmi_cmds.h
        jbx7000-module-test/serialIPMI/IPMILib/smm_ipmi_cmds_packed.h
        jbx7000-module-test/serialIPMI/IPMILib/smm_ipmi_cmd.h
        jbx7000-module-test/serialIPMI/IPMILib/flash_address_info.h
        jbx7000-module-test/serialIPMI/IPMILib/flash_info.h
        jbx7000-module-test/serialIPMI/IPMILib/iders_jbx7000_def.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmb.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmi_smm.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmi-cmd-oem-common-spec.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmi-cmd-oem-iders-spec.h
        jbx7000-module-test/serialIPMI/IPMILib/ipmi-netfn-spec.h
        jbx7000-module-test/DCSupply/src/DCSupply.h

        OTHER_FILES +=
        bin/config.txt
        bin/emails.txt
        bin/envConfig.txt
        bin/GoLINCTestConfig.txt
        jbx7000-module-test/serialIPMI/IPMILib/Makefile

        add the targets the list of extra targets

        QMAKE_EXTRA_TARGETS +=
        genVersion \

        copyModuleConfig \

        PRE_TARGETDEPS +=
        genVersion \

        copyModuleConfig \

        LIBS +=
        -lssh
        -lxml2
        -lcurl
        -lpcap
        -ltar
        -lsnmp
        -lreadline
        -L/usr/lib -lhidapi-libusb
        -lxml2 \

        Copying PTC3 module test config files to bin dir

        copyModuleConfig.target =
        copyModuleConfig.commands =
        echo "Copying PTC3 module test config files to bin dir";
        cp /jbx7000-module-test/bin/SMMconfig.txt /bin/SMMconfig.txt; \

        cp jbx7000-module-test/bin/SEAPMconfig.txt bin/SEAPMconfig.txt; \

        #cp jbx7000-module-test/bin/WCM2config.txt bin/WCM2config.txt; \
        #cp jbx7000-module-test/bin/PSMconfig.txt bin/SEAPMconfig.txt; \
        

        copyModuleConfig.depends =

        ########################## Start of genVersion ##########################

        auto generate the src/version.h file every time we build

        ** for new projects - copy this code into new .pro file and

        ** versionGenerator.h from esstestframework project into

        ** new project dir

        ** >git tag -a vx.x.x to set and increment version

        #########################################################################

        create a new build target

        genVersion.target =
        genVersion.commands =
        echo "Generating version header file";
        ./versionGenerator.sh;
        genVersion.depends =

        ########################## End of genVersion #############################
        @

        /jbx7000-module-tes is one of my sub-modules (Sub-module B)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 24 Dec 2014, 00:11 last edited by
          #4

          What I meant was: are you building them as sub projects or including their content in your main project. Looks like solution number 2.

          Are the common files of these two sub-modules the same ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            amontaz
            wrote on 24 Dec 2014, 16:10 last edited by
            #5

            It is number 2, I am including their content in my main project.
            They have common files and I think that causes the errors.
            How can I build them as sub projects?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 24 Dec 2014, 22:12 last edited by
              #6

              If these files are exactly the same, then only use them once in your pro file.

              Otherwise have a look at the qmake manual to see how you can do that with the subdirs template

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • A Offline
                A Offline
                amontaz
                wrote on 24 Dec 2014, 22:47 last edited by
                #7

                Thanks SGaist.
                I fixed the issue by editing the pro file.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 24 Dec 2014, 23:22 last edited by
                  #8

                  You're welcome !

                  Since you have it building now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  1/8

                  23 Dec 2014, 16:52

                  • Login

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