Page MenuHomePhabricator

Problem with the Macro "Provides" for the CMake Configuration
Closed, ResolvedPublic

Description

As I tried to build the new module mitkInputDevices I configured my CmakeLists.txt like this (I used the CMakeList.txt from IGT as an example):

MITK_CREATE_MODULE(MitkInputDevices

INCLUDE_DIRS SpaceNavigator
DEPENDS Mitk
PROVIDES mitkInputDevices

)

You can see the name and the provides argument are not equal, because the first letter is one time upper and the other lower case. The result of this setting was that the module was neither included and nor could be linked. Furthermore there was no warning at all, while configuring the project with CMake.

The Problem was gone, when I did not use the provides macro or they both had the same name. But somehow the user should be informed with a warning or the provides macro be fixed.

Event Timeline

I think the easiest solution would be to remove the PROVIDES functionality of the module system, it's probably not used by anyone.

Is this still an issue? It seems that we can close this bug, because De Long has already finished his diploma thesis. Maybe: Close + WontFix?

Resetting all bugs without active assignee flag to "CONFIRMED". Change status to IN_PROGRESS if you are working on it.

(In reply to comment #1)

I think the easiest solution would be to remove the PROVIDES functionality of
the module system, it's probably not used by anyone.

There are currently 15 Modules using the PROVIDES-macro and the Core-Lib

  • ImageStatistics
  • RigidRegistrationUI
  • ToFProcessing
  • IGTUI
  • ImageExtraction
  • ToFUI
  • DeformableRegistration
  • OpenCVVideoSupport
  • OpenCVVideoSupport/UI
  • RigidRegistration
  • CameraCalibration
  • ToFHardware
  • IGT
  • MitkExt
  • DeformableRegistrationUI

and the naming-scheme is also not unified over the differen Modules. Some of them use Mitk<MODULE_NAME>, some of them mitk<MODULE_NAME>

It is actually irrelevant whether the names differ or not as long everyone knows that the MODULE_NAME is the one to be used to claim dependency.

[RFD] Do we need the PROVIDES string at all?

Change request written. Proposed fix pushed to topic branch.

[f7b31f]: Merge branch 'bug-4839-ProvidesMacroCleanup'

Conflicts:
Core/Code/Da

Merged commits:

2011-08-31 18:11:50 Jan Hering [cff084]
Removed PROVIDES option from MITK_CREATE_MODULE()

  • removed variable from the macro definition
  • the MODULE_PROVIDES variable is set to the value of MODULE_NAME
  • changing mitkCore to Mitk in config for MINGW
  • explicitly changing mitkCore to Mitk for core-EXPORTS in mitkCommon.h

2011-08-31 18:10:17 Jan Hering [e1c488]
Removing usage of PROVIDES in MITK_CREATE_MODULE()

for MITK Modules and glew Utility

[551e77]: Merge branch 'bug-4839-ProvidesMacroCleanup'

Merged commits:

2011-09-02 16:55:08 Jan Hering [32d069]
COMP: Replacing forgotten mitkCore by Mitk

[117dee]: Merge branch 'bug-4839-fix-headers-only-module-and-provides-variable'

Merged commits:

2011-09-04 14:56:26 Sascha Zelzer [d9a98c]
Only set MODULE_PROVIDES if the module is not headers only