CMake build system template for C++/Qt based projects
C++ Shell
Latest commit cc77463 Jan 24, 2015 @rhtyd NEWS: 1.2 version
Signed-off-by: Rohit Yadav <>


CMakeQt, a cross-platform CMake build system template for C++/Qt based projects.
Copyright Rohit Yadav <>, 2009-2015

Feel free to use and modify it according to your project. For reporting bugs,
feature requests and just to say hi, contact the author.


Initially the build system was just for VLMC, but I thought why not make a
build system template that anyone can hack easily and use in their own projects,
thus CMakeQt!

Some projects that use CMakeQt (or parts of source code)

- VLMC:;a=summary
- CernVM Installer:
- Blender:
- Phonon-backend-vlc:
- Tano Player:
- Graffiti:



Grab the latest source:
  git clone git://


Languages that only needed to be shipped can be selected using LANGS, for example:
  cmake -DLANGS="en;fr" ..

To create ts files, either simply do a `make lupdate` or cd to ts/ folder and do:
  cd ts
  lupdate ../src/* -ts template.ts

Now, send this template to the translators and ask them to rename and send you the file as cmakeqt_<lang-token>.ts;
where, lang token can be fr_FR etc.

If you add a new language translation, simple add the token to the lang list in ts/CMakeLists.txt
For testing I've added a french translation, which is explicitly ran in src/main.cpp

Hack hack hack!


  mkdir build && cd build
  cmake .. && make

The binary will be created in <build-folder>/bin


1. On Linux:
  make package

  To force deb:
    cpack -G DEB

  To force rom:
    cpack -G RPM

2. On Mac: (gcc, g++, make, cmake, qt 4.6+ etc. must be installed...)
  cd contribs
  This will by default create a Mac Bundle, in /build/bin

  To create a dmg image:
    Uncomment #dmg in /src/CMakeLists.txt, at the end of the file.
    and follow the build process, the dmg will be created in /build/bin

3. To cross-compile and package on linux for Windows: (mingw, wine, nsis must be installed...)

  cd contribs
  cd ..
  mkdir win32 && cd win32
  cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-win32.cmake -DQT_MOC_EXECUTABLE=../contribs/tools/moc.exe ..
  make installer

  This will create an .exe installer in /win32/bin

Distribution via Launchpad
========================== provides PPA facility for distribution of debian builds.
The /debian folder holds debian package building rules.

You build and upload your source pkgs by:
  debuild -k<pgp key ID>
  debuild -k<pgp key ID> -S -sa # creates only the source pkg
  dput ppa:<ppa-id>/<pkg> <source.changes>

To add/install the pkg, one can do:
  sudo add-apt-repository ppa:<ppa-id>/<pkg>
  sudo apt-get update
  sudo apt-get install <pkg>