2011-01-23 22:42:01 +01:00
|
|
|
#
|
|
|
|
# Qmake project for UAVObjects generation.
|
2013-03-30 16:33:38 +01:00
|
|
|
# Copyright (c) 2009-2013, The OpenPilot Team, http://www.openpilot.org
|
2011-01-23 22:42:01 +01:00
|
|
|
#
|
|
|
|
|
2011-01-22 18:41:51 +01:00
|
|
|
TEMPLATE = subdirs
|
|
|
|
|
2011-01-24 13:16:43 +01:00
|
|
|
# Some handy defines
|
2011-01-22 23:26:01 +01:00
|
|
|
defineReplace(targetPath) {
|
|
|
|
return($$replace(1, /, $$QMAKE_DIR_SEP))
|
|
|
|
}
|
|
|
|
|
|
|
|
defineReplace(addNewline) {
|
|
|
|
return($$escape_expand(\\n\\t))
|
|
|
|
}
|
|
|
|
|
2011-01-24 13:16:43 +01:00
|
|
|
# QMAKESPEC should be defined by qmake but sometimes it is not
|
|
|
|
isEmpty(QMAKESPEC) {
|
|
|
|
win32:SPEC = win32-g++
|
|
|
|
macx-g++:SPEC = macx-g++
|
|
|
|
linux-g++:SPEC = linux-g++
|
2012-07-04 00:28:17 +02:00
|
|
|
linux-g++-32:SPEC = linux-g++
|
2011-04-03 18:25:21 +02:00
|
|
|
linux-g++-64:SPEC = linux-g++-64
|
2011-01-24 13:16:43 +01:00
|
|
|
} else {
|
|
|
|
SPEC = $$QMAKESPEC
|
|
|
|
}
|
|
|
|
|
|
|
|
# Some platform-dependent options
|
2011-01-24 23:37:55 +01:00
|
|
|
win32|unix {
|
2011-01-22 23:26:01 +01:00
|
|
|
CONFIG(release, debug|release) {
|
2011-01-24 13:16:43 +01:00
|
|
|
BUILD_CONFIG = release
|
2011-01-22 23:26:01 +01:00
|
|
|
} else {
|
2011-01-24 13:16:43 +01:00
|
|
|
BUILD_CONFIG = debug
|
2011-01-22 23:26:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-23 22:42:01 +01:00
|
|
|
win32 {
|
|
|
|
# Windows sometimes remembers working directory changed from Makefile, sometimes not.
|
|
|
|
# That's why pushd/popd is used here - to make sure that we know current directory.
|
2011-01-23 20:46:34 +01:00
|
|
|
|
2013-03-30 16:33:38 +01:00
|
|
|
uavobjects.commands += -$(MKDIR) $$targetPath(../uavobject-synthetics) $$addNewline()
|
|
|
|
uavobjects.commands += pushd $$targetPath(../uavobject-synthetics) &&
|
|
|
|
uavobjects.commands += $$targetPath(../uavobjgenerator/$${BUILD_CONFIG}/uavobjgenerator)
|
2011-01-24 13:16:43 +01:00
|
|
|
uavobjects.commands += $$targetPath(../../shared/uavobjectdefinition)
|
|
|
|
uavobjects.commands += $$targetPath(../..) &&
|
|
|
|
uavobjects.commands += popd $$addNewline()
|
2011-01-23 22:42:01 +01:00
|
|
|
|
2013-03-30 16:33:38 +01:00
|
|
|
uavobjects.commands += -$(MKDIR) $$targetPath(../openpilotgcs) $$addNewline()
|
|
|
|
uavobjects.commands += pushd $$targetPath(../openpilotgcs) &&
|
2011-01-24 13:16:43 +01:00
|
|
|
uavobjects.commands += $(QMAKE) -spec $$SPEC CONFIG+=$${BUILD_CONFIG} -r
|
2013-03-30 16:33:38 +01:00
|
|
|
uavobjects.commands += $$targetPath(../../ground/openpilotgcs/)openpilotgcs.pro &&
|
2011-01-24 13:16:43 +01:00
|
|
|
uavobjects.commands += popd $$addNewline()
|
2011-01-23 22:42:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
!win32 {
|
2013-03-30 16:33:38 +01:00
|
|
|
uavobjects.commands += $(MKDIR) -p ../uavobject-synthetics $$addNewline()
|
|
|
|
uavobjects.commands += cd ../uavobject-synthetics &&
|
|
|
|
uavobjects.commands += ../uavobjgenerator/uavobjgenerator
|
|
|
|
uavobjects.commands += ../../shared/uavobjectdefinition ../.. &&
|
2011-01-23 22:42:01 +01:00
|
|
|
|
2013-03-30 16:33:38 +01:00
|
|
|
uavobjects.commands += $(MKDIR) -p ../openpilotgcs $$addNewline()
|
|
|
|
uavobjects.commands += cd ../openpilotgcs &&
|
|
|
|
uavobjects.commands += $(QMAKE) ../../ground/openpilotgcs/openpilotgcs.pro
|
|
|
|
uavobjects.commands += -spec $$SPEC CONFIG+=$${BUILD_CONFIG} -r $$addNewline()
|
2011-01-23 22:42:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
uavobjects.target = FORCE
|
2011-01-22 18:41:51 +01:00
|
|
|
QMAKE_EXTRA_TARGETS += uavobjects
|