Skip to content
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

add CMake build system support #240

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

feihong-gz
Copy link

No description provided.

Copy link
Contributor

@mrbean-bremen mrbean-bremen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - this should actually be the default way to build Qt at least for Qt6.
It would also make sense to add workflows in the CI to build the latest Qt5 and Qt6 version, to be able to test this - for the time being probably parallel to the existing workflows using qmake.

CMakeLists.txt Outdated
endif()
# elseif(${QT_VERSION_MAJOR} VERSION_EQUAL 6)
else()
message(FATAL "No generated sources exist for Qt${QT_VERSION}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not handle the (actually preferred) case of self-generated wrappers in generated_cpp, as done in the qmake file. Especially this will not work for Qt6, unless I'm missing something.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to build generator using CMake, and so far it's testing well.


target_compile_definitions(${PROJECT_NAME} PRIVATE PYTHONQT_QTALL_EXPORTS)

list(APPEND QTMODULES Core Gui Svg Sql Network OpenGL Xml XmlPatterns Multimedia Qml Quick UiTools WebEngineWidgets WebKit)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this list shall be different for Qt5 and Qt6.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as long as there are no modules with the same name but different functionality in Qt 5 and Qt 6, there shouldn't be a problem.

@jamesobutler
Copy link

@jcfr This may be a PR of interest to you based on your previous work from 2019 to CMake’ify PythonQt as completed in https://github.com/commontk/PythonQt/blob/patched-9/CMakeLists.txt (though currently for Qt5 PythonQt only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants