Skip to content

Commit

Permalink
Merge pull request #213 from markito3/qt_config_patch
Browse files Browse the repository at this point in the history
Qt config patch
  • Loading branch information
markito3 authored Sep 23, 2021
2 parents a3d98d0 + 0baecd9 commit 5eb83ab
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile_geant4
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ else
CMAKE = cmake3
endif

include $(BUILD_SCRIPTS)/geant4_version.mk

all: $(G4DIR)/.make_install_done

$(TARFILE):
Expand All @@ -33,6 +35,10 @@ $(G4DIR)/.patch_done: $(G4DIR)/.untar_done
then patch Geant4ToolchainBackwardCompatibility.cmake \
< $(BUILD_SCRIPTS)/patches/geant4/Geant4ToolchainBackwardCompatibility.cmake.patch; \
fi
ifeq ($(GEANT4_EQ_10_04), true)
patch $(G4DIR)/config/sys/Linux-g++.gmk \
< $(BUILD_SCRIPTS)/patches/geant4/Linux-g++.gmk.patch
endif
date > $@

$(G4DIR)/.configure_done: $(G4DIR)/.patch_done
Expand Down
6 changes: 6 additions & 0 deletions geant4_version.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ifdef GEANT4_VERSION
GEANT4_MAJOR_VERSION := $(shell echo $(GEANT4_VERSION) | awk -F. '{print $$1}')
GEANT4_MINOR_VERSION := $(shell echo $(GEANT4_VERSION) | awk -F. '{print $$2}' | bc)
GEANT4_SUBMINOR_VERSION := $(shell echo $(GEANT4_VERSION) | awk -F'.p' '{print $$3}' | bc)
GEANT4_EQ_10_04 := $(shell if [[ $(GEANT4_MAJOR_VERSION) -eq 10 && $(GEANT4_MINOR_VERSION) -eq 4 ]]; then echo true; else echo false; fi)
endif
49 changes: 49 additions & 0 deletions patches/geant4/Linux-g++.gmk.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
--- Linux-g++.gmk.original 2021-09-22 14:45:22.608148649 -0400
+++ Linux-g++.gmk.patched 2021-09-22 16:22:16.414406962 -0400
@@ -92,19 +92,15 @@
QTHOME := /usr
endif
ifndef QTMOC
- QTMOC := $(QTHOME)/bin/moc
+# QTMOC := $(shell if [ -f "$(QTHOME)/bin/moc-qt5" ]; then echo $(QTHOME)/bin/moc-qt5; elif [ -f "$(QTHOME)/bin/moc-qt4" ]; then echo $(QTHOME)/bin/moc-qt4; else echo $(QTHOME)/bin/moc; fi)
+ QTMOC := dummy_value
endif

- QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' )
+ QT_VERSION := $(shell $(QTMOC) -v | awk '{print $$2}' | awk -F. '{print $$1}')

ifeq ($(QT_VERSION),5)
ifndef QTFLAGS # Qt5
- QTFLAGS := -I $(QTHOME)/include -I$(QTHOME)/include/Qt
- QTFLAGS += -I $(QTHOME)/include/QtCore
- QTFLAGS += -I $(QTHOME)/include/QtGui
- QTFLAGS += -I $(QTHOME)/include/QtWidgets
- QTFLAGS += -I $(QTHOME)/include/QtOpenGL
- QTFLAGS += -I $(QTHOME)/include/QtPrintSupport
+ QTFLAGS := -I $(QTHOME)/include -I$(QTHOME)/include/Qt5
endif
else # Qt4
ifndef QTFLAGS
@@ -115,18 +111,18 @@
endif
endif
ifndef QTLIBPATH
- QTLIBPATH := $(QTHOME)/lib
+ QTLIBPATH := $(QTHOME)/lib64
QT_SEARCH_LIB := $(shell ls $(QTLIBPATH)/qt$(QT_VERSION)/libq* 2>/dev/null | wc -l )
ifneq ($(QT_SEARCH_LIB),0)
- QTLIBPATH := $(QTHOME)/lib/qt$(QT_VERSION)
+ QTLIBPATH := $(QTHOME)/lib64/qt$(QT_VERSION)
endif
endif
ifeq ($(QT_VERSION),5)
ifndef QTLIBS # Qt5
- QTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui -lQtWidgets -lQtPrintSupport
+ QTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5PrintSupport
endif
ifndef GLQTLIBS
- GLQTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui -lQtWidgets -lQtOpenGL -lQtPrintSupport
+ GLQTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5OpenGL -lQt5PrintSupport
endif
else # Qt4
ifndef QTLIBS

0 comments on commit 5eb83ab

Please sign in to comment.