If you’re a member of the K-3D development team creating a plugin that will become part of the "official" K-3D sources, creating an in-source plugin "foo" is the same as creating an out-of-source plugin, with just a few extra steps.
OPTION(K3D_BUILD_FOO_MODULE "Build the foo plugin module" ON)
K3D_ADD_SUBDIRECTORY(foo REQUIRES K3D_BUILD_FOO_MODULE)
If your plugin has a dependency on a third-party library "libfoo", you will need to create a special CMake file that will test to see if the libfoo is installed, and where its header files and link libraries are located:
And you’re done!