[Insight-users] Error in program Qt + itk package

Luis Ibanez luis.ibanez at kitware.com
Thu Feb 28 09:08:08 EST 2008


Hi Walter,

In your CMakeLists.txt file:

# Find Qt.
 > FIND_PACKAGE(QT)
 > IF(QT_FOUND)
 >   INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
 > ELSE (QT_FOUND)
 >   MESSAGE(FATAL_ERROR "QT not found. Please set QT_DIR.")
 > ENDIF(QT_FOUND)


You are missing to do:

      INCLUDE( ${QT_USE_FILE} )


The section should become:

# Find Qt.
FIND_PACKAGE(QT)
IF(QT_FOUND)
    INCLUDE( ${QT_USE_FILE} )
    INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
ELSE (QT_FOUND)
    MESSAGE(FATAL_ERROR "QT not found. Please set QT_DIR.")
ENDIF(QT_FOUND)



    Regards


        Luis


----------------------
Walter Cabrera wrote:
> 
> 
> Walter Cabrera wrote:
> 
>>I am doing a test with the following source (Qt + itk):
>>
>>#include <qapplication.h>
>>
>>int main(int argc, char *argv[])
>>{
>>  QApplication app( argc, argv );
>>  return app.exec();
>>}
>>
>>give  error becouse not found qapplication.h
>>
>>CMakeLists.txt used
>>
>>PROJECT(QtITK)
>>
>># Find ITK.
>>FIND_PACKAGE(ITK REQUIRED)
>>IF(ITK_FOUND)
>>  INCLUDE(${ITK_USE_FILE})
>>ELSE (ITK_FOUND)
>>  MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.")
>>ENDIF(ITK_FOUND)
>>
>># Find Qt.
>>FIND_PACKAGE(QT)
>>IF(QT_FOUND)
>>  INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
>>ELSE (QT_FOUND)
>>  MESSAGE(FATAL_ERROR "QT not found. Please set QT_DIR.")
>>ENDIF(QT_FOUND)
>>
>>ADD_EXECUTABLE(QtITK QtITK.cxx)
>>
>>Someone can help me?
>>
>>Thanks
>>
>>
>>
> 
> 


More information about the Insight-users mailing list