Greetings,
I need to ship my application as source code. Is there a way to build the application and DCMTK at the same time without precompiling DCMTK? I can't provide precompiled binary because i do not know on which system it will be done.
I tried to include DCMTK's CMakeLists.txt in my application's CMakeLists.txt using add_subdirectory but, include paths are all wrong.
Any idea?
How to use CMAKE to build a program and dcmtk at the same time
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi,
I think it should possible though I never tried. But other projects do that, like CommonTK.
What kind of errors you get? Include path while compiling DCMTK or after that, compiling the part that contains your own project? The latter would be easier to explain. Maybe you could give some more details.
Best regards,
Michael
I think it should possible though I never tried. But other projects do that, like CommonTK.
What kind of errors you get? Include path while compiling DCMTK or after that, compiling the part that contains your own project? The latter would be easier to explain. Maybe you could give some more details.
Best regards,
Michael
In my CmakeLists.txt I use add_subdirectory(dcmtk) with dcmtk be the subdirectory with the dcmtk's source tree. It compiles fine (all modules) but, when i try to use dcmtk in my program i get this problem: as an example #include "dcmtk/dcmimgle/dcmimage.h" do not exists because it point to the dcmtk source tree in which this header is located in dcmtk/dcmimgle/include/dcmtk/dcmimgle/. I know i could rewrite all headers include to mach this new layout but i'd like to use the same header layout as the precompiled library.
Thank you for your time and sorry for my poor english.
Mario
Thank you for your time and sorry for my poor english.
Mario
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi Mario,
no problem, your English is just fine to understand.
Right, one possibility would be to change all the #include directives. However, the better possibility is if you
1) Either also call the INSTALL target to a directory that you specify as CMAKE_INSTALL_PREFIX for DCMTK, or
2) you add all DCMTK include directories that reside in the DCMTK source tree (e.g. c:\src\dcmtk\oflog\include c:\src\dcmtk\ofstd\include c:\src\dcmtk\dcmdata\include... and so on).
Both possibilities are much easier than changing all #includes in your source. Whether 1) is possible depends on how you build your source code (Unix, windows, Visual Studio or NMake, ...). So maybe 2) is most easy to do.
Also, for linking your application later on, you have to add all the directories to the linker input, where CMake puts the compiled DCMTK libaries.
Best regards
Michael
no problem, your English is just fine to understand.
Right, one possibility would be to change all the #include directives. However, the better possibility is if you
1) Either also call the INSTALL target to a directory that you specify as CMAKE_INSTALL_PREFIX for DCMTK, or
2) you add all DCMTK include directories that reside in the DCMTK source tree (e.g. c:\src\dcmtk\oflog\include c:\src\dcmtk\ofstd\include c:\src\dcmtk\dcmdata\include... and so on).
Both possibilities are much easier than changing all #includes in your source. Whether 1) is possible depends on how you build your source code (Unix, windows, Visual Studio or NMake, ...). So maybe 2) is most easy to do.
Also, for linking your application later on, you have to add all the directories to the linker input, where CMake puts the compiled DCMTK libaries.
Best regards
Michael
Who is online
Users browsing this forum: Google [Bot] and 1 guest