Hello Stefan,thank you for your help.I had seen the documentation on cmake but still had a few problems.The second link helped and I just needed to set the MITK_DIR (this was the true initial problem, apparently).Adding the GuideLinesSupportLibrary to the whole project also worked and I can configure and generate it.A very basic version with a few imported libraries I need works already.However, I am running into two issues now. One regarding the usage of QT, the other regarding the usage of a cmake file.First of all, here is my CMakelists.txt file:############################################################cmake_minimum_required(VERSION 3.10)# set the project name and version
project(MRIProgram VERSION 1.0)# path to the FindGuidelinesSupportLibrary.cmake (copied the file)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/CMake)#using MITK
find_package(MITK 2018.04.02 REQUIRED)
# QT5
#set(CMAKE_AUTOMOC ON) #still commented, will be used later on
find_package(Qt5Widgets REQUIRED QUIET)# add the executable
add_executable("${PROJECT_NAME}" MRIProgram_main.cpp)target_link_libraries("${PROJECT_NAME}" PUBLIC MitkCore)
target_link_libraries("${PROJECT_NAME}" PUBLIC MitkQtWidgetsExt)
target_link_libraries("${PROJECT_NAME}" PRIVATE vtkIOExport)
target_link_libraries("${PROJECT_NAME}" PRIVATE vtkIOImport)#install command
install(TARGETS "${PROJECT_NAME}" DESTINATION bin) #${CMAKE_INSTALL_PREFIX}/bin
install(FILES "MRIProgram_main.cpp" DESTINATION src) #${CMAKE_INSTALL_PREFIX}/srcinclude(CTest)
# cmake file to be read
include("${CMAKE_CURRENT_SOURCE_DIR}/files.cmake")add_test("Project_Test" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}")##############################################################The problem is: in the same directory as my CMakeLists.txt I have a files.cmake, supposed to containthe names of further .cpp files and later on the moc files generated by QT (exactly like it is in the Step-Tutorials, for examplein Step6).It now looks of the sort(with more cpp files to come):###################################################################files.cmakeset(CPP_FILES
utils.cpp
MRIProgram_main.cpp
)###########################################################This is within the following file structure:ABC/ |-- .gitignore |-- CMakeLists.txt |-- files.cmake |-- utils.cpp |-- MRIProgram_main.cpp |-- build/ | |-- LOTS OF FILES AND DIRECTORIES `-- CMake/ |-- FindGuideLinesSupportLibrary.cmake `-- PackageDepends|-- MITK_GuidelinesSupportLibrary_Config.cmake`-- CMakeExternals/|-- ExternalProjectList.cmake|-- GuidelinesSupportLibrary.cmakeWhen I build the solution in Visual Studio, utils.cpp does not appear there, so I guess I'm doing something wrong..do you see a flaw in what I have done so far?The second question is shortly stated:Including "QmitkRegisterclasses()" into my main function I get an error, that the MitkQtWidgets.dll was not found...what could I have forgotten during the building process?I thank you ver much in advance and hope to hear from you soon.Kind regardsIvaylo AngelovGesendet: Freitag, 08. November 2019 um 10:02 Uhr
Von: "Dinkelacker, Stefan" <s.dinkelac...@dkfz-heidelberg.de>
An: "Ivaylo Angelov" <ivaylo_ange...@gmx.de>
Cc: "mitk-userslists.sourceforge.net" <mitk-users@lists.sourceforge.net>
Betreff: RE: AW: [mitk-users] creating an MITK projectHi,
CMake has an extensive documentation on how find_package() is trying to find things and in which order. There are many options and ways to allow you to tell CMake how it should find things by setting certain variables, so I highly recommend to dive into this page to get a better understanding of this process:
https://cmake.org/cmake/help/v3.15/command/find_package.html
Make sure to select your CMake version in the documentation at the top to get an accurate description.
See slide 8 of the following presentation to see a minimum but working example:
http://mitk-um.org/wp-content/uploads/2016/05/MITK_Tutorial_Introductory_Session.pdf
From: Ivaylo Angelov [mailto:ivaylo_ange...@gmx.de]
Sent: Thursday, November 7, 2019 10:23 PM
To: Dinkelacker, Stefan <s.dinkelac...@dkfz-heidelberg.de>
Cc: mitk-userslists.sourceforge.net <mitk-users@lists.sourceforge.net>
Subject: Aw: AW: [mitk-users] creating an MITK project
Hello Stefan,
thank you for your detailed explanation on the matter.
I have a follow-up question regarding this:
I chose the first option, because I already have a bit of a GUI that is more than sufficient, so I figured,
I might as well just use MITK as a library and thereby learn a bit about cmake, which I had not used by then
(apart from the MITK setup of course).
Given that my project is located elsewhere on my computer and I don't want to copy everything another time into my project folder,
I figured that, what I have to do in order to use all MITK functionalities I would like is to
include the * find_library() * or * find_package() * command and then use
*target_link_libraries(MY_EXECUTABLE LIBRARY)*.
Unfortunately I can not make up how to use those in order to be able to use MITK as a library (maybe it's more suitable to use *target_include_directories()* ..?).
I guess it is quite a basic question but I got very confused trying to accomplish this and hope that you can help me.
There is also a follow up to that, because I was thinking about further code I will write:
having set that up, will I be able to also use VTK functionalities or do I have to proceed similarly with those.
In that case, I guess the information I found under >>https://vtk.org/Wiki/VTK/Tutorials/CMakeListsFile<<
would be the way to proceed.
Thank you very much in advance!
Kind regards,
Ivaylo Angelov
Gesendet: Montag, 07. Oktober 2019 um 08:24 Uhr
Von: "Dinkelacker, Stefan" <s.dinkelac...@dkfz-heidelberg.de>
An: "Ivaylo Angelov" <ivaylo_ange...@gmx.de>, "mitk-userslists.sourceforge.net" <mitk-users@lists.sourceforge.net>
Betreff: AW: [mitk-users] creating an MITK projectHi,
basically you can follow two different paths when using MITK:
(1) Using MITK as a toolkit/library. You can use all the MITK features like algorithms, data handling, rendering but are responsible for designing and developing the actual application. This is very flexible but you will probably write some thousands lines of codes more for the boilerplate code of interactive GUI applications.
(2a) Using MITK as a framework. You develop a BlueBerry application like the MITK Workbench or MITK Diffusion with all the possibilities but also the restrictions a framework dictates. It is possible to write a completely new BlueBerry application that looks quite different from the typical MITK Workbench look and feel or you could take the probably easiest approach (b) of just writing modules and plugins for the standard MITK Workbench, switching everything off or on to your liking with a build configuration file, but you end up with a MITK Workbench-style application - Menu, toolbar, plugin views and an the editor in the center.
I usually recommend the last approach [2b] if there isn't any blocker as you can concentrate on the actual code for your features. This is also a good staring point for beginners as one can later still write a completely customized BlueBerry application and just use the already developed modules and plugins [2a]. The customized BlueBerry application approach is currently very tough to use in the beginning, as we do not have a minimal example actually explaining the details of how things are working. In fact, I am currently creating such an application example for the MITK ProjectTemplate but it even takes quite an amount of time for me as an MITK core developer. I probably push it into the MITK ProjectTemplate this month. If you do not really care of what is going on in detail you can just copy one of the minimal BlueBerry examples or even the MITK Workbench or MITK Diffusion and delete and add stuff as needed in a kind of trial-and-error approach.!
Best,
Stefan
Von: Ivaylo Angelov <ivaylo_ange...@gmx.de>
Gesendet: Mittwoch, 2. Oktober 2019 23:13
An: mitk-userslists.sourceforge.net
Betreff: [mitk-users] creating an MITK project
Dear all,
I have a general question on building projects based on MITK.
My goal is to build a small application in which I would like to give the user opportunity to load and view certain datasets
and alter them by using (mostly) MITK and VTK libraries as well as QT.
In the end I would like to create an executable file for convenience.
After reading a lot of documentation and browsing through your website, I am still a little confused
as to what is the most suitable way to start building such an application...
it seems to me that creating a module would be a proper way and within that module incorporate
the libraries etc that I need..
The other possibility I see is creating an Application, following the style of your
"Workbench" or "Plugin-Generator"... the last two I mention because I pictured a project
in which I have an own Solution File, e.g. a completely new Visual Studio solution, incorporating certain
MITK functionalities and ultimately executing my "application".
You could describe it as trying to set up my own workbench, in a sense that I want to have an application that I can extend
and I can work on in a separate solution file.
Could you guide me through what I have to do or point me to a tutorial I may have missed on your page
or tell me the crucial files/settings I have to take into consideration (maybe with the workbench as an example).
I apologize for the long mail but I am trying to picture it as well as possible to do it properly right away.
Thank you very much in advance, I hope to hear from you soon.
Kind regards
Ivaylo Angelov
_______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users