Hello,

I solved the problem. Some building options and output path were missing in the CMakeLists.txt . Thank you for your time.

Paolo


Le 6/9/2017 à 3:23 PM, Paolo Cabras a écrit :

Hello everyone,

I am new to MITK and I am creating an application using MITK as an external toolkit. I used 'mitk_create_executable' (in my CMake project) and I am trying to create my own module for managing the user interaction. As a start, I copied and (slightly) modified gizmo module and tried to use the modified version in my GUI. I put the code in Modules directory within my cmake source directory and organized the files as in [1].

The build process succeeds, but when I run the application, an exception is thrown at 'interactor->LoadStateMachine("myStateMachine.xml",us::ModuleRegistry::GetModule("myModule"));'. Debugging a bit further, it seems that the problem is that ModuleRegistry::GetModule returns 0, since no module with that name was found. However, it is recognized when used in mitk_create_executable(my_app DEPENDSMitkCoreMitkQtWidgetsExtMitkIGTBasemyModule).

What Am I missing ? Is that possible to create modules like this? Actually, ModuleRegistry recognizes myModule if I add it within the Awesome-project as explained in [1].

I am using QtCreator with Qt5.7, win 7, compiler msvc 2013 - 32 bit, MITK 2016.11.0 .

Thank you for your time.

Best regards,

Paolo


[1] http://docs.mitk.org/2016.03/NewModulePage.html


---- my project CMakeLists.txt ------------

cmake_minimum_required(VERSION 3.2 FATAL_ERROR)

project(myProject)
# MITK
find_package(MITK 2016.03 REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# QT5
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets REQUIRED QUIET)

add_subdirectory(Modules) # where myModule source files are, same path organization as in [1]
mitk_create_executable(my_app
     DEPENDS MitkCore MitkQtWidgetsExt MitkIGTBase myModule
     )
--------- module Cmake ----------

MITK_CREATE_MODULE( myModule
   INCLUDE_DIRS
     PUBLIC include
     PRIVATE src
   DEPENDS MitkCore
   WARNINGS_AS_ERRORS
)


<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

--
Paolo Cabras
Research Engineer
Automatic, Vision and Control Team
ICUBE (UMR 7357 CNRS-Université de Strasbourg)
+33 (0) 3 88 11 90 68

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to