Switching all build system to qmake

This commit is contained in:
Michaël Lemaire 2013-08-22 23:45:46 +02:00
parent c46afa4152
commit 08d7b56f00
12 changed files with 208 additions and 132 deletions

30
.gitignore vendored
View file

@ -1,19 +1,19 @@
build/ /build/
cache/ /cache/
docs/ /docs/
data/i18n/paysages_*.qm /data/i18n/paysages_*.qm
gmon.out /gmon.out
nbproject/ /nbproject/
output/ /output/
src/editing/Makefile /src/*/Makefile.*
*.pro.user *.pro.user
*.pro.user.* *.pro.user.*
qrc_*.cpp qrc_*.cpp
ui_*.h ui_*.h
tags /tags
.session.vim /.session.vim
*-stamp /*-stamp
debian/*.log /debian/*.log
debian/files /debian/files
debian/*.substvars /debian/*.substvars
debian/paysages3d /debian/paysages3d

View file

@ -1,39 +1,58 @@
BUILDMODE=release BUILDMODE=release
BUILDPATH=./build/${BUILDMODE} BUILDPATH=./build/${BUILDMODE}
CC=gcc CC=gcc
MAKE=make MAKE=make -f Makefile.${BUILDMODE}
ifneq (,$(COMPILER)) ifneq (,$(COMPILER))
CC=$(COMPILER) CC=$(COMPILER)
endif endif
all: all:dirs makefiles
@+cd src/rendering && $(MAKE) CC=${CC} BUILDMODE=${BUILDMODE} PROJECT_PATH=${CURDIR} @+cd src/rendering && $(MAKE)
@+cd src/exploring && $(MAKE) CC=${CC} BUILDMODE=${BUILDMODE} PROJECT_PATH=${CURDIR} @+cd src/exploring && $(MAKE)
@+cd src/controlling && $(MAKE) CC=${CC} BUILDMODE=${BUILDMODE} PROJECT_PATH=${CURDIR} @+cd src/controlling && $(MAKE)
@+cd src/editing && qmake "BUILDMODE=${BUILDMODE}" "PROJECT_PATH=${CURDIR}" && $(MAKE) @+cd src/editing && $(MAKE)
@+cd src/testing && $(MAKE) CC=${CC} BUILDMODE=${BUILDMODE} PROJECT_PATH=${CURDIR} @+cd src/testing && $(MAKE)
dirs:
mkdir -p ${BUILDPATH}/rendering
mkdir -p ${BUILDPATH}/exploring
mkdir -p ${BUILDPATH}/controlling
mkdir -p ${BUILDPATH}/editing
mkdir -p ${BUILDPATH}/testing
makefiles:
@+cd src/rendering && qmake rendering.pro "CONFIG=$(BUILDMODE)" -r -spec linux-clang
@+cd src/exploring && qmake exploring.pro "CONFIG=$(BUILDMODE)" -r -spec linux-clang
@+cd src/controlling && qmake controlling.pro "CONFIG=$(BUILDMODE)" -r -spec linux-clang
@+cd src/editing && qmake editing.pro "CONFIG=${BUILDMODE}" -r -spec linux-clang
@+cd src/testing && qmake testing.pro "CONFIG=$(BUILDMODE)" -r -spec linux-clang
clean: clean:
cd src/rendering && $(MAKE) clean BUILDMODE=${BUILDMODE} PROJECT_PATH=${CURDIR} @+cd src/rendering && qmake "CONFIG=$(BUILDMODE)" && $(MAKE) clean
cd src/exploring && $(MAKE) clean BUILDMODE=${BUILDMODE} PROJECT_PATH=${CURDIR} @+cd src/exploring && qmake "CONFIG=$(BUILDMODE)" && $(MAKE) clean
cd src/controlling && $(MAKE) clean BUILDMODE=${BUILDMODE} PROJECT_PATH=${CURDIR} @+cd src/controlling && qmake "CONFIG=$(BUILDMODE)" && $(MAKE) clean
cd src/editing && qmake "BUILDMODE=${BUILDMODE}" "PROJECT_PATH=${CURDIR}" && $(MAKE) clean @+cd src/editing && qmake "CONFIG=${BUILDMODE}" && $(MAKE) clean
cd src/testing && $(MAKE) clean BUILDMODE=${BUILDMODE} PROJECT_PATH=${CURDIR} @+cd src/testing && qmake "CONFIG=$(BUILDMODE)" && $(MAKE) clean
rm -f src/rendering/Makefile
rm -f src/exploring/Makefile
rm -f src/controlling/Makefile
rm -f src/editing/Makefile
rm -f src/testing/Makefile
rm -f ${BUILDPATH}/paysages-cli rm -f ${BUILDPATH}/paysages-cli
rm -f ${BUILDPATH}/paysages-qt rm -f ${BUILDPATH}/paysages-gui
rm -f ${BUILDPATH}/paysages-tests rm -f ${BUILDPATH}/paysages-tests
rm -f ${BUILDPATH}/libpaysages_exploring.so rm -f ${BUILDPATH}/libpaysages_exploring.so*
rm -f ${BUILDPATH}/libpaysages_rendering.so rm -f ${BUILDPATH}/libpaysages_rendering.so*
docs: docs:
doxygen Doxyfile doxygen Doxyfile
debug: debug:
make BUILDMODE=debug all +make BUILDMODE=debug all
release: release:
make BUILDMODE=release all +make BUILDMODE=release all
tests: all tests: all
LD_LIBRARY_PATH=${BUILDPATH} CK_DEFAULT_TIMEOUT=30 ${BUILDPATH}/paysages-tests LD_LIBRARY_PATH=${BUILDPATH} CK_DEFAULT_TIMEOUT=30 ${BUILDPATH}/paysages-tests
@ -42,10 +61,10 @@ run_cli: all
LD_LIBRARY_PATH=${BUILDPATH} ${RUNNER} ${BUILDPATH}/paysages-cli LD_LIBRARY_PATH=${BUILDPATH} ${RUNNER} ${BUILDPATH}/paysages-cli
run: all run: all
LD_LIBRARY_PATH=${BUILDPATH} ${RUNNER} ${BUILDPATH}/paysages-qt LD_LIBRARY_PATH=${BUILDPATH} ${RUNNER} ${BUILDPATH}/paysages-gui
profile: debug profile: debug
LD_LIBRARY_PATH=build/debug perf record -g fp ./build/debug/paysages-qt LD_LIBRARY_PATH=build/debug perf record -g fp ./build/debug/paysages-gui
perf report -g perf report -g
profile_cli: debug profile_cli: debug
@ -56,7 +75,7 @@ install:release
mkdir -p ${DESTDIR}/usr/bin mkdir -p ${DESTDIR}/usr/bin
mkdir -p ${DESTDIR}/usr/lib mkdir -p ${DESTDIR}/usr/lib
mkdir -p ${DESTDIR}/usr/share/paysages3d mkdir -p ${DESTDIR}/usr/share/paysages3d
cp build/release/paysages-qt ${DESTDIR}/usr/bin/paysages3d cp build/release/paysages-gui ${DESTDIR}/usr/bin/paysages3d
cp build/release/libpaysages_exploring.so ${DESTDIR}/usr/lib/ cp build/release/libpaysages_exploring.so ${DESTDIR}/usr/lib/
cp build/release/libpaysages_rendering.so ${DESTDIR}/usr/lib/ cp build/release/libpaysages_rendering.so ${DESTDIR}/usr/lib/
cp data/.paysages_data ${DESTDIR}/usr/share/paysages3d/ cp data/.paysages_data ${DESTDIR}/usr/share/paysages3d/

View file

@ -1,10 +0,0 @@
include ../common_pre.mk
OBJPATH = ${BUILDPATH}/controlling
RESULT = ${BUILDPATH}/paysages-cli
SOURCES += $(wildcard *.c)
HEADERS += $(wildcard *.h)
CC_LDFLAGS += -L${BUILDPATH} -lpaysages_rendering
include ../common_post.mk

View file

@ -0,0 +1,25 @@
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
TARGET = paysages-cli
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/controlling/
release:DEFINES += NDEBUG
DEPENDPATH += ..
linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering
SOURCES += main.c

View file

@ -1,26 +1,29 @@
isEmpty(PROJECT_PATH) {
PROJECT_PATH = ../..
}
TEMPLATE = app TEMPLATE = app
CONFIG += qt CONFIG += qt
QT += core gui opengl QT += core gui opengl
DEPENDPATH += .
INCLUDEPATH += . TARGET = paysages-gui
DESTDIR = $$PROJECT_PATH/build/$$BUILDMODE/ 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/
CONFIG -= release
CONFIG += $$BUILDMODE
INCLUDEPATH += $$PROJECT_PATH/src/
release:DEFINES += NDEBUG release:DEFINES += NDEBUG
release:QMAKE_CXXFLAGS += -Wno-unused-variable -Wno-unused-parameter
unix:LIBS += -L$$DESTDIR -lpaysages_rendering -lpaysages_exploring -lGLU DEPENDPATH += ..
win32:LIBS += $$PROJECT_PATH/libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0 linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering -lpaysages_exploring -lGLU
win32:LIBS += ../../libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0
TRANSLATIONS = $$PROJECT_PATH/data/i18n/paysages_fr.ts TRANSLATIONS = ../../data/i18n/paysages_fr.ts
HEADERS += \ HEADERS += \
terrain/widgetheightmap.h \ terrain/widgetheightmap.h \

View file

@ -71,7 +71,11 @@ void MainTexturesForm::updateLayers()
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
ui->layersGrid->setItem(n - 1 - i, 1, item); ui->layersGrid->setItem(n - 1 - i, 1, item);
ui->layersGrid->setCellWidget(n - 1 - i, 2, new SmallMaterialPreview(ui->layersGrid, &layer->material)); QWidget* widget = new SmallMaterialPreview(ui->layersGrid, &layer->material);
//widget->setMinimumSize(50, 50);
ui->layersGrid->setCellWidget(n - 1 - i, 2, widget);
ui->layersGrid->setRowHeight(n - 1 - i, 50);
} }
ui->preview_cumul->setEnabled(n > 0); ui->preview_cumul->setEnabled(n > 0);

View file

@ -1,9 +0,0 @@
include ../common_pre.mk
OBJPATH = ${BUILDPATH}/exploring
RESULT = ${BUILDPATH}/libpaysages_exploring.so
SOURCES += $(wildcard *.c)
CC_LDFLAGS += -shared
include ../common_post.mk

View file

@ -0,0 +1,30 @@
TEMPLATE = lib
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
TARGET = paysages_exploring
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/exploring/
release:DEFINES += NDEBUG
SOURCES += main.c \
terrain.c \
sky.c \
chunk.c
HEADERS += main.h \
terrain.h \
sky.h \
chunk.h

View file

@ -1,17 +0,0 @@
include ../common_pre.mk
OBJPATH = ${BUILDPATH}/rendering
RESULT = ${BUILDPATH}/libpaysages_rendering.so
SOURCES += $(wildcard *.c atmosphere/*.c clouds/*.c terrain/*.c textures/*.c water/*.c tools/*.c shared/*.c)
LIBS += glib-2.0 gthread-2.0 IL ILU
CC_FLAGS += -DHAVE_GLIB=1
CC_LDFLAGS += -shared
#CHECK_OPENCL = $(shell pkg-config --modversion --silence-errors OpenCL)
#ifneq (,${CHECK_OPENCL})
# LIBS += OpenCL
# CC_FLAGS += -DHAVE_OPENCL=1
#endif
include ../common_post.mk

View file

@ -1,17 +1,30 @@
#-------------------------------------------------
#
# Project created by QtCreator 2013-05-01T12:27:33
#
#-------------------------------------------------
QT -= core gui
TARGET = rendering
TEMPLATE = lib TEMPLATE = lib
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
DEFINES += RENDERING_LIBRARY TARGET = paysages_rendering
INCLUDEPATH += ..
SOURCES += \ CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/rendering/
release:DEFINES += NDEBUG
linux-clang {
CONFIG += link_pkgconfig
PKGCONFIG += glib-2.0 gthread-2.0 IL ILU
}
DEFINES += HAVE_GLIB=1
SOURCES += main.c \
zone.c \ zone.c \
tools.c \ tools.c \
system.c \ system.c \
@ -23,23 +36,23 @@ SOURCES += \
noiseperlin.c \ noiseperlin.c \
noisenaive.c \ noisenaive.c \
noise.c \ noise.c \
main.c \
layers.c \ layers.c \
geoarea.c \ geoarea.c \
camera.c \ camera.c \
auto.c \
atmosphere/atm_render.c \ atmosphere/atm_render.c \
atmosphere/atm_raster.c \ atmosphere/atm_raster.c \
atmosphere/atm_preview.c \ atmosphere/atm_preview.c \
atmosphere/atm_presets.c \ atmosphere/atm_presets.c \
atmosphere/atm_definition.c \ atmosphere/atm_definition.c \
atmosphere/atm_bruneton.c \ atmosphere/atm_bruneton.c \
clouds/clo_tools.c \ clouds/clo_walking.c \
clouds/clo_rendering.c \ clouds/clo_rendering.c \
clouds/clo_preview.c \ clouds/clo_preview.c \
clouds/clo_presets.c \ clouds/clo_presets.c \
clouds/clo_density.c \
clouds/clo_definition.c \ clouds/clo_definition.c \
shared/preview.c \ shared/preview.c \
terrain/ter_render.c \
terrain/ter_raster.c \ terrain/ter_raster.c \
terrain/ter_preview.c \ terrain/ter_preview.c \
terrain/ter_presets.c \ terrain/ter_presets.c \
@ -56,9 +69,11 @@ SOURCES += \
tools/memory.c \ tools/memory.c \
tools/lighting.c \ tools/lighting.c \
tools/euclid.c \ tools/euclid.c \
tools/data.c \
tools/curve.c \ tools/curve.c \
tools/color.c \ tools/color.c \
tools/cache.c \ tools/cache.c \
tools/boundingbox.c \
tools/array.c \ tools/array.c \
water/wat_render.c \ water/wat_render.c \
water/wat_raster.c \ water/wat_raster.c \
@ -82,15 +97,19 @@ HEADERS += \
layers.h \ layers.h \
geoarea.h \ geoarea.h \
camera.h \ camera.h \
auto.h \
atmosphere/public.h \ atmosphere/public.h \
atmosphere/private.h \ atmosphere/private.h \
clouds/public.h \ clouds/public.h \
clouds/private.h \ clouds/private.h \
clouds/clo_walking.h \
clouds/clo_preview.h \
clouds/clo_density.h \
shared/types.h \ shared/types.h \
shared/preview.h \ shared/preview.h \
terrain/ter_raster.h \
terrain/public.h \ terrain/public.h \
terrain/private.h \ terrain/private.h \
textures/tex_preview.h \
textures/public.h \ textures/public.h \
textures/private.h \ textures/private.h \
tools/texture.h \ tools/texture.h \
@ -99,30 +118,12 @@ HEADERS += \
tools/memory.h \ tools/memory.h \
tools/lighting.h \ tools/lighting.h \
tools/euclid.h \ tools/euclid.h \
tools/data.h \
tools/curve.h \ tools/curve.h \
tools/color.h \ tools/color.h \
tools/cache.h \ tools/cache.h \
tools/boundingbox.h \
tools/array.h \ tools/array.h \
water/public.h \ water/public.h \
water/private.h water/private.h
symbian {
MMP_RULES += EXPORTUNFROZEN
TARGET.UID3 = 0xEC48CBFE
TARGET.CAPABILITY =
TARGET.EPOCALLOWDLLDATA = 1
addFiles.sources = rendering.dll
addFiles.path = !:/sys/bin
DEPLOYMENT += addFiles
}
unix:!symbian {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
}
INSTALLS += target
}
FORMS +=

View file

@ -1,11 +0,0 @@
include ../common_pre.mk
OBJPATH = ${BUILDPATH}/testing
RESULT = ${BUILDPATH}/paysages-tests
SOURCES += $(wildcard *.c)
HEADERS += $(wildcard *.h)
CC_LDFLAGS += -L${BUILDPATH} -lpaysages_rendering
LIBS += check
include ../common_post.mk

41
src/testing/testing.pro Normal file
View file

@ -0,0 +1,41 @@
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
TARGET = paysages-tests
INCLUDEPATH += ..
CONFIG(debug) {
DESTDIR = ../../build/debug/
MAKEFILE = Makefile.debug
} else {
DESTDIR = ../../build/release/
MAKEFILE = Makefile.release
}
OBJECTS_DIR = $$DESTDIR/testing/
release:DEFINES += NDEBUG
linux-clang {
CONFIG += link_pkgconfig
PKGCONFIG += check
}
DEPENDPATH += ..
linux-clang:LIBS += -L$$DESTDIR -lpaysages_rendering
SOURCES += main.c \
test_terrain_painting.c \
test_render.c \
test_pack.c \
test_noise.c \
test_euclid.c \
test_clouds.c \
test_camera.c \
test_bruneton.c
HEADERS += \
common.h