Imagine++
|
CMake philosophy is the following:
CMakeLists.txt
configuration file describing your programs, the files from which they are built and the libraries they rely on (the source directory).CMakeLists.txt
are handled automatically by the build process.The 'test'
sub-directory of the Imagine++ installation directory contains useful examples of such files. As an example, let's compile the Graphics tests.
The CMakeLists.txt
(<Imagine_DIR>/test/Graphics/CMakeLists
.txt) file of the Graphics test is simple, and your own should follow this model:
Two executables are defined, ImagineGraphicsExample
and ImagineGraphicsTest
, built respectively from example.cpp
and tesp.cpp
, each of them using the Graphics module. The first few lines are mandatory for any Imagine++ project: they check the Imagine_DIR
environment variable, which is mandatory to use Imagine++ (see Introduction).
Finally, if an executable depends on more than one C++ source, just add them as arguments to add_executable
separated by whitespace. See other tests and refer to CMake own manual for further information.
QtCreator works on all platforms
QtCreator
. Under Windows, it may complain about some problem related to OpenGL. It is happens, launch from a terminal: File/Open file or project...
. Choose the file <Imagine_DIR>/test/Graphics/CMakeLists.txt
Next
Finish
.all
) and launch (green arrow)Projects
, select Run
and click 'Run in terminal'. You must do that if your program expects user text input.To use under Windows:
cmake-gui
from the menus'C:/Program Files/Imagine++/test/Graphics'
(or equivalent) as the source code directory'C:/Users/
login/Desktop/test'
or any temporary directory as the build directory'Visual Studio 2013'
as build system. ImagineGraphicsTests.sln
solution freshly created in your build directory ALL_BUILD
, INSTALL
, ...). These are for advanced usage. Don't forget to right-click on your own executable and 'Set as StartUp Project' make
(Linux/Mac) or mingw32-make
(Windows) in your build directory to compile your project.Debug
(for use with a debugger) or Release
to generate optmized programs (default is neither Release
nor Debug
). For some applications, the Release executable can be much faster.cmake
instead of cmake-gui
as a command line version. Try also ccmake (non graphic version under Linux/Mac) to change build type: