[Cmake] wrapping with cable: multiple groups into one package (= one dll)

Bertram G. Herzog bertram at bwh.harvard.edu
Tue Mar 25 22:27:36 EST 2003


Hello dear fellow cabler's (again)!

After updating my CABLE -- THANKS, IT WORKS !!! :-) I'm kind of stuck on a
rather totally newbie question:.
If I understand the system of packages and groups right, then the CABLE
"hirarchy" is "package" over "group", where every group has to be listed
in the "groups"-array once through all the wrapper-config-files.

So if I want to pack several subdirectories, each represented by a group
of wrappers, into a package, I thought of the following approach:

wrap_config_subdir_1.cxx:
... package = "thePackage";
... group = "wrappergroup1";
... groups [] = {"wrappergroup1", "wrappergroup2"};

wrap_config_subdir_2.cxx:
... package = "thePackage";
... group = "wrappergroup2";
... groups [] = {"wrappergroup1", "wrappergroup2"};

Both the directories of the object-files are in the CMakeLists.txt
LINK_DIRECTORIES. Wrapping is triggered from within CMake via
ITK_WRAP_TCL(thePackage
   wrap_config_subdir1.cxx
   wrap_config_subdir2.cxx)

... and both generated object-files are in the TARGET_LINK_LIBRARIES
statement.

That way I think I am able to get ONE dll for "thePackage", but can write
smaller and better to maintain config-files for the wrapper.

Somehow, I am wrong, since the linker gives me an error when trying to
link the compiled wrapper "wrappergroup2_tcl.obj". It states that
"_thePackage_Init" is already defined in the first of the two compiled
object-files. ITK as the reference doesn't seem to helpful, since here a
single package for every "branch" of the toolkit is defined.

Thank you very much for your thoughts,
  Bertram Herzog





More information about the CMake mailing list