Page MenuHomePhabricator

Package dependencies should include required components
Closed, ResolvedPublic

Description

Currently, package dependencies of MITK modules will depend on the default set of libraries/components of that package. In case of ITK and VTK for example, this will introduce dependencies to all available ITK and VTK modules, bloating include and linker search paths.

For Qt4 and Qt5, special QT4_MODULES and QT5_MODULES arguments for the MITK_CREATE_MODULE macro have been introduced. However, this approach does not scale for more packages which can handle component sub-sets.

Event Timeline

Very nice idea. The syntax part is for sure a matter of taste and perhaps my version is even more complicated to implement. If it is not too much work, I think I would prefer

ITK:ITKSpatialObjects ITK:ITKWaterShed
or
ITK.ITKSpatialObjects ITK.ITKWaterShed

over

ITK>ITKSpatialObjects|ITKWaterShed

This is just because I don't see the ">" and "|" characters very often as separators.

(In reply to Daniel Maleike from comment #1)

Very nice idea. The syntax part is for sure a matter of taste and perhaps my
version is even more complicated to implement.

You are right that the syntax is a little bit "special".

Changing the separators is trivial, and providing different components for the same package (separate by a space) already works. So we can easily switch to any syntax we agree on (and both variants would just work - using a special character to separate component names for the same package or listing a package multiple times with one component each).

If it is not too much work, I
think I would prefer

ITK:ITKSpatialObjects ITK:ITKWaterShed

I would also prefer ":" but did refrain from using it because ":" is sometimes used in imported CMake targets as a "namespace delimiter" and this could confuse the system if the component name is supposed to contain a ":" character.

or
ITK.ITKSpatialObjects ITK.ITKWaterShed

This is also a good one, but I would still like to define a separator for component lists too. So we could do

1.)

PACKAGE_DEPENDS ITK>ITKSpatialObjects|ITKWaterShed

or equivalent

PACKAGE_DEPENDS ITK>ITKSpatialObjects

ITK>ITKWaterShed

2.)

PACKAGE_DEPENDS ITK.ITKSpatialObjects+ITKWaterShed

or equivalent

PACKAGE_DEPENDS ITK.ITKSpatialObjects

ITK.ITKWaterShed

3.)

PACKAGE_DEPENDS ITK|ITKSpatialObjects+ITKWaterShed

or equivalent

PACKAGE_DEPENDS ITK|ITKSpatialObjects

ITK|ITKWaterShed

or any other combination of two separators. I now like version 3 since the compact one-line version visually groups the component names tighter together (in my opinion). Something like version 2 would by okay too.

New remote branch pushed: bug-16809-package-dependencies-with-components

(In reply to Sascha Zelzer from comment #2)
3.)

PACKAGE_DEPENDS ITK|ITKSpatialObjects+ITKWaterShed

or equivalent

PACKAGE_DEPENDS ITK|ITKSpatialObjects

ITK|ITKWaterShed

or any other combination of two separators. I now like version 3 since the
compact one-line version visually groups the component names tighter
together (in my opinion). Something like version 2 would by okay too.

You are right, this version looks right :-)

[c768b4]: Merge branch 'bug-16809-package-dependencies-with-components'

Merged commits:

2014-01-20 22:59:19 Sascha Zelzer [d41d56]
There is no ITK_GDCM_DIR variable any more.


2014-01-20 22:58:45 Sascha Zelzer [d70094]
Fixed component syntax for package dependencies.


2014-01-17 16:42:57 Sascha Zelzer [01ab96]
Changed syntax for component specifications.


2014-01-17 01:58:11 Sascha Zelzer [06a6c5]
Modules can now specify components for package dependencies.


2014-01-13 18:43:16 Sascha Zelzer [9bf703]
Added new PACKAGE_TESTS label for exclusion during ctest calls.


2014-01-13 18:42:43 Sascha Zelzer [0a7a0e]
Removed unused CMake Variables for link and include dirs.

[26fc02]: Merge branch 'bug-16809-package-dependencies-with-components'

Merged commits:

2014-01-21 01:08:06 Sascha Zelzer [250fbc]
COMP: fixes missed syntax changes in component specifications.

[bddca1]: Merge branch 'bug-16809-package-dependencies-with-components'

Merged commits:

2014-01-21 02:37:56 Sascha Zelzer [165ba1]
COMP: Link vtkRenderingFreeTypeOpenGL to Mitk

[271eb2]: Merge branch 'bug-16809-package-dependencies-with-components'

Merged commits:

2014-01-21 12:39:55 Sascha Zelzer [3979fe]
COMP: Add accidentally removed compile definitions again.

[205371]: COMP: Merge branch 'bug-16809-package-dependencies-with-components'

Merged commits:

2014-01-24 05:11:07 Sascha Zelzer [e838df]
Fixed CMake scoping bug of compile flag variables.

The new compile flags were not considered by the add_library() call,
unless they are set in the parent (directory) scope. The FiberTracking
Module now does not compile with WARNINGS_AS_ERRORS any more.


2014-01-24 05:09:32 Sascha Zelzer [0383d1]
Fixed a bug when CXX_RESULT_VAR was CMAKE_CXX_FLAGS.

[647cc8]: COMP: Merge branch 'bug-16809-package-dependencies-with-components'

Merged commits:

2014-01-24 15:02:55 Sascha Zelzer [e19f8c]
Fixed uninitialized variable warnings

[cb8e3a]: Merge branch 'bug-16809-package-dependencies-with-components'

Merged commits:

2014-01-26 23:48:19 Sascha Zelzer [0d858c]
Fixed unused-but-set-variable warning.

[e57c03]: Merge branch 'bug-16809-package-dependencies-with-components'

Merged commits:

2014-02-04 16:28:12 Sascha Zelzer [b10562]
Add auto-load dependencies to test drivers.


2014-01-31 17:32:17 Sascha Zelzer [d98eb7]
Set CMake variables from mitk_create_module in the parent scope.