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. Distribute Library
Forum Updated to NodeBB v4.3 + New Features

Distribute Library

Scheduled Pinned Locked Moved Qt Creator and other tools
12 Posts 2 Posters 3.0k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    Rexona for men
    wrote on last edited by
    #1

    And another question, even if my other thread hasn't got any replies yet =S

    It's fairly easy to change the place where an executable or lib file being built should be placed. However, for a lib file to be useful I need also the corresponding C++ header files, which are located in my project directory.
    Is there a way to command QtCreator to copy all or only some marked header files into a differenct folder where also the lib file might reside?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you thinking about using this lib in another sub-project in the same project ? Or when you're done building you are going to install it ?

      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
      • R Offline
        R Offline
        Rexona for men
        wrote on last edited by
        #3

        No, it's not the same project.

        All I want to do is bundle the lib and header files together into one directory, possible divided into include and lib sub-directories.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          In that case you should take a look at the INSTALLS variable in qmake's variable reference documentation, it should provide you what you want.

          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
          • R Offline
            R Offline
            Rexona for men
            wrote on last edited by
            #5

            Hm, INSTALLS seems they way to go, if I understood it correctly.
            I tried the following, but it doesn't work:

            @distHeaders.path = $$PWD/../../dist/include/
            distHeaders.files = $$HEADERS

            debug:target.path = $$PWD/../../dist/debug/
            release:target.path = $$PWD/../../dist/release/

            INSTALLS += distHeaders
            INSTALLS += target@

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Rexona for men
              wrote on last edited by
              #6

              Ok, I tried some minimal example:

              @QT -= core gui

              TARGET = TestLib
              TEMPLATE = lib
              CONFIG += staticlib

              SOURCES += testlib.cpp

              HEADERS += testlib.h

              target.path = $$PWD/../dist
              INSTALLS += target

              test.path = $$PWD/../dist
              test.files = testLib.h
              INSTALLS += test@

              Wasn't succesful though.
              So I tought about using make manually, actually I'm not sure whether QtCreator supports installing at all.
              Make however complained about some missing seperators, the buggy lines look like this:

              @{..\TestLib}.cxx{debug}.obj::
              $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
              $<
              <<@

              I changed it to this:

              @{..\TestLib}.cxx{debug}.obj::
              $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
              $<
              <<@

              E: some whitespaces were magically removed.., just imagine the two inner lines with four spaces in front =D

              and make install actually worked, the files were copied.
              But now, buidling the library in QtCreator doesn't work anymore, it tells that testlib.obj cannot be open.
              Removing the "" or running qmake from QtCreator fixes this, but now the makefile is buggy again, so installing doesn't work.

              Whatsoever, did I something wrong or is this a bug?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Did you call make install ?

                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
                • R Offline
                  R Offline
                  Rexona for men
                  wrote on last edited by
                  #8

                  Yes, from the console.

                  As described in my post above, I had to "fix" the makefile to make it work.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Sorry I misread your last post.

                    Then there might be a bug in the Makefile generator. Did you check the "bug report system":http://bugreports.qt-project.org to see whether it's a know issue ?

                    What OS are you on ? I'll try to reproduce it

                    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
                    • R Offline
                      R Offline
                      Rexona for men
                      wrote on last edited by
                      #10

                      My OS is Windows Vista, though I got Ubuntu on this laptop, too. Currently I'm not able to pass the project to Ubuntu, but when I'm at home, I'll try.

                      Qt version is 5.1.1, QtCreator 2.8.1

                      I found also this:
                      https://bugreports.qt-project.org/browse/QTBUG-26455
                      I'm not sure wheter it's somehow related or not.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Might be, I'll try on OS X when I have some time later

                        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
                        • R Offline
                          R Offline
                          Rexona for men
                          wrote on last edited by
                          #12

                          Tested the make install command on Ubuntu with success, so it seems some windows thing.

                          1 Reply Last reply
                          0

                          • Login

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