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

Ale notinmyhead at gmail.com
Thu Aug 2 04:45:08 EDT 2012


Hi all,

sorry for late: I didn't see the answers since it's a long time I've written.

I don't like CMake because you lost all Creator features if you use it. Once you have your .pro project you should include things like that (take care about absolute paths!) at the bottom of your project:


win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/release/ -lITKCommon-4
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../usr/local/lib/debug/ -lITKCommon-4
else:symbian: LIBS += -lITKCommon-4
else:unix: LIBS += -L/usr/local/lib/ \
-lITKBiasCorrection-4.1 \
-lITKBioCell-4.1 \
-lITKCommon-4.1 \
-lITKDeprecated-4.1 \
-lITKDICOMParser-4.1 \
-lITKEXPAT-4.1 \
-lITKFEM-4.1 \
                                     -lITKgiftiio-4.1 \
                                        -litkhdf5-4.1 \
                                        -litkhdf5_cpp-4.1 \
                                        -lITKIOBioRad-4.1 \
                                        -lITKIOBMP-4.1 \
                                        -lITKIOCSV-4.1 \
                    -lITKIOGDCM-4.1 \
                    -lITKGDCM-4.1\
                                        -lITKIOGE-4.1 \
                                        -lITKIOGIPL-4.1 \
                                        -lITKIOHDF5-4.1 \
                    -lITKIOImageBase-4.1 \
                    -lITKIOIPL-4.1 \
                    -lITKIOJPEG-4.1 \
-lITKIOLSM-4.1 \
                    -lITKIOMesh-4.1 \
                    -lITKIOMeta-4.1 \
                    -lITKIONIFTI-4.1 \
                                        -lITKIONRRD-4.1 \
                                        -lITKIOPNG-4.1 \
                                        -lITKIOSiemens-4.1 \
                    -lITKIOSpatialObjects-4.1 \
-lITKIOStimulate-4.1 \
                    -lITKIOTIFF-4.1 \
                    -lITKIOTransformBase-4.1 \
                                        -lITKIOTransformHDF5-4.1 \
                                        -lITKIOTransformInsightLegacy-4.1 \
                                        -lITKIOTransformMatlab-4.1 \
                                        -lITKIOVTK-4.1 \
                    -lITKIOXML-4.1 \
                    -litkjpeg-4.1 \
                                        -lITKKLMRegionGrowing-4.1 \
                                        -lITKLabelMap-4.1 \
                                        -lITKMesh-4.1 \
                    -lITKMetaIO-4.1 \
                    -litkNetlibSlatec-4.1 \
                                        -lITKniftiio-4.1 \
                                        -lITKNrrdIO-4.1 \
                    -lITKOptimizers-4.1 \
                    -lITKOptimizersv4-4.1 \
                    -lITKPath-4.1 \
                    -litkpng-4.1 \
                    -lITKStatistics-4.1 \
                                        -lITKPolynomials-4.1 \
                                        -lITKQuadEdgeMesh-4.1 \
                                        -lITKReview-4.1 \
                                        -lITKSpatialObjects-4.1 \
                                        -lITKStatistics-4.1 \
                                        -litksys-4.1 \
                                        -litktiff-4.1 \
                                        -litkv3p_lsqr-4.1 \
                                        -litkv3p_netlib-4.1 \
                                        -litkvcl-4.1 \
                                        -lITKVideoCore-4.1 \
                                        -lITKVideoIO-4.1 \
                                        -litkvnl-4.1 \
                                        -lITKVNLInstantiation-4.1 \
                                        -litkvnl_algo-4.1 \
                                        -lITKVTK-4.1 \
                                        -lITKWatersheds-4.1 \
                                        -litkzlib-4.1 \
                                        -lITKznz-4.1

#set MAC CoreFoundation includes
mac: LIBS += -framework CoreFoundation

INCLUDEPATH += /usr/local/include/ITK-4.1
DEPENDPATH += /usr/local/include/ITK-4.1

Il giorno 01/ago/2012, alle ore 12.40, Dženan Zukić ha scritto:

> 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
> 
> _____________________________________
> 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



More information about the Insight-users mailing list