From 40b11de5e113f45eb3d236049d5fee1659fa8450 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 17 Sep 2014 20:35:40 +0200 Subject: [PATCH] build: platform support for MacOSX Signed-off-by: Thorsten Liebig --- nf2ff/nf2ff.pro | 16 ++++++++++++-- openEMS.pro | 58 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 69 insertions(+), 5 deletions(-) diff --git a/nf2ff/nf2ff.pro b/nf2ff/nf2ff.pro index 2abe4a8..49b851d 100644 --- a/nf2ff/nf2ff.pro +++ b/nf2ff/nf2ff.pro @@ -33,7 +33,8 @@ win32 { INCLUDEPATH += $$WIN32_LIB_ROOT/boost/include LIBS += -L$$WIN32_LIB_ROOT/boost/lib -lboost_thread -lboost_chrono -lboost_system } -!win32 { + +unix:!macx { LIBS += -lboost_thread -lboost_system LIBS += -ltinyxml #vtk @@ -44,6 +45,17 @@ win32 { LIBS += -lhdf5_hl -lhdf5 } +macx { + LIBS += -lboost_thread-mt -lboost_system + LIBS += -ltinyxml + #vtk + isEmpty(VTK_LIBRARYPATH){ + } else { + LIBS +=-L$$VTK_LIBRARYPATH + } + LIBS += -lhdf5_hl -lhdf5 +} + # hdf5 compat DEFINES += H5_USE_16_API @@ -99,7 +111,7 @@ isEmpty(PREFIX) { } install.target = install install.commands = mkdir -p \"$$PREFIX/bin\" -unix:install.commands += && cp -at \"$$PREFIX/bin/\" nf2ff +unix:install.commands += && cp nf2ff \"$$PREFIX/bin/\" win32:install.commands += && cp -at \"$$PREFIX/bin/\" release/nf2ff.exe QMAKE_EXTRA_TARGETS += install diff --git a/openEMS.pro b/openEMS.pro index d0a1706..d0c36df 100644 --- a/openEMS.pro +++ b/openEMS.pro @@ -73,7 +73,7 @@ win32 { INCLUDEPATH += $$WIN32_LIB_ROOT/vtk/include/vtk-5.10 LIBS += -L$$WIN32_LIB_ROOT/vtk/bin -lvtkCommon -lvtkIO -lvtkFiltering } -!win32 { +unix:!macx { # CSXCAD isEmpty(CSXCAD_ROOT) { CSXCAD_ROOT = /usr @@ -134,6 +134,57 @@ win32 { } } +macx: { + # CSXCAD + isEmpty(CSXCAD_ROOT) { + CSXCAD_ROOT = /usr + } else { + QMAKE_LFLAGS += \'-Wl,-rpath,$$CSXCAD_ROOT/lib\' + } + INCLUDEPATH += $$CSXCAD_ROOT/include/CSXCAD + LIBS += -L$$CSXCAD_ROOT/lib -lCSXCAD + + # #3rd party libraries# + #fparser + isEmpty(FPARSER_ROOT) { + FPARSER_ROOT = /usr + } else { + INCLUDEPATH += $$FPARSER_ROOT/include + LIBS += -L$$FPARSER_ROOT/lib + QMAKE_LFLAGS += \'-Wl,-rpath,$$FPARSER_ROOT/lib\' + } + LIBS += -lfparser + + LIBS += -ltinyxml + DEFINES += TIXML_USE_STL + LIBS += -L/usr/local/lib -lboost_thread-mt -lboost_system -lboost_date_time -lboost_serialization + LIBS += -lhdf5_hl -lhdf5 + + ### vtk ### + isEmpty(VTK_INCLUDEPATH) { + INCLUDEPATH += \ + /usr/local/opt/vtk5/include \ + /usr/local/opt/vtk5/include/vtk-5.10 + } else { + INCLUDEPATH += $$VTK_INCLUDEPATH + } + + LIBS += -L/usr/local/opt/vtk5/lib/vtk-5.10 -lvtkCommon \ + -lvtkFiltering \ + -lvtkGraphics \ + -lvtkHybrid \ + -lvtkIO \ + -lvtkRendering \ + -lvtkWidgets \ + -lQVTK + + isEmpty(VTK_LIBRARYPATH){ + } else { + LIBS +=-L$$VTK_LIBRARYPATH + QMAKE_LFLAGS += \'-Wl,-rpath,$$VTK_LIBRARYPATH\' + } +} + # vtk includes deprecated header files; silence the corresponding warning QMAKE_CXXFLAGS += -Wno-deprecated @@ -317,9 +368,10 @@ isEmpty(PREFIX) { install.target = install install.commands = mkdir -p \"$$PREFIX/bin\" install.commands += && mkdir -p \"$$PREFIX/share/openEMS/matlab\" -unix:install.commands += && cp -at \"$$PREFIX/bin/\" openEMS.sh openEMS_MPI.sh openEMS +unix:!macx:install.commands += && cp -at \"$$PREFIX/bin/\" openEMS.sh openEMS_MPI.sh openEMS win32:install.commands += && cp -at \"$$PREFIX/bin/\" release/openEMS.exe -install.commands += && cp -at \"$$PREFIX/share/openEMS/\" matlab/ +macx:install.commands += && cp openEMS.sh openEMS_MPI.sh openEMS \"$$PREFIX/bin/\" +install.commands += && cp -r matlab/* \"$$PREFIX/share/openEMS/matlab\" QMAKE_EXTRA_TARGETS += install