district10/cmake-templates

HOWTO: Linux + CMake + CodeBlocks + GNU Make

district10 opened this issue · 0 comments

1. Build CodeBlocks Project

# goto source dir
cd module
mkdir build && cd build
cmake -G"CodeBlocks - Unix Makefiles" ..

generated codeblocks project

tip:

you can run cmake to get all your possible generators:

Generators

The following generators are available on this platform:
  Unix Makefiles              = Generates standard UNIX makefiles.
  Ninja                       = Generates build.ninja files (experimental).
  CodeBlocks - Ninja          = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
  Eclipse CDT4 - Ninja        = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles
                              = Generates Eclipse CDT 4.0 project files.
  KDevelop3                   = Generates KDevelop 3 project files.
  KDevelop3 - Unix Makefiles  = Generates KDevelop 3 project files.
  Sublime Text 2 - Ninja      = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                              = Generates Sublime Text 2 project files.

It seems sublime is a great choice. I'll cover that section later.

Build Executable & Run in CodeBlocks

build & run in codeblocks

because the building process is based on Makefile, you can also run these qt examples,
like:

example qt-gui