[vtkusers] CMakefile + QVTKWidget

Mike Rob mikerob2015 at gmail.com
Sat Nov 1 23:42:02 EDT 2014


Hi,

I have a simple example which has an instant of QVTKWidget. I can compile
the code successfully using the following cmake file, but when I run the
binary file, I get *** glibc detected *** core dumped....

Here is my CMakeFile. Is there anything wrong in cmake?

cmake_minimum_required(VERSION 2.8)

PROJECT(HelloWorld)

find_package(Qt5Widgets)

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
if (ITKVtkGlue_LOADED)
       find_package(VTK REQUIRED)
       include(${VTK_USE_FILE})
else()
       find_package(ItkVtkGlue REQUIRED)
       include(${ItkVtkGlue_USE_FILE})
       set(Glue ItkVtkGlue)
endif()

QT5_WRAP_UI(UISrcs mainwindow.ui)
QT5_WRAP_CPP(MOCSrcs mainwindow.h)

ADD_EXECUTABLE(MyProject HelloWorld.cpp mainwindow.cpp ${MOCSrcs} ${UISrcs})

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

qt5_use_modules(MyProject Widgets)

target_link_libraries(MyProject  ${Glue}  ${VTK_LIBRARIES} ${ITK_LIBRARIES})


Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141101/d30df258/attachment.html>


More information about the vtkusers mailing list