[Insight-users] [OSX] Include ITK in a .pro Qt Creator Project [Partially Solved]

Dženan Zukić dzenanz at gmail.com
Wed Aug 1 06:40:03 EDT 2012


If you are just starting, better go with CMake straight away. And here is
an example CMakeLists.txt:

cmake_minimum_required(VERSION 2.6)

PROJECT(Spine CXX)

find_path( EIGEN_DIR Eigen DOC "A path to Eigen libaray, a linear algebra
solver" )
INCLUDE_DIRECTORIES( ${EIGEN_DIR} )

FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})

FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})

FIND_PACKAGE(Qt4)
SET(QT_USE_QTOPENGL 1)
SET(QT_USE_QTDESIGNER ON)
INCLUDE(${QT_USE_FILE})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})

SET(SAMPLE_SRCS
    Spine.cxx
    mainWindow.cpp
    slicePainter.cpp
    vec3.h
    MainLogic.cpp
    declarations.h
    butterfly.cpp
    qeUtil.cpp
    LHstuff.cpp
    vertebra.h
    vertebra.cpp
    polyfit.cpp
    vtkOBJWriter.cxx
    )
SET(SAMPLE_MOC_HDRS mainWindow.h MainLogic.h slicePainter.h)
SET(SAMPLE_UIS mainWindow.ui slicePainter.ui)
SET(SAMPLE_RCS mainWindow.qrc)

QT4_ADD_RESOURCES( SAMPLE_RC_SRCS ${SAMPLE_RCS} )
QT4_WRAP_UI( SAMPLE_UI_HDRS ${SAMPLE_UIS} )
QT4_WRAP_CPP( SAMPLE_MOC_SRCS ${SAMPLE_MOC_HDRS} )

ADD_EXECUTABLE(Spine ${SAMPLE_SRCS} ${SAMPLE_MOC_HDRS} ${SAMPLE_MOC_SRCS}
${SAMPLE_RC_SRCS} ${SAMPLE_UI_HDRS})

TARGET_LINK_LIBRARIES(Spine ${QT_LIBRARIES})
TARGET_LINK_LIBRARIES(Spine ${ITK_LIBRARIES})
TARGET_LINK_LIBRARIES(Spine ${VTK_LIBRARIES} QVTK)

On Tue, Jul 31, 2012 at 10:21 PM, jelemans <jelemans at macpacs.com> wrote:

> I'm just starting a QT +ITK project. Would you be willing to post your .pro
> file or an example to show how to get started?
>
> Did you solve the problem?
>
> TIA.
>
>
>
> --
> View this message in context:
> http://itk-insight-users.2283740.n2.nabble.com/Including-ITK-in-QT-Creator-Project-ld-error-OSX-tp7409758p7580657.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120801/7937794a/attachment.htm>


More information about the Insight-users mailing list