[ITK-users] Brand new project with itk sentence with QtCreator, Qt5 and Cmake crashes

Marcos fotosentido at gmail.com
Fri Aug 14 12:20:06 EDT 2015


As I said, I did that, I set the ITK_DIR to the directory where I installed.

In fact, there is a ITKConfig.cmake in
C:\ITK-4.8.0-installed\lib\cmake\ITK-4.8

and my CMakeLists.txt has a line like this:
SET(ITK_DIR "C:\\ITK-4.8.0-installed\\")

but that way it doesn't find it.


I didn't have problems building ITK, the problem is trying to use it.

Maybe it's not installed correctly, but Visual Studio did it without
problems.

Thank you.



2015-08-14 18:04 GMT+02:00 Matt McCormick <matt.mccormick at kitware.com>:

> Hi Marcos,
>
> On Fri, Aug 14, 2015 at 11:57 AM, Marcos <fotosentido at gmail.com> wrote:
> > Hi,
> >
> > I'm just trying to make a Cmake project compile and debug.
>
> >
> > I have them installed in:
> >
> > C:\VTK-6.2.0-installed
> > C:\ITK-4.8.0-installed
> > (Each one has the subdirectories \bin, \include, \lib and \share)
> >
> > So, I created a QT5 Widgets project from QtCreator, then I added a
> > CMakeLists.txt containing:
> >
> >> CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
> >>
> >>
> >> PROJECT (UtilityDICOM)
> >>
> >>
> >> SET(CMAKE_INCLUDE_CURRENT_DIR ON)
> >>
> >> SET(CMAKE_AUTOMOC ON)
> >>
> >>
> >> FIND_PACKAGE(Qt5Widgets REQUIRED)
> >>
> >>
> >> # VTK
> >>
> >> #SET(VTK_DIR "C:\\VTK-6.2.0-build\\")
> >>
> >>
> >> # ITK
> >>
> >> #SET(ITK_DIR "C:\\ITK-4.8.0-build\\")
> >>
> >> FIND_PACKAGE(ITK REQUIRED)
> >>
> >> INCLUDE(${ITK_USE_FILE})
> >>
> >>
> >> IF (ItkVtkGlue_LOADED)
> >>
> >>     FIND_PACKAGE(VTK REQUIRED)
> >>
> >>     INCLUDE(${VTK_USE_FILE})
> >>
> >> ENDIF()
> >>
> >>
> >>
> >> ADD_EXECUTABLE(UtilityDICOM WIN32 main.cpp mainwindow.cpp)
> >>
> >>
> >> TARGET_LINK_LIBRARIES(UtilityDICOM Qt5::Widgets ${Glue} ${VTK_LIBRARIES}
> >> ${ITK_LIBRARIES})
> >
> >
> >
> >
> > It returns the error:
> >
> >> CMake Error at CMakeLists.txt:15 (FIND_PACKAGE):
> >
> > By not providing "FindITK.cmake" in CMAKE_MODULE_PATH this project has
> >
> > asked CMake to find a package configuration file provided by "ITK", but
> >
> > CMake did not find one.
> >
> >
> > Could not find a package configuration file provided by "ITK" with any of
> >
> > the following names:
> >
> >
> > ITKConfig.cmake
> >
> > itk-config.cmake
> >
> >
> > Add the installation prefix of "ITK" to CMAKE_PREFIX_PATH or set
> "ITK_DIR"
> >
> > to a directory containing one of the above files. If "ITK" provides a
> >
> > separate development package or SDK, be sure it has been installed.
>
>
> This means that in your CMake configuration, set ITK_DIR to
> C:\ITK-4.8.0-installed.
>
>
> For more details, see the Configuring and Building ITK section of the
> ITK Software Guide:
>
> http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1.html
>
> "Both the terminal-based and GUI versions of CMake will require you to
> specify the directory where ITK was built in the CMake variable
> ITK_DIR. The ITK binary directory will contain a file named
> ITKConfig.cmake generated during ITK configuration process with CMake.
> From this file, CMake will recover all information required to
> configure your new ITK project."
>
>
> Hope this helps,
> Matt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20150814/38e9c9a4/attachment.html>


More information about the Insight-users mailing list