Package: qmake2cmake
qmake2cmakeThis repository contains Python scripts to convert QMake projects to
CMake projects.GoalsThe qmake2cmake tool creates aCMakeLists.txtthat covers the most common
attributes of the converted.profile.  The generated CMake project can be
used as baseline and will most likely need manual adjustments.QMake constructs that cannot be converted end up in the CMake project as
comment.Non-goalsQt versions lower than 6.0 are not supported.The following QMake constructs are not converted:TEMPLATE = auxprojectscustom.prffilesextra compilersextra targetsinstallation rulesRequirementsPython 3.7,pipto manage Python packages.InstallationYou can install theqmake2cmakepackage directly viapip install qmake2cmake.In case you are developing a new feature or want to install the latest
repository version, do an editable build by runningpip install -e .Installation for contributorsFor developers who want to contribute toqmake2cmake, we recommend
using avirtual
environmentto avoid
conflicts with other packages that are already installed.Create an environment:python3 -m venv env --prompt qmake2cmake,Activate the environment:source env/bin/activate(on Windows:env\Scripts\activate.bat)Install the requirements:pip install -r requirements.txtIf thepip installcommand above doesn't work, try:python3.7 -m pip install -r requirements.txtUsageAfter installing theqmake2cmakepackage, two scripts will be
available in your bin/ directory of your Python environment:qmake2cmakeandqmake2cmake_all.The following call converts a single QMake project file to CMake:qmake2cmake ~/projects/myapp/myapp.pro --min-qt-version 6.3It's necessary to specify a minimum Qt version the project is supposed
to be built with. Use the--min-qt-versionoption or the
environment variableQMAKE2CMAKE_MIN_QT_VERSION.By default, aCMakeLists.txtis placed next to the.profile.To generateCMakeLists.txtin a different location, use the-ooption:qmake2cmake ~/projects/myapp/myapp.pro --min-qt-version 6.3 -o ~/projects/myapp-converted/CMakeLists.txtTo convert a whole project tree, pass the project directory toqmake2cmake_all:qmake2cmake_all ~/projects/myapp --min-qt-version 6.3ContributingThe main source code repository is hosted atcodereview.qt-project.org.See theQt Contribution Guidelinespage,Setting up GerritandGerrit Introductionfor more
details about how to upload patches for review.Code style and testsYou can run the linter (mypy), code-style checkers (flake8,black)
and tests (pytest) by executing:make testThere are also separate make targets for each of thosemake mypy,make flake8,make black_format_check,make pytest.You can auto-format the code usingblack:make formatReleasing a new versionIncrease the version number insetup.cfgaccording to semantic versioning 2.0.For building and uploadingqmake2cmakeyou will need the Python
modulesbuildandtwine.Build the wheel:$ python -m buildUpload to testpypi:$ twine upload --repository testpypi dist/<wheel-name>Install the uploaded wheel in a fresh venv:$ python -m venv fresh && . ./fresh/bin/activate
(fresh)$ pip install -i https://testpypi.python.org/pypi qmake2cmake --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simpleIf the installation succeeded, try to convert something.
If everything is bueno, upload the wheel to production pypi.$ twine upload --repository pypi dist/<wheel-name>It is advisable to try out this wheel in another fresh venv.