<div dir="ltr"><div><div><div>Hi Csaba, Andras, <br><br></div>Within the file FindDCMTK.cmake [1] provided by CTK, where would you suggest to add the NO_CMAKE_BUILDS_PATH ?<br><br></div>Let's also note that the FindDCMTK.cmake provided by ITK would have to patched also ... <br>

<br></div><div>If you can reproduce the problem, with a combination of clearing cache + adding some "message()" statement, you should be able to find out or confirm what is the source of the problem.<br></div><div>

<br></div>Jc<br><div><div><div><br>[1] <br><a href="https://github.com/commontk/CTK/blob/master/Utilities/CMake/FindDCMTK.cmake">https://github.com/commontk/CTK/blob/master/Utilities/CMake/FindDCMTK.cmake</a></div></div>
</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 2, 2013 at 1:42 PM, Andras Lasso <span dir="ltr"><<a href="mailto:lasso@queensu.ca" target="_blank">lasso@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"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I have this annoying issue during Slicer builds as well: my nightly slicer builds usually break after a few days because after I configure other projects in
 CMake CTK finds DCMTK of another project instead of its own.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">It may be due to the find_package path finding rule 5: “Search project build trees recently configured in a CMake GUI. This can be skipped if NO_CMAKE_BUILDS_PATH
 is passed. It is intended for the case when a user is building multiple dependent projects one after another.“ (<a href="http://www.cmake.org/cmake/help/v2.8.10/ctest.html" target="_blank">http://www.cmake.org/cmake/help/v2.8.10/ctest.html</a>). Probably CTK should rely on
 rules 1-4 or disable rule 5 – or it may be possible that something else goes wrong and that’s why the rule 5 kicks in.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Andras<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:ctk-developers-bounces@commontk.org" target="_blank">ctk-developers-bounces@commontk.org</a> [mailto:<a href="mailto:ctk-developers-bounces@commontk.org" target="_blank">ctk-developers-bounces@commontk.org</a>]
<b>On Behalf Of </b>Jean-Christophe Fillion-Robin<br>
<b>Sent:</b> Wednesday, October 02, 2013 11:39 AM</span></p><div class="im"><br>
<b>To:</b> Csaba Pinter<br>
<b>Cc:</b> CTK mailing list<br>
<b>Subject:</b> Re: [Ctk-developers] DCMTK_DIR is found incorrectly<u></u><u></u></div><p></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Csaba, <br>
<br>
<u></u><u></u></p>
</div><div><div class="h5">
<div>
<p class="MsoNormal">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")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
</div></div></div><div><div class="h5">
<p class="MsoNormal" style="margin-bottom:12.0pt">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.<u></u><u></u></p>
</div></div></div><div><div class="h5">
<div>
<p class="MsoNormal">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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">$ git clone git@github.com:commontk/CTK<u></u><u></u></p>
</div></div></div>
<p class="MsoNormal">$ mkdir CTK-Debug<u></u><u></u></p>
</div>
<p class="MsoNormal">$ cd CTK-Debug<u></u><u></u></p>
</div><div><div class="h5">
<p class="MsoNormal" style="margin-bottom:12.0pt">$ 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>
<u></u><u></u></p>
</div></div></div><div><div class="h5">
<p class="MsoNormal" style="margin-bottom:12.0pt">$ 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" target="_blank">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<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">$ 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>
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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>
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Hth<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Jc<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br>
[1] <a href="https://github.com/commontk/DCMTK/commit/f461865d1759854db56e4c840991c81c77e45bb9" target="_blank">
https://github.com/commontk/DCMTK/commit/f461865d1759854db56e4c840991c81c77e45bb9</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div><div><div class="h5">
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Oct 2, 2013 at 10:18 AM, Csaba Pinter <<a href="mailto:csaba.pinter@queensu.ca" target="_blank">csaba.pinter@queensu.ca</a>> wrote:<u></u><u></u></p>
<div>
<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>-<span style="font-size:7.0pt">          </span>Turn on CTK_BUILD_ALL<u></u><u></u></p>
<p>-<span style="font-size:7.0pt">          </span>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>-<span style="font-size:7.0pt">          </span>Set the qmake executable<u></u><u></u></p>
<p>-<span style="font-size:7.0pt">          </span>Configure<u></u><u></u></p>
<p>-<span style="font-size:7.0pt">          </span>CMake complains about python paths, I set those manually<u></u><u></u></p>
<p>-<span style="font-size:7.0pt">          </span>Configure, Generate<u></u><u></u></p>
<p>-<span style="font-size:7.0pt">          </span>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>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Ctk-developers mailing list<br>
<a href="mailto:Ctk-developers@commontk.org" target="_blank">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><u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <br>
<a href="tel:%2B1%20919%20869%208849" value="+19198698849" target="_blank">+1 919 869 8849</a><u></u><u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br>
</div>