Page MenuHomePhabricator

[Documentation] Update "How to create a new MITK Module"
Closed, ResolvedPublic

Description

I want to create an new module. Therefore I read the tutorial (https://docs.mitk.org/nightly/NewModulePage.html) and follow the steps.
First I created a folder in Modules. Then I wanted to add the folder in CMakeLists.txt in the Modules directory in the section set(module_dirs) but I can not find this section so I add it. But when I build it in QtCreator there is an error that says the new module is not in a CMakeLists.txt file.
I found a ModuleList.cmake file where I added my module too but it is still the same error.
Then I create a CMakeLists.txt file in the Module/myModule directory like this:

MITK_CREATE_MODULE(
  INCLUDE_DIRS
    PUBLIC ${MITK_BINARY_DIR}
    PRIVATE src/DataManagement
  DEPENDS PUBLIC MitkCore
  SUBPROJECTS MITK-Examples
)

but there is an error which says that the INTERFACE libary can only use with the interface key word.

Has anyone an idea to resolve this?

Event Timeline

kislinsk renamed this task from How to create a new MITK Module to [Documentation] Update "How to create a new MITK Module".Aug 10 2020, 12:29 PM
kislinsk triaged this task as Normal priority.
kislinsk updated the task description. (Show Details)
kislinsk edited projects, added MITK (v2021.02); removed MITK.
kislinsk moved this task from Backlog to Documentation on the MITK (v2021.02) board.

Thanks for the report. I renamed the task to an actual task as the documentation you are referring to seems not to be up-to-date regarding ModuleList.cmake.

For questions, though, please use the #help-mitk Slack channel or the mitk-users mailing list (public).

  • For most up-to-date templates of modules, pulgins, applications, see the MITK-ProjectTemplate
    • As you can see in the ExampleModule template, only add your module folder to the ModuleLists.cmake file and do not touch the CMakeLists.txt file in the Modules folder.
    • See also the files.cmake file in the ExampleModule template. You need to specify actual .cpp files to have something to compile. Otherwise it would be an interface module which I guess is not what you want.
  • See the Remarkup Reference for formatting features in Phabricator like code blocks
floca added a parent task: Restricted Maniphest Task.Aug 27 2020, 9:53 AM

Deleted branch bugfix/T27661-NewModuleDoc.