Page MenuHomePhabricator

Enable CMake hook for out-of-source bundles and modules
Closed, ResolvedPublic

Description

It should be possible to include extra bundles and modules in a standard MITK build.

Event Timeline

[435647]: Merge branch 'bug-10131-enable-private-modules'

Merged commits:

2011-11-11 23:29:04 Marco Nolden [a26133]
Enable extra modules via MITK_PRIVATE_MODULES


2011-11-11 23:28:39 Marco Nolden [f3bb56]
Enable extra plugins via MITK_PRIVATE_MODULES

Please test this: specify MITK_PRIVATE_MODULES in MITK-build configuration (not superbuild!) as PATH entry and point it to a directory containing extra modules (as directories) and a PluginList.cmake file listing extra plugins:

ExtraDir/

ModulesA/
ModuleB/
org.mitk.test1/
org.mitk.test2/
PluginList.cmake

PluginList.cmake:
SET(MITK_PRIVATE_PLUGINS

org.mitk.test1:ON
org.mitk.test2:ON

)

Warning: this feature is experimental and can be removed anytime!

We copied a bundle to an external folder (D:/Toolkits/MBI-PRL/) and set the MITK_PRIVATE_MODULES variable to D:/Toolkits/MBI-PRL/ and created the PluginList.cmake containing just the following:

SET(MITK_PRIVATE_PLUGINS

org.mitk.gui.qt.ritkview:ON

)

After running "configure" of CMake we recieved the following error message:

CMake Error at D:/Toolkits/MITK_BUILD/CMakeExternals/Source/CTK/CMake/ctkFunctionExtractOptionNameAndValue.cmake:11 (MESSAGE):

Option D:/Toolkits/MBI-PRL/org.mitk.gui.qt.ritkview:ON is incorrect.
Options should be specified using the following format OPT1:[ON|OFF].  For
example OPT1:OFF or OPT2:ON

Call Stack (most recent call first):

D:/Toolkits/MITK_BUILD/CMakeExternals/Source/CTK/CMake/ctkMacroSetupExternalPlugins.cmake:61 (ctkFunctionExtractOptionNameAndValue)
CMakeLists.txt:541 (ctkMacroSetupExternalPlugins)

Do you have any idea how to fix this issue? Or what we did wrong?

The RE match fails in here:

  1. Make sure option is correctly formated IF(NOT "${my_opt}" MATCHES "^[/A-Za-z0-9._]+:(ON|OFF)") MESSAGE(FATAL_ERROR "Option ${my_opt} is incorrect. Options should be specified using the following f ormat OPT1:[ON|OFF]. For example OPT1:OFF or OPT2:ON") ENDIF()

Possible cause: No '-' and ':' allowed in the RE? The error message tells that the function is trying to match the WHOLE path to the plugin.

I tried to make this work on Linux (without having : or - in my path) and found another issue:

CMake Error at /home/kilgus/local/RenderingBin/CMakeExternals/Source/CTK/CMake/ctkFunctionGenerateDGraphInput.cmake:55 (MESSAGE):

Target directory
/home/kilgus/local/RenderingWorkDir//usr/local/thomas/PRLMBISource/org.mitk.gui.qt.tofprl/CMakeLists.txt
doesn't exists !

Call Stack (most recent call first):

/home/kilgus/local/RenderingBin/CMakeExternals/Source/CTK/CMake/ctkMacroSetupExternalPlugins.cmake:80 (ctkFunctionGenerateDGraphInput)
CMakeLists.txt:541 (ctkMacroSetupExternalPlugins)

The path above is a mix between my MITK Source "/home/kilgus/local/RenderingWorkDir" and the MITK_PRIVATE_MODULES varibale "/usr/local/thomas/PRLMBISource", and thus incorrect.

I commited a fix for the first issue (windows path) to CTK and updated the hash we use in mitk. This is in bug-10131-enable-private-modules since dashboard is red. Please test this, do not forget to re-run MITK-Superbuild to get the updated CTK.

For the second issue, the linux error, please recheck your PluginList.cmake. Is it still the version posted here before?

(In reply to comment #7)

I commited a fix for the first issue (windows path) to CTK and updated the hash
we use in mitk. This is in bug-10131-enable-private-modules since dashboard is
red. Please test this, do not forget to re-run MITK-Superbuild to get the
updated CTK.

For the second issue, the linux error, please recheck your PluginList.cmake. Is
it still the version posted here before?

Yes, it is still the same PluginList.cmake and located in /usr/local/thomas/PRLMBISource.

I double-checked this again without using a link. Still the same error message.

Unfortunately I still have the exact same error ... even when I remove the "-" in the path (D:/Toolkits/MBIPRL):

CMake Error at D:/Toolkits/MITK_BUILD/CMakeExternals/Source/CTK/CMake/ctkFunctionExtractOptionNameAndValue.cmake:11 (MESSAGE):

Option D:/Toolkits/MBIPRL/org.mitk.gui.qt.tofprl:ON is incorrect.  Options
should be specified using the following format OPT1:[ON|OFF].  For example
OPT1:OFF or OPT2:ON

Call Stack (most recent call first):

D:/Toolkits/MITK_BUILD/CMakeExternals/Source/CTK/CMake/ctkMacroSetupExternalPlugins.cmake:61 (ctkFunctionExtractOptionNameAndValue)
CMakeLists.txt:541 (ctkMacroSetupExternalPlugins)

Thomas and me have scheduled a meeting to fix this tomorrow afternoon.

I just updated the CTK hash again in this bug branch. Please make sure you rerun the MITK superbuild to test this. Check twice if the CTK source has been updated to

21b1a4ef36d9ecb14750cdbf7aca0d697ee26e36

[d623bd]: Merge branch 'bug-10131-enable-private-modules'

Conflicts:
CMakeExte

Merged commits:

2011-11-29 17:46:51 Marco Nolden [4ec863]
Updated to another (special) CTK version


2011-11-15 11:57:25 Marco Nolden [4ac180]
Updated CTK to use external plugins fix

I switched to the master branch, rebuilt the Superbuild and then tried to configure my mitk in cmake with the additional entry MITK_PRIVATE_MODULES. My path points to D:/Toolkits/MBIPRL.
When I click "configure" I recieved the following message:

CMake Error at D:/Toolkits/MITK_BUILD/CMakeExternals/Source/CTK/CMake/ctkFunctionGenerateDGraphInput.cmake:55 (message):

Target directory D:/Toolkits/MITK/D/CMakeLists.txt doesn't exists !

Call Stack (most recent call first):

D:/Toolkits/MITK_BUILD/CMakeExternals/Source/CTK/CMake/ctkMacroSetupPlugins.cmake:162 (ctkFunctionGenerateDGraphInput)
CMakeLists.txt:596 (ctkMacroSetupPlugins)

Besides a new entry with a checkbox appears on top of my cmake entries: MITK_BUILD_D

My PluginList in my external plugin directory

[d8e854]: Merge branch 'bug-10131-enable-private-modules'

Conflicts:
CMakeExte

Merged commits:

2011-12-21 14:13:30 Marco Nolden [ef4311]
Updated to a special CTK version

Quote from Sven's mail:

Also ich hab mir vorsorglich einfach nochmal ganz neu den Master gezogen, alles gebaut, dann die Variable gesetzt und außer einer Kleinigkeit hat alles geklappt :)
Folgendes passierte, meine generierte "startExtApp_debug.bat" und "startExtApp_release.bat" musste ich selber editieren und hinter die "bin/" überall noch "debug" oder "release" schreiben.

The batch file problem has been fixed in T10752