<div dir="ltr"><div><div><div><div><div><div><div>Hi Csaba, <br><br><br></div><div>In CTKConfig, the variable "CMAKE_MODULE_PATH" is a CMake global variable that is empty by default. On the other hand "CTK_CMAKE_UTILITIES_DIR" should not be empty as illustrated below:<br>
<br>$ cat ../CTKConfig.cmake | ack -i "set\(CTK_CMAKE_UTILITIES_DIR"<br>SET(CTK_CMAKE_UTILITIES_DIR "/home/jchris/Projects/CTK/Utilities/CMake")<br></div><div><br><br></div><br><br></div>Otherwise, you will find below the result of my experiment. When configured, CTK found the expected DCMTK.<br>
<br><br>On Ubuntu 13.04 using CMake 2.8.11.2, after installing the package "python2.7-dev" doing so the following works.<br>
<br></div><div>Note that I didn't enable CTK_ENABLE_ALL since I didn't the build system to build VTK or ITK components. Instead, I passed the following options:<br> -DCTK_ENABLE_Python_Wrapping:BOOL=ON <br> -DCTK_ENABLE_DICOM:BOOL=ON <br>
-DCTK_BUILD_EXAMPLES</div><div><br></div>$ git clone git@github.com:commontk/CTK<br>
</div>$ mkdir CTK-Debug<br></div>$ cd CTK-Debug<br></div>$ cmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/home/jchris/Support/QtSDK-1.2.1/Desktop/Qt/4.8.1/gcc/bin/qmake -DCTK_ENABLE_Python_Wrapping:BOOL=ON -DCTK_ENABLE_DICOM:BOOL=ON -DCTK_BUILD_EXAMPLES:BOOL=ON ../CTK<br>
[...]<br>-- Enabling [CTK_LIB_DICOM/Core] because of [ CTK_ENABLE_DICOM:1 OR ( CTK_ENABLE_DICOMApplicationHosting:0 AND CTK_BUILD_EXAMPLES:1 )] evaluates to True<br>-- Enabling [CTK_APP_ctkDICOM] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>
-- Enabling [CTK_APP_ctkDICOM2] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>-- Enabling [CTK_APP_ctkDICOMIndexer] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>
-- Enabling [CTK_APP_ctkDICOMDemoSCU] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>-- Enabling [CTK_APP_ctkDICOMQuery] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>
-- Enabling [CTK_APP_ctkDICOMRetrieve] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>-- Enabling [CTK_APP_ctkDICOMQueryRetrieve] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>
-- Enabling [CTK_APP_ctkCommandLineModuleExplorer] because of [ CTK_BUILD_EXAMPLES:1] evaluates to True<br>-- Enabling [CTK_APP_ctkDICOMObjectViewer] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>
-- Enabling [CTK_APP_ctkSimplePythonShell] because of [ CTK_ENABLE_Python_Wrapping:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True<br>-- Generated: /home/jchris/Projects/CTK-Debug/DGraphInput-alldep.txt<br>-- Generated: /home/jchris/Projects/CTK-Debug/DGraphInput-alldep-withext.txt<br>
-- Enabling option [CTK_LIB_DICOM/Widgets] required by [ctkDICOM]<br>-- Enabling option [CTK_LIB_Widgets] required by [ctkDICOM]<br>-- Enabling option [CTK_LIB_CommandLineModules/Frontend/QtGui] required by [ctkCommandLineModuleExplorer]<br>
-- Enabling option [CTK_LIB_CommandLineModules/Frontend/QtWebKit] required by [ctkCommandLineModuleExplorer]<br>-- Enabling option [CTK_LIB_CommandLineModules/Backend/LocalProcess] required by [ctkCommandLineModuleExplorer]<br>
-- Enabling option [CTK_LIB_CommandLineModules/Backend/FunctionPointer] required by [ctkCommandLineModuleExplorer]<br>-- Enabling option [CTK_LIB_CommandLineModules/Core] required by [ctkCommandLineModuleExplorer]<br>-- Enabling option [CTK_LIB_Scripting/Python/Widgets] required by [ctkSimplePythonShell]<br>
-- Enabling option [CTK_LIB_Scripting/Python/Core] required by [ctkSimplePythonShell]<br>-- Found PythonInterp: /usr/bin/python (found version "2.7.4") <br>-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/<a href="http://libpython2.7.so" target="_blank">libpython2.7.so</a> (found version "2.7.4") <br>
-- Generated: /home/jchris/Projects/CTK-Debug/DGraphInput.txt<br>-- Generated: /home/jchris/Projects/CTK-Debug/Project.xml<br>-- Found Git: /usr/bin/git (found version "1.8.1.2") <br>-- Configuring done<br>-- Generating done<br>
-- Build files have been written to: /home/jchris/Projects/CTK-Debug<br><br><br><br></div>$ make -j6<br>[...]<br>[ 90%] Performing configure step for 'CTK-Configure'<br>[...]<br>-- Found PythonInterp: /usr/bin/python (found version "2.7.4") <br>
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/<a href="http://libpython2.7.so">libpython2.7.so</a> (found version "2.7.4") <br>-- Generated: /home/jchris/Projects/CTK-Debug/CTK-build/DGraphInput.txt<br>-- Generated: /home/jchris/Projects/CTK-Debug/CTK-build/Project.xml<br>
-- Trying to find DCMTK expecting DCMTKConfig.cmake<br>-- Trying to find DCMTK expecting DCMTKConfig.cmake - failed<br>-- Trying to find DCMTK relying on FindDCMTK.cmake<br>-- Looking for include file pthread.h<br>-- Looking fothe r include file pthread.h - found<br>
-- Looking for pthread_create<br>-- Looking for pthread_create - not found<br>-- Looking for pthread_create in pthreads<br>-- Looking for pthread_create in pthreads - not found<br>-- Looking for pthread_create in pthread<br>
-- Looking for pthread_create in pthread - found<br>-- Found Threads: TRUE <br>-- Found DCMTK: /home/jchris/Projects/CTK-Debug/CMakeExternals/Install/include/dcmtk/config <br>-- Trying to find DCMTK relying on FindDCMTK.cmake - ok<br>
-- CTKCore: BFD support disabled<br>-- Configuring done<br>-- Generating done<br>[...]<br>-- Build files have been written to: /home/jchris/Projects/CTK-Debug/CTK-build<br><br>[...]<br>[100%] Built target CTKWidgetsCppTests<br>
[100%] Built target CTK-build<br><br><div><br><br><br></div><div>$ cd CTK-build<br>$ $ cat CMakeCache.txt | ack DCMTK_DIR\:PATH<br>DCMTK_DIR:PATH=/home/jchris/Projects/CTK-Debug/CMakeExternals/Install<br><br><br><br><br>
<br>
</div><div>Let's note that DCMTK couldn't be found using DCMTKConfig.cmake, this is explained by the fact the official DCMTK didn't integrate yet our latest and greatest contribution [1]<br><br><br></div><div>
Hth<br></div><div>Jc<br></div><div><br>[1] <a href="https://github.com/commontk/DCMTK/commit/f461865d1759854db56e4c840991c81c77e45bb9">https://github.com/commontk/DCMTK/commit/f461865d1759854db56e4c840991c81c77e45bb9</a><br>
</div><div><br><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 2, 2013 at 10:18 AM, Csaba Pinter <span dir="ltr"><<a href="mailto:csaba.pinter@queensu.ca" target="_blank">csaba.pinter@queensu.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal">Hi all,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I'm trying to build CTK separately, but I have problems with linking DCMTK.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The way I build CTK:<u></u><u></u></p>
<p><u></u><span>-<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Turn on CTK_BUILD_ALL<u></u><u></u></p>
<p><u></u><span>-<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Turn on CTK_ENABLE_DICOM (I need this as I want to merge and test my changes in the CTK/Core/DICOM project)<u></u><u></u></p>
<p><u></u><span>-<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Set the qmake executable<u></u><u></u></p>
<p><u></u><span>-<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Configure<u></u><u></u></p>
<p><u></u><span>-<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>CMake complains about python paths, I set those manually<u></u><u></u></p>
<p><u></u><span>-<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Configure, Generate<u></u><u></u></p>
<p><u></u><span>-<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Build superbuild<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Then DCMTK is downloaded and built by the superbuild, but later on, CTK projects find a completely different DCMTK directory (in my Slicer nightly build directory). I tried to manually add the DCMTK directory to CMake, but this variable
does not exist in the superbuild (it is also not passed down), and setting it to the inner CTK project doesn't work.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Basically no matter what I do, the DCMTK path is set to whatever find_project finds. This is what I found in CTKConfig.cmake:<u></u><u></u></p>
<p class="MsoNormal"># Update CMake module path so that calling "find_package(DCMTK)" works as expected
<u></u><u></u></p>
<p class="MsoNormal"># after calling "find_package(CTK)"<u></u><u></u></p>
<p class="MsoNormal"># Ideally projects like DCMTK or PythonQt should provide both "Config" and "Use" files.<u></u><u></u></p>
<p class="MsoNormal">set(CMAKE_MODULE_PATH<u></u><u></u></p>
<p class="MsoNormal"> ${CTK_CMAKE_UTILITIES_DIR}<u></u><u></u></p>
<p class="MsoNormal"> ${CMAKE_MODULE_PATH}<u></u><u></u></p>
<p class="MsoNormal"> )<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Now the problem with this is that ${CMAKE_MODULE_PATH} is empty, so there is no chance DCMTK is found correctly.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Can someone please help with this?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks a lot,<u></u><u></u></p>
<p class="MsoNormal">csaba<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">________________________________<u></u><u></u></p>
<p class="MsoNormal">Csaba Pinter<u></u><u></u></p>
<p class="MsoNormal">Medical Software Systems Engineer<u></u><u></u></p>
<p class="MsoNormal">Laboratory for Percutanous Surgery<u></u><u></u></p>
<p class="MsoNormal">School of Computing<u></u><u></u></p>
<p class="MsoNormal">Queen’s University<u></u><u></u></p>
<p class="MsoNormal">Kingston, ON, Canada<u></u><u></u></p>
<p class="MsoNormal">Email: <a href="mailto:csaba.pinter@queensu.ca" target="_blank">csaba.pinter@queensu.ca</a><u></u><u></u></p>
<p class="MsoNormal">Web: <a href="http://perk.cs.queensu.ca" target="_blank">http://perk.cs.queensu.ca</a><u></u><u></u></p>
</div>
</div>
<br>_______________________________________________<br>
Ctk-developers mailing list<br>
<a href="mailto:Ctk-developers@commontk.org">Ctk-developers@commontk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br>
</div>