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. [RESOLVED] Creator/qmake: Adding another project as a library on Windows
Forum Updated to NodeBB v4.3 + New Features

[RESOLVED] Creator/qmake: Adding another project as a library on Windows

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 2.1k 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.
  • J Offline
    J Offline
    Jesdisciple
    wrote on last edited by
    #1

    I managed to get this working on OS X using only Creator, but not in a cross-platform way. Now I'm trying to do it on Windows, and really it needs to be done cross-platform. A new requirement is that I also need it to work in Subversion. If it could even work for debug and release builds on all platforms, that would be sweet... but I think that's probably asking too much. I suspect I'll need to use some fancy qmake code, but what I've learned of it in the past is rather rusty.

    On OS X I had linked to the other project as an external library, but I'm not sure how well that would work in Subversion. Because these are test/example projects I expect them to be volatile, so one repo per project would be inconvenient. I intend to store multiple Qt projects in one repo, but they might not all be checked out together. If I use svn:externals I can ensure all the right libraries are always included, at the expense of duplicate versions of library projects within the projects that use them. This would make Creator's option for internal libraries more appropriate.

    I built my library project on Windows 7 but cannot find a .lib file for it anywhere, although I do have empty debug and release folders (in the build marked Debug... odd). Creator's wizard for internal libraries wants me to select a folder, but I can't find one to select which allows me to continue the wizard. Part of the issue here is that the dependent project always looks for iOS build directories, but that seems to be simplest problem to solve.

    So, does anyone have some advice? (Maybe I should split the SVN portion into a more relevant community, but I'm thinking it'd be best to get help with it from someone who also knows Creator/qmake.)

    EDIT:

    The dependent project's .pro file (with legacy code from OS X, broken on Windows):

    @#-------------------------------------------------

    Project created by QtCreator 2013-05-25T08:57:00

    #-------------------------------------------------

    QT += core gui widgets

    TARGET = FourSquare
    TEMPLATE = app
    CONFIG += c++11

    SOURCES +=
    mainwindow.cpp
    main.cpp
    sprite.cpp
    boxview.cpp

    HEADERS += mainwindow.h
    sprite.h
    boxview.h

    FORMS += mainwindow.ui

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qnity/build-Qnity-iOS_Simulator-Release/release/ -lQnity
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qnity/build-Qnity-iOS_Simulator-Release/debug/ -lQnity
    else:unix: LIBS += -L$$PWD/../../Qnity/build-Qnity-iOS_Simulator-Release/ -lQnity

    INCLUDEPATH += $$PWD/../../Qnity/build-Qnity-iOS_Simulator-Release
    INCLUDEPATH += $$PWD/../../Qnity/Qnity
    DEPENDPATH += $$PWD/../../Qnity/build-Qnity-iOS_Simulator-Release

    win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../Qnity/build-Qnity-iOS_Simulator-Release/release/Qnity.lib
    else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Qnity/build-Qnity-iOS_Simulator-Release/debug/Qnity.lib
    else:unix: PRE_TARGETDEPS += $$PWD/../../Qnity/build-Qnity-iOS_Simulator-Release/libQnity.a

    cache()
    @

    The library project's .pro file:
    @#-------------------------------------------------

    Project created by QtCreator 2013-05-24T05:02:43

    #-------------------------------------------------

    QT += widgets opengl

    TARGET = Qnity
    TEMPLATE = lib
    CONFIG += staticlib c++11

    QMAKE_CXXFLAGS = -std=c++11

    SOURCES +=
    entity.cpp
    typed.cpp
    system.cpp
    entitymanager.cpp
    component.cpp

    HEADERS += entity.h
    typed.h
    system.h
    entitymanager.h
    component.h
    @

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jesdisciple
      wrote on last edited by
      #2

      My answer is at the bottom of http://qt-project.org/quarterly/view/using_cmake_to_build_qt_projects - namely, use CMake. The project's complexity has quickly outgrown QMake. (I discovered this first-hand by trying to re-implement the shadow-builds feature in my .pro file. I got awfully close, but QMake has some implementation details which make it impossible.)

      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