Problem with FAQ#40

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
smfmazz
Posts: 7
Joined: Mon, 2010-09-06, 17:19

Problem with FAQ#40

#1 Post by smfmazz »

Hi, excuse me for my bad english.
I have read the FAQ 40 but i don't understand.
1) I have create DCMTK project files with CMake (i have read the installation file).
2) I have open the main project
3) I Have compile "ALL BUILD" with visual studio 2005 the project dcmtk
4) What it means: "Select target install in order to install the DCMTK files to the directory using CMake?" I must compile the install class with visual studio? Or with cmake? What i do insert in box "source code" and "build the binaries"?

5) Now i do create a new directory in my hard disk with the file "testapp.cpp" and "CMakeLists.txt". Is correct?


6) And now? How i create the project with cmake?

thank you for the support

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Problem with FAQ#40

#2 Post by Michael Onken »

Bon Giorno,
smfmazz wrote:Hi, excuse me for my bad english.
My Italian is worse ;)
I have read the FAQ 40 but i don't understand.
1) I have create DCMTK project files with CMake (i have read the installation file).
2) I have open the main project
3) I Have compile "ALL BUILD" with visual studio 2005 the project dcmtk
After you have done that, DCMTK is compiled within Visual Studio but is still not installed to your system, i.e. copied for example to the "c:\program files\DCMTK" folder.
4) What it means: "Select target install in order to install the DCMTK files to the directory using CMake?" I must compile the install class with visual studio? Or with cmake? What i do insert in box "source code" and "build the binaries"?
5) Now i do create a new directory in my hard disk with the file "testapp.cpp" and "CMakeLists.txt". Is correct?
6) And now? How i create the project with cmake?
That just means, that if you select "Build" on the target "INSTALL" (instead of "ALL BUILD" what you did before) then Visual Studio will copy all compiled libraries, headers, binaries and so on to their final location on your system. You won't need this if you want to add something now to DCMTK (write your own application as DCMTK extension). In that case, do the following:
  • Select the module (dcmdata, dcmnet, ...) that fits best the application that you want to write. Go to the apps directory within that module and edit the CMakeLists.txt. You have to add the source code file of your own application there, just the way the other commandline tools are added there.
  • Create your new source code file. Be sure to alwas include first "dcmtk/config/osconfig.h".
  • Call CMake and generate the Visual Studio files again.
  • After opening the .sln file in Visual Studio, you should find your new application in the Project List, ready for compilation.
If you want to have a separate project that only uses DCMTK (so you dont want to have everything in one large visual studio project solution,i.e. sln file), you have to install DCMTK to your system (using INSTALL target as described above) and then create your own Visual Studio project as you like. Just be sure to set the include path to the path where you have DCMTK headers installed, e.g. "c:\Program Files\DCMTK\include". All other, further steps are not DCMTK-related, you do not have to use CMake at all.

Best regards,
Michael

smfmazz
Posts: 7
Joined: Mon, 2010-09-06, 17:19

#3 Post by smfmazz »

Thanks a lot! The program run correctly.

smfmazz
Posts: 7
Joined: Mon, 2010-09-06, 17:19

#4 Post by smfmazz »

Sorry for my insistence. If I want to create a project that uses only those libraries are required to install the toolkit (with gmake and procedures described above)? Or can I include directly the header files in my project and setting the linker to lib folder? (copy the folder with the header files in the directory of my project)

Thanks a lot

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#5 Post by Michael Onken »

Hi,

yes you should then install the toolkit. In the cmake gui you can define the directory to install where the line reads something like "INSTALL PREFIX".

Then, add the header include path of dcmtk, e.g. "c:\Program Files\DCMTK\include" to your compiler, together with the DCMTK library path, e. g. "c:\Program Files\DCMTK\lib".

You should always include "dcmtk/config/osconfig.h" first in your own project files and then include the rest that you need.

Best regards,
Michael

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest