casalogger package for CASA 6
Source
QMAKE_POST_LINK = scripts/create-app --no-data name=logger exe=$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET app=$$APP lib=$$DESTDIR/$${TARGET}.app/Contents/Frameworks tgt=$$lower($$QMAKE_HOST.os) plugins=$$[QT_INSTALL_PLUGINS] $$MAC_THIRD_PARTY_LIBS_PATH $$RPATH_LIBS
###
### gRPC libraries and include files are provided with the casatools
### module to ensure compatibility
###
system(scripts/casalogger-config)
QMAKE_MOC = $$QMAKE_MOC -DAIPS_HAS_QWT
INCLUDEPATH += include build/include.$$QMAKE_HOST.version casa-source/casa5/code casa-source/casatools/casacore src/code -I/usr/include
CONFIG += release cpp11
include ( $$[QT_INSTALL_DATA]/mkspecs/features/qwt.prf )
INCLUDEPATH += /opt/casa/03/include /opt/casa/02/include /usr/include/cfitsio /opt/casa/03/include/libxml2 /usr/include/libxml2 /usr/include
LIBDIR_LIST = /opt/casa/03/lib /opt/casa/02/lib /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.3.1 /opt/local/lib/gcc5
GFORTRAN = gfortran
###
### -lelf is needed simply to cause it to be located from within the casalogger.app
### tree at runtime by the runtime loader... because whatever library depends upon
### libelf.so.1 does not include a RPATH/RUNPATH
###
unix:!mac{
LIBS += -lm -lelf -lrt -lxml2 -lxslt
# APP_EXE = build/bin.$$QMAKE_HOST.version/$${TARGET}-x86_64.AppImage
}
unix:mac{
GCC_VERSION="5"
OSVERSION_MAJOR = $$system(uname -r | cut -d. -f1)
greaterThan(OSVERSION_MAJOR, 19) {
GCC_VERSION="9"
}
FORTRAN_BIN = $$system(which gfortran)
isEmpty(FORTRAN_BIN) {
message("gfortran not found. Trying gfortran-mp-$${GCC_VERSION} instead")
GFORTRAN = gfortran-mp-$${GCC_VERSION}
}
message( "Using proper libraries in MacOS" )
LIBS += -lm -lxml2 -lxslt
# APP_EXE = build/bin.$$QMAKE_HOST.version/$${TARGET}.app
}
OBJECTS_DIR = build/lib.$$QMAKE_HOST.version/objs
MOC_DIR = build/lib.$$QMAKE_HOST.version/moc
RCC_DIR = build/lib.$$QMAKE_HOST.version/rcc
UI_DIR = build/include.$$QMAKE_HOST.version/ui
CONFIG += object_parallel_to_source
QMAKE_CXXFLAGS += -std=c++11 -DAIPS_HAS_QWT -DUSE_GRPC -DUseCasacoreNamespace -DNO_CRASH_REPORTER -DAIPS_LINUX
QT += xml widgets printsupport
unix:mac{
message( "Adding additional QMAKE_CXXFLAGS to satisfy clang++" )
## Clang thinks theres an ambiguous function named "JsonGramerror" (it looks like it is ambiguous...)
QMAKE_CXXFLAGS += -DYYERROR_IS_DECLARED
}
for(p, LIBDIR_LIST) {
exists($$p):LIBS += -L$$p
exists($$p):RPATH_LIBS += $$p
}
YACC_DIR = include/yacc
INCLUDEPATH += $$YACC_DIR
QMAKE_CC = ccache $$QMAKE_CC
QMAKE_CXX = ccache $$QMAKE_CXX
###
### without this qmake will generate all of the MOC bindings for
### Qt classes that are #ifdefed out...
###
MOC_DIR = build/lib.$$QMAKE_HOST.version/moc
load(moc)
QMAKE_MOC += -DUSE_GRPC
unix:!mac{
DESTDIR = build/bin.$$QMAKE_HOST.version/casalogger.app/usr/bin
APP = $$DESTDIR/../..
QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN/../lib\'"
QMAKE_POST_LINK = scripts/create-app --no-data name=logger exe=$$DESTDIR/$$TARGET app=$$APP lib=$$DESTDIR/../lib tgt=$$lower($$QMAKE_HOST.os) plugins=$$[QT_INSTALL_PLUGINS] $$RPATH_LIBS
APP_EXE = build/bin.$$QMAKE_HOST.version/$${TARGET}-x86_64.AppImage
}
unix:mac{
message( "Configuring application for MacOS" )
DESTDIR = build/bin.$$QMAKE_HOST.version
APP = $$DESTDIR/$${TARGET}.app
QMAKE_LFLAGS += "-Wl,-rpath,\'@loader_path/../Frameworks\'"