I think I got it to work. You may need to treak for the QTDIR setting...
Fortran support also included. Comments are welcome!
For FORTRAN support (config.for)
Support both 64-bit and 32-bit - config.hCONFIG += f90
CONFIG(debug, debug|release) {
F90_CFLAGS = -g -O0
} else {
F90_CFLAGS = -O2
}
intel {
F90 = g77
}
isEmpty( F90 ) {
F90 = g77
}
ff90.input = F90_SOURCES
ff90.output = ${OBJECTS_DIR}${QMAKE_FILE_BASE}.o
ff90.commands = $$F90 -c $$F90_CFLAGS $$QMAKE_LFLAGS ${QMAKE_FILE_NAME} \
-o ${QMAKE_FILE_OUT} \
${INCPATH}
QMAKE_EXTRA_UNIX_COMPILERS += ff90
Fortran example - fortran.f# turn on the compiler warning
CONFIG += warn_on
#global definition
DEFINES = INT INTR3 QT3_SUPPORT
# global include file paths
MOC_DIR = .moc
UI_DIR = .ui
OBJECTS_DIR = .obj
# just a message
CONFIG(debug, debug|release) {
message(Building in debug mode.)
} else {
message(Building in release mode. Ignoring debug if it is available.)
}
contains( TARGET_BIT, m64 ) {
message(Building 64 bit )
QTDIR = /apps/qt64-422
BITS = 64
QMAKE_CFLAGS = -m64
QMAKE_CXXFLAGS = -m64
QMAKE_LFLAGS = -m64
}
contains( TARGET_BIT, m32 ) {
message(Building 32 bit )
QTDIR = /apps/qt32-422
BITS =
QMAKE_CFLAGS = -m32
QMAKE_CXXFLAGS = -m32
QMAKE_LFLAGS = -m32
}
!isEmpty( TARGET_BIT ) {
message( TARGET_BIT = $$TARGET_BIT )
CONFIG -= qt
CONFIG += moc
INCLUDEPATH += \
$$QTDIR/include/QtCore \
$$QTDIR/include/QtGui \
$$QTDIR/include/QtNetwork \
$$QTDIR/include/Qt3Support \
$$QTDIR/include
LIBS += $$QTDIR/lib -lQtCore -lQtGui -lQtNetwork -lQt3Support
} else {
message( Build in default )
INCLUDEPATH += ${QTDIR}/include/Qt3Support
}
# FORTRAN configuration file
exists( $$PWD/config.for ) {
include( $$PWD/config.for )
} else {
include( $(MAKE_ROOT)/bin/config.for )
}
LANGUAGE = C++ C
C example - cfile.csubroutine blah
return
end
C++ example - c++file.cppvoid foo()
{
}
Examples.provoid bar()
{
}
build32/build32.proTEMPLATE = subdirs
DIRLIST = build32 build64
for( dir, DIRLIST ): exists( $$dir ): exists( $$dir/*.pro ): SUBDIRS += $$dir
build64/build64.proTARGET_BIT = m32
include ( ../common.pri )
common.pri - path needs to be reset to fit your systemTARGET_BIT = m64
include ( ../common.pri )
################################################## ####################
# Automatically generated by qmake (2.01a) Thu Nov 16 15:23:45 2006
################################################## ####################
TEMPLATE = app
# Input
SOURCES += c++file.cpp cfile.c main.cpp
F90_SOURCES += fortran.f
TARGET = Examples
# if there is local config file, use it
exists( ../bin/config.h ) {
message(Use local config.h)
include( ../bin/config.h )
} else {
message(Use baseline's config.h)
include( $(MAKE_ROOT)/bin/config.h )
}
Bookmarks