<div dir="ltr"><div><div><div><div><div><div>As I said, I did that, I set the ITK_DIR to the directory where I installed.<br><br></div>In fact, there is a ITKConfig.cmake in<br>C:\ITK-4.8.0-installed\lib\cmake\ITK-4.8<br><br></div>and my CMakeLists.txt has a line like this:<br><span style="color:#808000">SET</span>(ITK_DIR<span style="color:#c0c0c0"> </span><span style="color:#008000">"C:\\ITK-4.8.0-installed\\"</span>)<br><br></div>but that way it doesn't find it.<br><br><br>I didn't have problems building ITK, the problem is trying to use it.<br></div><br></div>Maybe it's not installed correctly, but Visual Studio did it without problems.<br><br></div>Thank you.<br><div><div><div><div><div><br><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-14 18:04 GMT+02:00 Matt McCormick <span dir="ltr"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Marcos,<br>
<span class=""><br>
On Fri, Aug 14, 2015 at 11:57 AM, Marcos <<a href="mailto:fotosentido@gmail.com">fotosentido@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I'm just trying to make a Cmake project compile and debug.<br>
<br>
><br>
</span><div><div class="h5">> I have them installed in:<br>
><br>
> C:\VTK-6.2.0-installed<br>
> C:\ITK-4.8.0-installed<br>
> (Each one has the subdirectories \bin, \include, \lib and \share)<br>
><br>
> So, I created a QT5 Widgets project from QtCreator, then I added a<br>
> CMakeLists.txt containing:<br>
><br>
>> CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)<br>
>><br>
>><br>
>> PROJECT (UtilityDICOM)<br>
>><br>
>><br>
>> SET(CMAKE_INCLUDE_CURRENT_DIR ON)<br>
>><br>
>> SET(CMAKE_AUTOMOC ON)<br>
>><br>
>><br>
>> FIND_PACKAGE(Qt5Widgets REQUIRED)<br>
>><br>
>><br>
>> # VTK<br>
>><br>
>> #SET(VTK_DIR "C:\\VTK-6.2.0-build\\")<br>
>><br>
>><br>
>> # ITK<br>
>><br>
>> #SET(ITK_DIR "C:\\ITK-4.8.0-build\\")<br>
>><br>
>> FIND_PACKAGE(ITK REQUIRED)<br>
>><br>
>> INCLUDE(${ITK_USE_FILE})<br>
>><br>
>><br>
>> IF (ItkVtkGlue_LOADED)<br>
>><br>
>> FIND_PACKAGE(VTK REQUIRED)<br>
>><br>
>> INCLUDE(${VTK_USE_FILE})<br>
>><br>
>> ENDIF()<br>
>><br>
>><br>
>><br>
>> ADD_EXECUTABLE(UtilityDICOM WIN32 main.cpp mainwindow.cpp)<br>
>><br>
>><br>
>> TARGET_LINK_LIBRARIES(UtilityDICOM Qt5::Widgets ${Glue} ${VTK_LIBRARIES}<br>
>> ${ITK_LIBRARIES})<br>
><br>
><br>
><br>
><br>
> It returns the error:<br>
><br>
>> CMake Error at CMakeLists.txt:15 (FIND_PACKAGE):<br>
><br>
> By not providing "FindITK.cmake" in CMAKE_MODULE_PATH this project has<br>
><br>
> asked CMake to find a package configuration file provided by "ITK", but<br>
><br>
> CMake did not find one.<br>
><br>
><br>
> Could not find a package configuration file provided by "ITK" with any of<br>
><br>
> the following names:<br>
><br>
><br>
> ITKConfig.cmake<br>
><br>
> itk-config.cmake<br>
><br>
><br>
> Add the installation prefix of "ITK" to CMAKE_PREFIX_PATH or set "ITK_DIR"<br>
><br>
> to a directory containing one of the above files. If "ITK" provides a<br>
><br>
> separate development package or SDK, be sure it has been installed.<br>
<br>
<br>
</div></div>This means that in your CMake configuration, set ITK_DIR to<br>
C:\ITK-4.8.0-installed.<br>
<br>
<br>
For more details, see the Configuring and Building ITK section of the<br>
ITK Software Guide:<br>
<br>
<a href="http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1.html" rel="noreferrer" target="_blank">http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1.html</a><br>
<br>
"Both the terminal-based and GUI versions of CMake will require you to<br>
specify the directory where ITK was built in the CMake variable<br>
ITK_DIR. The ITK binary directory will contain a file named<br>
ITKConfig.cmake generated during ITK configuration process with CMake.<br>
>From this file, CMake will recover all information required to<br>
configure your new ITK project."<br>
<br>
<br>
Hope this helps,<br>
Matt<br>
</blockquote></div><br></div>