Skip to content

Commit

Permalink
Allow qt4 and qt5 side-by-side
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrewillenbrockdfki committed Jul 19, 2023
1 parent cacbfa3 commit 799abc9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 14 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ if(COVERAGE)
endif()

rock_init()
rock_find_qt5(Core Gui Xml Widgets PrintSupport Svg)
rock_feature(NOCURDIR)
rock_find_qt4(OPTIONAL QtCore QtGui QtXml QtSvg)
rock_find_qt5(OPTIONAL Core Gui Xml Widgets PrintSupport Svg)
rock_standard_layout()
64 changes: 51 additions & 13 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ rock_executable(templ-mission_generator
rock_executable(templ-bm-tcn utils/TCNBenchmark.cpp
DEPS templ)

rock_library(templ_gui
HEADERS
set(GUI_HEADERS
gui/TemplGui.hpp
gui/Utils.hpp
gui/SpatioTemporalRequirementItem.hpp
Expand All @@ -319,7 +318,9 @@ rock_library(templ_gui
gui/widgets/SpatioTemporalRequirement.hpp
gui/widgets/TemporalConstraintQualitative.hpp
gui/widgets/TemporalConstraintQuantitative.hpp
SOURCES
)

set(GUI_SOURCES
gui/TemplGui.cpp
gui/Utils.cpp
gui/SpatioTemporalRequirementItem.cpp
Expand All @@ -346,7 +347,9 @@ rock_library(templ_gui
gui/widgets/TemporalConstraintQualitative.cpp
gui/widgets/TemporalConstraintQuantitative.cpp
../resources.qrc
MOC
)

set(GUI_MOC
gui/TemplGui.hpp
gui/SpatioTemporalRequirementItem.hpp
gui/MissionEditor/MissionEditor.hpp
Expand All @@ -370,14 +373,9 @@ rock_library(templ_gui
gui/widgets/SpatioTemporalRequirement.hpp
gui/widgets/TemporalConstraintQualitative.hpp
gui/widgets/TemporalConstraintQuantitative.hpp
DEPS
templ
Qt5::Gui
Qt5::Widgets
Qt5::Xml
Qt5::PrintSupport
Qt5::Svg
UI
)

set(GUI_UI
gui/TemplGui.ui
gui/dialogs/AddLocation.ui
gui/dialogs/EmptyDialog.ui
Expand All @@ -392,7 +390,47 @@ rock_library(templ_gui
gui/widgets/SpatioTemporalRequirement.ui
gui/widgets/TemporalConstraintQualitative.ui
gui/widgets/TemporalConstraintQuantitative.ui
)
)

if(ROCK_QT_VERSION_4)
rock_library(templ_gui
HEADERS
${GUI_HEADERS}
SOURCES
${GUI_SOURCES}
MOC
${GUI_MOC}
UI
${GUI_UI}
DEPS_PKGCONFIG
graph_analysis
DEPS
templ
Qt4::QtXml
Qt4::QtSvg
)
endif(ROCK_QT_VERSION_4)

if(ROCK_QT_VERSION_5)
rock_library(templ_gui-qt5
HEADERS
${GUI_HEADERS}
SOURCES
${GUI_SOURCES}
MOC5
${GUI_MOC}
UI5
${GUI_UI}
DEPS_PKGCONFIG
graph_analysis-qt5
DEPS
templ
Qt5::Widgets
Qt5::Xml
Qt5::PrintSupport
Qt5::Svg
)
endif(ROCK_QT_VERSION_5)

rock_executable(templ-gui gui/Main.cpp
DEPS templ_gui)
Expand Down

0 comments on commit 799abc9

Please sign in to comment.