Factorized common qmake parts
This commit is contained in:
parent
08d7b56f00
commit
02e839406c
8 changed files with 22 additions and 101 deletions
12
src/common.pri
Normal file
12
src/common.pri
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
INCLUDEPATH += ..
|
||||||
|
|
||||||
|
CONFIG(debug) {
|
||||||
|
DESTDIR = ../../build/debug/
|
||||||
|
MAKEFILE = Makefile.debug
|
||||||
|
} else {
|
||||||
|
DESTDIR = ../../build/release/
|
||||||
|
MAKEFILE = Makefile.release
|
||||||
|
}
|
||||||
|
|
||||||
|
release:DEFINES += NDEBUG
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
OBJECTS = ${SOURCES:%.c=${OBJPATH}/%.o}
|
|
||||||
|
|
||||||
ifeq (${BUILDMODE},debug)
|
|
||||||
CC_FLAGS += -g
|
|
||||||
CC_LDFLAGS += -g
|
|
||||||
endif
|
|
||||||
ifeq (${BUILDMODE},release)
|
|
||||||
CC_FLAGS += -O3 -DNDEBUG -Wno-unused-variable -Wno-unused-but-set-variable
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (,${LIBS})
|
|
||||||
CC_FLAGS += $(shell pkg-config --cflags ${LIBS})
|
|
||||||
CC_LDFLAGS += $(shell pkg-config --libs ${LIBS})
|
|
||||||
endif
|
|
||||||
|
|
||||||
CC_FLAGS += -fPIC -Wall -I${PROJECT_PATH}/src
|
|
||||||
CC_LDFLAGS += -fPIC -lm
|
|
||||||
|
|
||||||
all:prepare ${RESULT}
|
|
||||||
|
|
||||||
prepare:
|
|
||||||
mkdir -p ${BUILDPATH}
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f ${OBJECTS}
|
|
||||||
rm -f ${RESULT}
|
|
||||||
|
|
||||||
${OBJPATH}/%.o:%.c ${HEADERS}
|
|
||||||
mkdir -p `dirname $@`
|
|
||||||
${CC} -c ${CC_FLAGS} $< -o $@
|
|
||||||
|
|
||||||
${RESULT}:${OBJECTS}
|
|
||||||
${CC} $^ ${CC_LDFLAGS} -o $@
|
|
||||||
|
|
||||||
.PHONY:all clean prepare
|
|
|
@ -1,11 +0,0 @@
|
||||||
ifeq ($(strip $(BUILDMODE)),)
|
|
||||||
exit 1
|
|
||||||
endif
|
|
||||||
ifeq ($(strip $(PROJECT_PATH)),)
|
|
||||||
exit 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
PATH_LIB_PAYSAGES = ${PROJECT_PATH}/rendering
|
|
||||||
BUILDMODE = debug
|
|
||||||
BUILDPATH = ${PROJECT_PATH}/build/${BUILDMODE}
|
|
||||||
HEADERS = $(${PATH_LIB_PAYSAGES}/atmosphere/*.h ${PATH_LIB_PAYSAGES}/clouds/*.h ${PATH_LIB_PAYSAGES}/terrain/*.h ${PATH_LIB_PAYSAGES}/textures/*.h ${PATH_LIB_PAYSAGES}/water/*.h ${PATH_LIB_PAYSAGES}/tools/*.h ${PATH_LIB_PAYSAGES}/shared/*.h)
|
|
|
@ -1,23 +1,14 @@
|
||||||
|
include(../common.pri)
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
CONFIG += console
|
CONFIG += console
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
|
|
||||||
TARGET = paysages-cli
|
TARGET = paysages-cli
|
||||||
INCLUDEPATH += ..
|
|
||||||
|
|
||||||
CONFIG(debug) {
|
|
||||||
DESTDIR = ../../build/debug/
|
|
||||||
MAKEFILE = Makefile.debug
|
|
||||||
} else {
|
|
||||||
DESTDIR = ../../build/release/
|
|
||||||
MAKEFILE = Makefile.release
|
|
||||||
}
|
|
||||||
|
|
||||||
OBJECTS_DIR = $$DESTDIR/controlling/
|
OBJECTS_DIR = $$DESTDIR/controlling/
|
||||||
|
|
||||||
release:DEFINES += NDEBUG
|
|
||||||
|
|
||||||
DEPENDPATH += ..
|
DEPENDPATH += ..
|
||||||
linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering
|
linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,15 @@
|
||||||
|
include(../common.pri)
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
CONFIG += qt
|
CONFIG += qt
|
||||||
|
|
||||||
QT += core gui opengl
|
QT += core gui opengl
|
||||||
|
|
||||||
TARGET = paysages-gui
|
TARGET = paysages-gui
|
||||||
INCLUDEPATH += ..
|
|
||||||
|
|
||||||
CONFIG(debug) {
|
|
||||||
DESTDIR = ../../build/debug/
|
|
||||||
MAKEFILE = Makefile.debug
|
|
||||||
} else {
|
|
||||||
DESTDIR = ../../build/release/
|
|
||||||
MAKEFILE = Makefile.release
|
|
||||||
}
|
|
||||||
|
|
||||||
OBJECTS_DIR = $$DESTDIR/editing/
|
OBJECTS_DIR = $$DESTDIR/editing/
|
||||||
MOC_DIR = $$OBJECTS_DIR/moc/
|
MOC_DIR = $$OBJECTS_DIR/moc/
|
||||||
|
|
||||||
release:DEFINES += NDEBUG
|
|
||||||
|
|
||||||
DEPENDPATH += ..
|
DEPENDPATH += ..
|
||||||
linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering -lpaysages_exploring -lGLU
|
linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering -lpaysages_exploring -lGLU
|
||||||
win32:LIBS += ../../libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0
|
win32:LIBS += ../../libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0
|
||||||
|
|
|
@ -1,23 +1,14 @@
|
||||||
|
include(../common.pri)
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += console
|
CONFIG += console
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
|
|
||||||
TARGET = paysages_exploring
|
TARGET = paysages_exploring
|
||||||
INCLUDEPATH += ..
|
|
||||||
|
|
||||||
CONFIG(debug) {
|
|
||||||
DESTDIR = ../../build/debug/
|
|
||||||
MAKEFILE = Makefile.debug
|
|
||||||
} else {
|
|
||||||
DESTDIR = ../../build/release/
|
|
||||||
MAKEFILE = Makefile.release
|
|
||||||
}
|
|
||||||
|
|
||||||
OBJECTS_DIR = $$DESTDIR/exploring/
|
OBJECTS_DIR = $$DESTDIR/exploring/
|
||||||
|
|
||||||
release:DEFINES += NDEBUG
|
|
||||||
|
|
||||||
SOURCES += main.c \
|
SOURCES += main.c \
|
||||||
terrain.c \
|
terrain.c \
|
||||||
sky.c \
|
sky.c \
|
||||||
|
|
|
@ -1,23 +1,14 @@
|
||||||
|
include(../common.pri)
|
||||||
|
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += console
|
CONFIG += console
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
|
|
||||||
TARGET = paysages_rendering
|
TARGET = paysages_rendering
|
||||||
INCLUDEPATH += ..
|
|
||||||
|
|
||||||
CONFIG(debug) {
|
|
||||||
DESTDIR = ../../build/debug/
|
|
||||||
MAKEFILE = Makefile.debug
|
|
||||||
} else {
|
|
||||||
DESTDIR = ../../build/release/
|
|
||||||
MAKEFILE = Makefile.release
|
|
||||||
}
|
|
||||||
|
|
||||||
OBJECTS_DIR = $$DESTDIR/rendering/
|
OBJECTS_DIR = $$DESTDIR/rendering/
|
||||||
|
|
||||||
release:DEFINES += NDEBUG
|
|
||||||
|
|
||||||
linux-clang {
|
linux-clang {
|
||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
PKGCONFIG += glib-2.0 gthread-2.0 IL ILU
|
PKGCONFIG += glib-2.0 gthread-2.0 IL ILU
|
||||||
|
|
|
@ -1,23 +1,14 @@
|
||||||
|
include(../common.pri)
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
CONFIG += console
|
CONFIG += console
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
|
|
||||||
TARGET = paysages-tests
|
TARGET = paysages-tests
|
||||||
INCLUDEPATH += ..
|
|
||||||
|
|
||||||
CONFIG(debug) {
|
|
||||||
DESTDIR = ../../build/debug/
|
|
||||||
MAKEFILE = Makefile.debug
|
|
||||||
} else {
|
|
||||||
DESTDIR = ../../build/release/
|
|
||||||
MAKEFILE = Makefile.release
|
|
||||||
}
|
|
||||||
|
|
||||||
OBJECTS_DIR = $$DESTDIR/testing/
|
OBJECTS_DIR = $$DESTDIR/testing/
|
||||||
|
|
||||||
release:DEFINES += NDEBUG
|
|
||||||
|
|
||||||
linux-clang {
|
linux-clang {
|
||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
PKGCONFIG += check
|
PKGCONFIG += check
|
||||||
|
|
Loading…
Reference in a new issue