Documentation/CTK Plugin Framework: Setting up a project: Difference between revisions

From Commontk
Jump to navigationJump to search
(Created page with 'This tutorial will show you how to set-up your own project using the CMake build system and how to integrate it with the CTK Plugin Framework. The described set-up will allow fo…')
 
No edit summary
Line 5: Line 5:
==== Project Layout ====
==== Project Layout ====


[[File:CTKPluginProject_Layout.png|frame|Fig. 1 Example Project Layout]]
A possible project layout is shown in Fig. 1. It contains one application (UseCTKPlugin) and one plugin (org.mydomain.serviceeventlistener). The code for the application and different plugins is explained in other tutorials. We will cover only the four CMake files seen in Fig. 1.


[[File:CTKPluginProject_Layout.png|frame|Fig. 1 Example Project Layout]]
==== Top-level CMake file ====
 
The top-level CMake file is in charge of finding CTK and Qt4. You can add any CMake commands you want, the only requirement for a CTK Plugin integration is the availability of CTK and Qt4 (by using FIND_PACKAGE). You can have a look at an example file by clicking on the CMakeLists.txt link below. We will discuss one important part of this file in more detail:


[https://github.com/saschazelzer/CTKPluginTutorials/blob/master/CMakeLists.txt CMakeLists.txt]
[https://github.com/saschazelzer/CTKPluginTutorials/blob/master/CMakeLists.txt CMakeLists.txt]
Line 12: Line 16:
https://github.com/saschazelzer/CTKPluginTutorials/raw/master/CMakeLists.txt
https://github.com/saschazelzer/CTKPluginTutorials/raw/master/CMakeLists.txt
</syntaxhighlight>
</syntaxhighlight>
To be able to take advantage of CTKs sophisticated dependency checking system inside your own build system, you need to write a small CMake macro called ''GetMyTargetLibraries''. It is used as a callback inside CTKs own CMake macros and functions to distinguish between targets being build in your project and targets external to your project (e.g. targets coming from CTK).
==== Related Tutorials ====

Revision as of 20:42, 9 February 2011

Home < Documentation < CTK Plugin Framework: Setting up a project

This tutorial will show you how to set-up your own project using the CMake build system and how to integrate it with the CTK Plugin Framework.

The described set-up will allow for an arbitrary number of applications and CTK plug-ins, contained in one project.

Project Layout

Fig. 1 Example Project Layout

A possible project layout is shown in Fig. 1. It contains one application (UseCTKPlugin) and one plugin (org.mydomain.serviceeventlistener). The code for the application and different plugins is explained in other tutorials. We will cover only the four CMake files seen in Fig. 1.

Top-level CMake file

The top-level CMake file is in charge of finding CTK and Qt4. You can add any CMake commands you want, the only requirement for a CTK Plugin integration is the availability of CTK and Qt4 (by using FIND_PACKAGE). You can have a look at an example file by clicking on the CMakeLists.txt link below. We will discuss one important part of this file in more detail:

CMakeLists.txt

https://github.com/saschazelzer/CTKPluginTutorials/raw/master/CMakeLists.txt

To be able to take advantage of CTKs sophisticated dependency checking system inside your own build system, you need to write a small CMake macro called GetMyTargetLibraries. It is used as a callback inside CTKs own CMake macros and functions to distinguish between targets being build in your project and targets external to your project (e.g. targets coming from CTK).

Related Tutorials