$ go get github.com/qtpm/qtpm
Create application template
$ mkdir helloworld
$ qtpm init
$ ls
CMakeExtra.txt LICENSE.rst build include qtpackage.toml src test vendor
$ qtpm build
Create library template
$ mkdir awesomesdk
$ cd awsomesdk
$ qtpm init app
CMakeExtra.txt LICENSE.rst build include qtpackage.toml src test vendor
$ qtpm build
Add files
$ qtpm add class MyDialog@QDialog
$ qtpm add test TestMyDialog
Change license
$ qtpm add license mit
Supported license names are mentioned at the below section.
It uses CMake behind qtpm command to build. By default, Qt should be in default (CMAKE_PREFIX_PATH
). If you put Qt out of the folder,
there are two ways to specify the Qt location.
qtpm sees environment variable
QTDIR
:$ QTDIR=~/Qt/5.5/clang_64 qtpm build
put
qtpackage.user.toml
that contains the following contents:qtdir = 'C:\Qt\5.5\mingw492_32'
If you don't use the both settings and Qt is not in CMAKE_PREFIX_PATH
, qtpm tries to search any locations.
This tool behaves according to the convention over any configuration.
- Source and header files are under
src
folder. - Tests are under
test
folder. - Resources are under
resource
folder. - One project folder includes one executable file or one shared library as the output.
- If there is
src/main.cpp
, qtpm generates executable, otherwise shared library - Each test classes are implemented in
test/*_test.cpp
files (no header files) and compiled into executable. - Other
.cpp
files intest
are treated test utility. They are linked with each test executables. - Each source file's suffix is used for conditional compile now. For example,
sample_windows.cpp
is built only on Windows platform._windows
: Windows (Cygwin is not included)_darwin
: MacOS X_unix
: Unix-like OS including MacOS X and Cygwin_linux
: Unix-like OS (Mac OS X and Cygwin are not included)_mingw
: MinGW_cygwin
: Cygwin_msvc
: Microsoft Visual C++
Project file is written in TOML format.
name
: Project name.author
: Author name.license
: License name.requires
: Dependency packages like'github.com/shibukawa/qtobubus'
(this feature is not implemented yet).qtmodules
: Required qt modules likeWidgets
,Xml
.version
: Version number like[1, 0, 0]
.
The following names can use with qtpm add license
command:
apache-v2.0
: Apache License v2.0artistic-v2.0
: The Artistic License v2.0bsd-2
: Simplified BSD License (BSD 2-clause)bsd-3
: Modified BSD License (BSD 3-clause)epl-v1.0
: Eclipse Public License (EPL) v1.0gnu-agpl-v3.0
: GNU Affero General Public License (AGPL) v3.0gnu-gpl-v2.0
: GNU General Public License (GPL) v2.0gnu-gpl-v3.0
: GNU General Public License (GPL) v3.0gnu-lgpl-v2.1
: GNU Lesser General Public License (LGPL) v2.1gnu-lgpl-v3.0
: GNU Lesser General Public License (LGPL) v3.0mit
: The MIT License (MIT)mpl-v2.0
: Mozilla Public License (MPL) v2.0unlicense
: The Unlicense (Public Domain)
You can uses the following names as alias:
apache2
-> apache-v2.0bsd
-> bsd-3eclipse
-> epl-v1.0gpl
-> gnu-gpl-v3.0gpl2
-> gnu-gpl-v2.0gpl3
-> gnu-gpl-v3.0lgpl
-> gnu-lgpl-v3.0lgpl2
-> gnu-lgpl-v2.1lgpl3
-> gnu-lgpl-v3.0mozilla
-> mpl-v2.0perl
-> artistic-v2.0public domain
-> unlicensex
-> mit
MIT