-
Notifications
You must be signed in to change notification settings - Fork 2
Adds various fixes, improvements and finally the qt4 qt5 common build #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pierrewillenbrockdfki
wants to merge
24
commits into
rock-tutorials:master
Choose a base branch
from
pierrewillenbrockdfki:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
885f9ce
Adapt to qt5
haider8645 5352d73
Remove extra includes and add missing libs
haider8645 9b72047
Remove global include directories as they are not needed anymore
haider8645 f1d33b8
Merge pull request #2 from haider8645/qt5
planthaber 6537d55
Use qt5-designer as package dependency
pierrewillenbrockdfki f61cfee
Merge pull request #3 from pierrewillenbrockdfki/feature/qt5
planthaber 21e0c9a
fix: Remove .pc file someone errornously stuck into the repository
pierrewillenbrockdfki 851df9e
chore: Change to #pragma once instead of include guard
pierrewillenbrockdfki 957e407
chore: Only use includes needed, use forward declarations in headers
pierrewillenbrockdfki 4b6e099
fix: remove opengl requirement
pierrewillenbrockdfki 7045da7
fix: properly use QtDesigner Qt component
pierrewillenbrockdfki 9b51875
chore: Only use includes needed, use forward declarations in headers
pierrewillenbrockdfki 092829b
fix: MyWidget::getPose does not really make sense as a Qt slot
pierrewillenbrockdfki 7152df3
Merge commit '9b51875eea5fe267e5bc617caeb6d63a4269a80b' into feature/…
pierrewillenbrockdfki c942968
chore: Only use includes needed, use forward declarations in headers
pierrewillenbrockdfki 644470b
fix: remove opengl requirement
pierrewillenbrockdfki 9b319b0
fix: Use UiPlugin Qt5 component instead of Designer component
pierrewillenbrockdfki e482ba9
feat: Prepare master branch to also host Qt5 build
pierrewillenbrockdfki ff5002d
feat: Move to using RockQt macros
pierrewillenbrockdfki b7c0984
feat: Move to using RockQt macros
pierrewillenbrockdfki 8cb1c98
Merge branch 'master' into feature/qt4-qt5
pierrewillenbrockdfki a787237
Rename HDRS to INSTALLED_HDRS to clearly communicate why they are dec…
pierrewillenbrockdfki 95928c9
Set SRCS to the relevant file names instead of searching for *.cc
pierrewillenbrockdfki a60e479
feat: Use namespaced targets in cmake, pkgconfig package in .pc
pierrewillenbrockdfki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| # CMakeLists.txt has to be located in the project folder and cmake has to be | ||
| # executed from 'project/build' with 'cmake ../'. | ||
| cmake_minimum_required(VERSION 2.6) | ||
| cmake_minimum_required(VERSION 3.5) | ||
| project(MyWidget VERSION 0.1 DESCRIPTION "Widget tutorial") | ||
| find_package(Rock) | ||
| rock_init(MyWidget 0.1) | ||
| rock_init() | ||
| rock_feature(NOCURDIR) | ||
| rock_standard_layout() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,63 @@ | ||
| find_package(Qt4 REQUIRED QtCore QtGui QtOpengl QtDesigner) | ||
| include_directories(${QT_INCLUDE_DIR}) | ||
| include_directories(${QT_QTCORE_INCLUDE_DIR}) | ||
| include_directories(${QT_QTGUI_INCLUDE_DIR}) | ||
| rock_find_qt4(OPTIONAL QtCore QtGui QtDesigner) | ||
| rock_find_qt5(OPTIONAL Core Gui Widgets UiPlugin) | ||
|
|
||
| include(RockQt) | ||
|
|
||
| set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
|
||
| SET(MOC_HDRS | ||
| MyWidget.h | ||
| MyWidgetPlugin.h | ||
| ) | ||
|
|
||
| SET(HDRS | ||
| SET(INSTALLED_HDRS | ||
| MyWidget.h | ||
| ) | ||
|
|
||
| FILE(GLOB SRCS | ||
| *.cc | ||
| ) | ||
| SET(SRCS | ||
| MyWidget.cc | ||
| MyWidgetPlugin.cc | ||
| ) | ||
| # Alternatively, FILE(GLOB) can find any matching file in the directory. | ||
| # For this reason, the mywidgetTest executable uses main.cpp instead of main.cc. | ||
| #FILE(GLOB SRCS | ||
| # *.cc | ||
| #) | ||
|
|
||
| SET(QtApp_RCCS resources.qrc) | ||
| QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS}) | ||
| if(ROCK_QT4) | ||
| QT4_ADD_RESOURCES(QtApp_RCC_SRCS_QT4 ${QtApp_RCCS}) | ||
| endif() | ||
| if(ROCK_QT5) | ||
| QT5_ADD_RESOURCES(QtApp_RCC_SRCS_QT5 ${QtApp_RCCS}) | ||
| endif() | ||
|
|
||
| rock_vizkit_widget(MyWidget | ||
| SOURCES ${SRCS} ${QtApp_RCC_SRCS} | ||
| HEADERS ${HDRS} | ||
| rock_qt_vizkit_widget( | ||
| TARGETPREFIX MyWidget | ||
| QT4_SUFFIX "" | ||
| SOURCES ${SRCS} | ||
| SOURCES_QT4 ${QtApp_RCC_SRCS_QT4} | ||
| SOURCES_QT5 ${QtApp_RCC_SRCS_QT5} | ||
| HEADERS ${INSTALLED_HDRS} | ||
| MOC ${MOC_HDRS} | ||
| DEPS_PKGCONFIG base-types base-lib QtCore QtGui | ||
| DEPS_CMAKE | ||
| LIBS ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTDESIGNER_LIBRARY} | ||
| DEPS_PKGCONFIG base-types base-lib | ||
| # Using the cmake targets for target_link_libraries but the | ||
| # pkgconfig packages in the .pc file. | ||
| # equivalent pkgconfig based configuration: | ||
| # DEPS_PKGCONFIG_QT4 QtCore QtGui | ||
| # DEPS_PKGCONFIG_QT5 Qt5Core Qt5Gui Qt5Widgets | ||
| # above will also add the dependencies to the .pc file, so they | ||
| # are not needed in the .pc.in. | ||
| LIBS_QT4 Qt4::QtCore Qt4::QtGui | ||
| LIBS_QT5 Qt5::Core Qt5::Gui Qt5::Widgets | ||
| # for include directories. These do not need to be added to the .pc files, | ||
| # the INSTALLED_HDRS do not use them. | ||
| LIBS_QT4 Qt4::QtDesigner | ||
| LIBS_QT5 Qt5::UiPlugin | ||
| ) | ||
|
|
||
| rock_executable(mywidgetTest | ||
| main.cpp | ||
| DEPS MyWidget) | ||
| rock_qt_executable( | ||
| TARGETPREFIX mywidgetTest | ||
| QT4_SUFFIX "" | ||
| SOURCES main.cpp | ||
| DEPS_QT MyWidget) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| prefix=@CMAKE_INSTALL_PREFIX@ | ||
| exec_prefix=@CMAKE_INSTALL_PREFIX@ | ||
| libdir=${prefix}/lib | ||
| includedir=${prefix}/include | ||
|
|
||
| Name: @TARGET_NAME@ | ||
| Description: @PROJECT_DESCRIPTION@ | ||
| Version: @PROJECT_VERSION@ | ||
| Requires: @DEPS_PKGCONFIG@ Qt5Core Qt5Gui Qt5Widgets | ||
| Libs: -L${libdir} -l@TARGET_NAME@ | ||
| Cflags: -I${includedir} | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #include <QtGui/QApplication> | ||
| #include <QApplication> | ||
|
|
||
| #include "MyWidget.h" | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here LIBS_QT4 above is used twice, so it could either be one call or the above shloud be different to add these into the pc file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first instance of that is for the option of either using LIBS_QT4 with Qt targets and supplying the pkg-config yourselves or using DEPS_PKGCONFIG but not having cmake check if one tries to link different Qts into the same binary.
The second instance of LIBS_QT4 is correct here since one only needs the pkgconfig requires: for things that are exported in headers(so the users of the headers link anything extra needed from the libraries by the headers), but the plugin-header does not need to be exported. I don't see a use-case where one would directly use the plugin-object instead of going through the plugin system. This may change when i find out how to statically add plugins to binaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So they aren't combined in a single (
LIBS_QT4 Qt4::QtCore Qt4::QtGui Qt4::QtDesigner) line for documentation reasons?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats my idea here, yes.