Digikam/CMake Documentation(Frameworks): Difference between revisions

From KDE Community Wiki
*>Veaceslav
(Created page with "==Introduction== CMake configuration files were rewritten by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com> at 10 June 2014. The aim of new configuration was t...")
 
*>Veaceslav
No edit summary
Line 20: Line 20:
each of them depend on various sources which must be compiled before.
each of them depend on various sources which must be compiled before.


=== Shared Libs ===
=== Shared Libraries ===
To avoid linking overhead and make a better use of sources there are some dynamic libs.
To avoid linking overhead and make a better use of sources there are some dynamic libs.
* digikamcore - core components used by almost all executables
* digikamcore - core components used by almost all executables
Line 28: Line 28:


{{Warning| Please add sources to digikam core or digikam database only if they don't depend on any big component from digikam main executable. These two shared libs must be kept small because they link in a lot of places}}
{{Warning| Please add sources to digikam core or digikam database only if they don't depend on any big component from digikam main executable. These two shared libs must be kept small because they link in a lot of places}}
=== Static Libraries ===
Currently cmake configuration features 4 shared libs:
*queuemanager
*advancedrename
*importui
*baloowrap
{{Warning| Avoid making static libs, use OBJECT libraries instead. Only make STATIC libraries which does not depend on other digikam code. Also make sure you put the PRIVATE parameter when setting the target_link_libraries.}}
{{Remember|Please follow the guidelines when adding sources to CMakeFiles:
* Use OBJECT libraries
* Avoid using STATIC libraries
* Use PRIVATE parameter on target_link_libraries
* Keep digikamcore and digikamdatabase libraries small
}}

Revision as of 09:28, 10 June 2015

Introduction

CMake configuration files were rewritten by Veaceslav Munteanu <veaceslav dot munteanu90 at gmail dot com> at 10 June 2014. The aim of new configuration was to reduce the linking overhead and improve CPU utilization while still keeping the modular design implemented by Teemu Rytilahti

CMake Structure

Independent Cmake configuration is presents in following folders:

  • digikam-software-compilation
  • core
  • extra
  • docs

The rewrite touched mostly the core folder.

CMake executables for core

Core cmake will link the following executable:

  • digikam
  • showfoto
  • digikam database server - if compilation is enabled in cmake files
  • various test executables - if testing is enabled

each of them depend on various sources which must be compiled before.

Shared Libraries

To avoid linking overhead and make a better use of sources there are some dynamic libs.

  • digikamcore - core components used by almost all executables
  • digikamdatabase - database components, also used together with digikamcore
  • imageplugins - image plugin implementation
  • kio modules - soon to be deprecated

Warning

Please add sources to digikam core or digikam database only if they don't depend on any big component from digikam main executable. These two shared libs must be kept small because they link in a lot of places


Static Libraries

Currently cmake configuration features 4 shared libs:

  • queuemanager
  • advancedrename
  • importui
  • baloowrap

Warning

Avoid making static libs, use OBJECT libraries instead. Only make STATIC libraries which does not depend on other digikam code. Also make sure you put the PRIVATE parameter when setting the target_link_libraries.


 
Remember
Please follow the guidelines when adding sources to CMakeFiles:
  • Use OBJECT libraries
  • Avoid using STATIC libraries
  • Use PRIVATE parameter on target_link_libraries
  • Keep digikamcore and digikamdatabase libraries small