[Ctk-developers] DCMTK_DIR is found incorrectly
Csaba Pinter
csaba.pinter at queensu.ca
Wed Oct 2 17:17:42 UTC 2013
Hi Jc,
Thanks for the quick answer.
Unfortunately the fact that this works on Linux doesn't help me in my Windows environment.
Right now I have a working copy that refuses to build because it finds an external DCMTK (from a Slicer release mode superbuild tree) every time. I could try injecting a DCMTK_DIR, but I guess it would rather be a workaround than a solution.
Probably if CMAKE_MODULE_PATH contained the DCMTK directory that the superbuild downloads and builds, besides CTK_CMAKE_UTILITIES_DIR, then the right DCMTK directory would be found.
If it's not clear, I would really appreciate if you could remote log. Probably you could find the source of the problem in no time.
Thanks,
csaba
From: Jean-Christophe Fillion-Robin [mailto:jchris.fillionr at kitware.com]
Sent: October 2, 2013 11:39
To: Csaba Pinter
Cc: CTK mailing list
Subject: Re: [Ctk-developers] DCMTK_DIR is found incorrectly
Hi Csaba,
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:
$ cat ../CTKConfig.cmake | ack -i "set\(CTK_CMAKE_UTILITIES_DIR"
SET(CTK_CMAKE_UTILITIES_DIR "/home/jchris/Projects/CTK/Utilities/CMake")
Otherwise, you will find below the result of my experiment. When configured, CTK found the expected DCMTK.
On Ubuntu 13.04 using CMake 2.8.11.2, after installing the package "python2.7-dev" doing so the following works.
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:
-DCTK_ENABLE_Python_Wrapping:BOOL=ON
-DCTK_ENABLE_DICOM:BOOL=ON
-DCTK_BUILD_EXAMPLES
$ git clone git at github.com:commontk/CTK<mailto:git at github.com:commontk/CTK>
$ mkdir CTK-Debug
$ cd CTK-Debug
$ 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
[...]
-- Enabling [CTK_LIB_DICOM/Core] because of [ CTK_ENABLE_DICOM:1 OR ( CTK_ENABLE_DICOMApplicationHosting:0 AND CTK_BUILD_EXAMPLES:1 )] evaluates to True
-- Enabling [CTK_APP_ctkDICOM] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkDICOM2] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkDICOMIndexer] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkDICOMDemoSCU] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkDICOMQuery] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkDICOMRetrieve] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkDICOMQueryRetrieve] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkCommandLineModuleExplorer] because of [ CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkDICOMObjectViewer] because of [ CTK_ENABLE_DICOM:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Enabling [CTK_APP_ctkSimplePythonShell] because of [ CTK_ENABLE_Python_Wrapping:1 AND CTK_BUILD_EXAMPLES:1] evaluates to True
-- Generated: /home/jchris/Projects/CTK-Debug/DGraphInput-alldep.txt
-- Generated: /home/jchris/Projects/CTK-Debug/DGraphInput-alldep-withext.txt
-- Enabling option [CTK_LIB_DICOM/Widgets] required by [ctkDICOM]
-- Enabling option [CTK_LIB_Widgets] required by [ctkDICOM]
-- Enabling option [CTK_LIB_CommandLineModules/Frontend/QtGui] required by [ctkCommandLineModuleExplorer]
-- Enabling option [CTK_LIB_CommandLineModules/Frontend/QtWebKit] required by [ctkCommandLineModuleExplorer]
-- Enabling option [CTK_LIB_CommandLineModules/Backend/LocalProcess] required by [ctkCommandLineModuleExplorer]
-- Enabling option [CTK_LIB_CommandLineModules/Backend/FunctionPointer] required by [ctkCommandLineModuleExplorer]
-- Enabling option [CTK_LIB_CommandLineModules/Core] required by [ctkCommandLineModuleExplorer]
-- Enabling option [CTK_LIB_Scripting/Python/Widgets] required by [ctkSimplePythonShell]
-- Enabling option [CTK_LIB_Scripting/Python/Core] required by [ctkSimplePythonShell]
-- Found PythonInterp: /usr/bin/python (found version "2.7.4")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so<http://libpython2.7.so> (found version "2.7.4")
-- Generated: /home/jchris/Projects/CTK-Debug/DGraphInput.txt
-- Generated: /home/jchris/Projects/CTK-Debug/Project.xml
-- Found Git: /usr/bin/git (found version "1.8.1.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jchris/Projects/CTK-Debug
$ make -j6
[...]
[ 90%] Performing configure step for 'CTK-Configure'
[...]
-- Found PythonInterp: /usr/bin/python (found version "2.7.4")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so<http://libpython2.7.so> (found version "2.7.4")
-- Generated: /home/jchris/Projects/CTK-Debug/CTK-build/DGraphInput.txt
-- Generated: /home/jchris/Projects/CTK-Debug/CTK-build/Project.xml
-- Trying to find DCMTK expecting DCMTKConfig.cmake
-- Trying to find DCMTK expecting DCMTKConfig.cmake - failed
-- Trying to find DCMTK relying on FindDCMTK.cmake
-- Looking for include file pthread.h
-- Looking fothe r include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found DCMTK: /home/jchris/Projects/CTK-Debug/CMakeExternals/Install/include/dcmtk/config
-- Trying to find DCMTK relying on FindDCMTK.cmake - ok
-- CTKCore: BFD support disabled
-- Configuring done
-- Generating done
[...]
-- Build files have been written to: /home/jchris/Projects/CTK-Debug/CTK-build
[...]
[100%] Built target CTKWidgetsCppTests
[100%] Built target CTK-build
$ cd CTK-build
$ $ cat CMakeCache.txt | ack DCMTK_DIR\:PATH
DCMTK_DIR:PATH=/home/jchris/Projects/CTK-Debug/CMakeExternals/Install
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]
Hth
Jc
[1] https://github.com/commontk/DCMTK/commit/f461865d1759854db56e4c840991c81c77e45bb9
On Wed, Oct 2, 2013 at 10:18 AM, Csaba Pinter <csaba.pinter at queensu.ca<mailto:csaba.pinter at queensu.ca>> wrote:
Hi all,
I'm trying to build CTK separately, but I have problems with linking DCMTK.
The way I build CTK:
- Turn on CTK_BUILD_ALL
- Turn on CTK_ENABLE_DICOM (I need this as I want to merge and test my changes in the CTK/Core/DICOM project)
- Set the qmake executable
- Configure
- CMake complains about python paths, I set those manually
- Configure, Generate
- Build superbuild
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.
Basically no matter what I do, the DCMTK path is set to whatever find_project finds. This is what I found in CTKConfig.cmake:
# Update CMake module path so that calling "find_package(DCMTK)" works as expected
# after calling "find_package(CTK)"
# Ideally projects like DCMTK or PythonQt should provide both "Config" and "Use" files.
set(CMAKE_MODULE_PATH
${CTK_CMAKE_UTILITIES_DIR}
${CMAKE_MODULE_PATH}
)
Now the problem with this is that ${CMAKE_MODULE_PATH} is empty, so there is no chance DCMTK is found correctly.
Can someone please help with this?
Thanks a lot,
csaba
________________________________
Csaba Pinter
Medical Software Systems Engineer
Laboratory for Percutanous Surgery
School of Computing
Queen's University
Kingston, ON, Canada
Email: csaba.pinter at queensu.ca<mailto:csaba.pinter at queensu.ca>
Web: http://perk.cs.queensu.ca
_______________________________________________
Ctk-developers mailing list
Ctk-developers at commontk.org<mailto:Ctk-developers at commontk.org>
http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
--
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20131002/068a536e/attachment.htm>
More information about the Ctk-developers
mailing list