kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #23970
RFC: out-of-tree plugin builds
With the recent merge of the 3D plugin work we must now address
some new issues which have come about due to the introduction
of plugins and a shared library (kicad_3dsg). In particular, users
who wish to create out-of-tree plugins will now need to find the vital
kicad headers and necessary shared libraries (at the moment only
kicad_3dsg).
For the 3D plugins and kicad_3dsg all of the necessary header files
have been placed in the include/plugins directory. At the moment
there are no CMake instructions to install header files since I wanted
some feedback on the options and their effects of in-tree source code.
I think the best place to install the headers would be within
${SOME_SYSTEM_PATH}/include/kicad and subdirectories
within (at the moment only plugins/ and its subdirs). We will need to
provide a FindKicad.cmake file or an appropriate CMake package
file to discover these headers and the associated libraries.
What I am not so certain of is the expected behavior of the
find script:
Option1: Kicad_INCLUDE_DIR is set to:
${SOME_SYSTEM_PATH}/include/kicad
This would require no changes to the kicad source since
the kicad headers use the form "plugins/whatever" to include
headers related to the plugin system. However, some people
might argue that it's not clear that we're thinking of kicad
plugins and might prefer:
Option2: Kicad_INCLUDE_DIR is set to:
${SOME_SYSTEM_PATH}/include
This would require the following changes to headers and
directory structure:
a. headers change from using #include "plugins/whatever" to
#include "kicad/plugins/whatever"
b. move the directory include/plugins to include/kicad/plugins
-- however I'm not so comfortable having a 'kicad' directory
within the main branch's "include" dir.
Some thought has to go into what KiCad may be like in the
future - will we have more shared libraries, will we have only
plugin-related shared libs and headers or is it possible we
will have others. For example if we were certain that we
will only have plugin headers then we can install headers to
${SOME_SYSTEM_PATH}/include/kicad-plugins and
the include/plugins directory can simply be changed to
include/kicad-plugins and appropriate changes made to
existing headers and in-tree code.
Any comments/suggestions?
PS: Some tutorial code is largely written but is awkward
because of this situation where kicad does not (yet) install
headers. I plan to clean it up and push to the documentation
repository as soon as these last issues are addressed.
- Cirilo
Follow ups