Skip to content

Instantly share code, notes, and snippets.

@llCorvinSll
Created November 3, 2013 09:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save llCorvinSll/7288566 to your computer and use it in GitHub Desktop.
Save llCorvinSll/7288566 to your computer and use it in GitHub Desktop.
Qt subdirs project and setup deps between subprojects
include( ../common.pri )
TEMPLATE = app
SOURCES += main.cpp
LIBS += -L../logic -llogic \
-L../gui -lgui
# Will build the final executable in the main project directory.
TARGET = ../project
#Includes common configuration for all subdirectory .pro files.
INCLUDEPATH += . ..
TEMPLATE = lib
#remove main.cpp to prevent multiple compilation
SOURCES -= main.cpp
# The following keeps the generated files at least somewhat separate
# from the source files.
UI_DIR = uics
MOC_DIR = mocs
OBJECTS_DIR = objs
include( ../common.pri )
FORMS += gui.ui
HEADERS += gui.h
SOURCES += gui.cpp
include( ../common.pri )
HEADERS += logic.h
SOURCES += logic.cpp
TEMPLATE = subdirs
SUBDIRS = logic \
gui
# build must be last:
CONFIG += ordered
SUBDIRS += build
project_dir/
-project.pro
-common.pri
-logic/
----logic.pro
----some logic files
-gui/
----gui.pro
----gui files
-build/
----build.pro
----main.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment