Hi,

preliminary note: Make sure to build into a short-named top-level directory to 
keep the path names short, e.g. "D:/MITK-stable-sb" not something like 
"D:/developments/prototype/MITK-superbuild". This is crucial as Windows has 
very old path-length limitations and ITK, a dependency of MITK that is built in 
the MITK superbuild, generates very long paths in the MITK superbuild directory.


That said, let's go:


0) Install Qt 5.11 or Qt 5.12 preferably to the default location of the Qt 
installer (C:/Qt) and make sure to (a) select the 64-bit version for Visual 
Studio 2017 and (b) also check the optional components QtWebEngine and QtScript.


1) Clone the current stable branch of MITK that is based on our last release:

git clone --branch=releases/2018-04 
https://phabricator.mitk.org/source/mitk.git MITK-stable


2) Clone the MITK-ProjectTemplate:

git clone https://phabricator.mitk.org/source/mitk-projecttemplate.git​ 
MITK-projecttemplate


You now have two top-level directories like D:/MITK-stable and 
D:/MITK-projecttemplate. For simplicity, I continue with these locations:


3) Open CMake 3.14 (supported in the release branch since Apr 3 2019), set 
D:/MITK-stable as source directory and D:/MITK-stable-sb as build directory (sb 
stands for superbuild, see prelimiary note above). Click on Configure.


3a) Select Visual Studio 15 2017 as generator *and* x64 as the platform in the 
combobox right below. Click Finish. If you followed step (0), this should 
already succeed and Qt should be automatically found. If you installed Qt 
somewhere else, you must set Qt5_DIR to something like 
"E:/my/custom/path/Qt/5.12/msvc2017_64/lib/cmake/Qt5" and press Configure again.


3b) Look for MITK_EXTENSION_DIRS and set it to your ProjectTemplate path like 
"D:/MITK-projecttemplate". Press Configure again. A good sign that MITK 
recognized the ProjectTemplate is that there should now be a 
MITK_USE_GuidelinesSupportLibrary variable visible in CMake GUI. If you cannot 
find it, you probably misspelled the directory name of the ProjectTemplate. 
Please double-check.


4) Press Generate, wait until CMake finished, open 
D:/MITK-stable-sb/MITK-superbuild.sln, double-check that x64 is set as platform 
in the combobox at the top in the Standard toolbar, go to Build -> Batch 
build..., switch on BUILD_ALL in Debug and Release configuration and press 
Build.


5) Wait until MITK built everything in Debug and Release configuration. Time 
for coffee/tea.


6) After the build completed successfully, go back to CMake GUI and change the 
build directory from D:/MITK-stable-sb to D:/MITK-stable-sb/MITK-build. You are 
now configuring the actual MITK build instead of the superbuild. Here you can 
switch on and off MITK plugins for example. The org.mitk.gui.qt.exampleplugin 
should be enabled by default and it is part of the ProjectTemplate. If not, 
switch it on. Configure, generate and then open 
D:/MITK-stable-sb/MITK-build/MITK.sln.


7) MitkWorkbench should be the default startup project in the MITK.sln 
solution, so simply hit start and after a short build time, the Workbench 
should show up with all the plugins you switched on.


8) Explore the D:/MITK-projecttemplate directory/source code. Start with the 
module directory and then the plugins directory. You will find a lot of 
comments and suggestions in these source file targeting newbies and explaining 
basic MITK concepts.


Best,

Stefan


________________________________
Von: 李面面 <olor...@gmail.com>
Gesendet: Montag, 21. Oktober 2019 05:43
An: mitk-users@lists.sourceforge.net
Betreff: [mitk-users] How can I make my own applications and use mitk?

Greetings,
1) On what system do you work? (Linux/Windows/Mac, which OS-Version, 32 or
64 bit)
a. Windows 10 64

2) What compiler do you use? (e.g. gcc, VC9, VC10, clang)
a. VC15 (Visual Studio 17)

3) Which tool did you use to build the project? (e.g. cmake, also provide
the version number)
a. CMake 3.12.4
b. CMake 3.13.5
c. CMake 3.14.5
d. CMake 3.15.3

4) Which version of MITK did you try to build/compile? (please also provide
the branch name or the hash value of the git version)
a. I'm not sure which version I'm using, but I checked my mitk 
source/CMakeLists.txt, one line is like this 'project(MITK VERSION 2018.04.99)'


In a word, I want to make my own QT applications ( with my own ui ), but I also 
want to use some mitk functions.
I've finished the superbuild of MITK, then I stucked here for 3 weeks ;___;
I tried the following steps:
1. The first thing I do after compiled the mitk is trying to use the 
MitkPluginGenerator.
And I tried the command: MitkPluginGenerator -plugin-symbolic-name 
org.mycompany.myplugin -view-name "My View" -project-name "MyProject" 
-project-app-name "MyApp" -o E:\MITKxm\bianyi
Then superbuild this MyProject, but it shows fatal error LNK1112: module 
machine type 'x86' conflicts with target machine type 'x64' I tried to change 
earlier CMake version, but the CMakeLists.txt of MyProject requires cmake 
version minimum 3.14.5.  I couldn't fix it.
2. Then I read some posts, I think you can just write your own CMakeLists to 
construct the project and inject the MITK stuff, but I couldn't find an example 
that can use on recently MITK version.  And I'm new with CMake...  (I can only 
find  the one in 
http://docs.mitk.org/2018.04/BuildInstructionsPage.html#BuildInstructions_Prerequisites,
 but the one is too small, and it doesnt contain the QT)
3. Then read some more posts, they said you can use the mitk-project template 
but I couldn't know how to run this template(like I wanted to run 
Modules/ExampleModule/cmdapps to do the same with the step1 of tutorials). I 
tried to use CMake to config the cmdapps directory (only this directory has 
CMakeLists.txt), and it doesnt work T__T
Then i tried to config the MITK source directory and set the 
MITK_EXTENSION_DIRS to the template dir, but it still doesn't work (I cant find 
the external mitk dir in CMake,and it starts to re superbuild MITK ?_?)
4. After that, I was thinking if my mitk version is wrong, I tried to get 
another version of mitk git clone -b releases/2018-04 (but I'm not sure if its 
the right command), but fail of compile: CMake Error at 
CMake/mitkMacroInstallTargets.cmake:23 (get_target_property): called with 
non-existent target 'MitkImageResampler). And I tried to change CMake 
verstsion, but can't fix it :<


I only want to make my own QT project, and use some mitk functions inside, 
(like use the image registration, and image segmentation part)
Could you please help me out?


Best regards
Veltia

_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to