[Insight-users] Cmake - QT : moc problem

Devalkeneer Arnaud arnauddebelgique at yahoo.com
Thu Jan 5 10:04:52 EST 2006


Hi everybody,

I'm currently updating a three months old segmentation
program and I'm very surprised that the compilation
process fails (althought it was succesfull three
months ago). It seems due to a problem with the
QT_WRAP_CPP command from the CMakeLists.txt file.

Actually I get an error like "No rule to build the
target « ATHENA_MOC_SRCS », which is necessary for «
moc_ATHENA_MOC_SRCS.cxx ». Stop." I am wondering: Is
there any change for the command QT_WRAP_CPP from the
version 2.0.6 to 2.2.3 of cmake? -> I did not have
this error three months ago...

When I change the line QT_WRAP_CPP(segment ATHENA_SRCS
ATHENA_MOC_SRCS) into QT_WRAP_CPP(segment Graphic.cxx
Graphic.h) I do not get the last error anymore but no
file "moc_Graphic.o" are builded, which is leading of
course to an executable linkage error...

I have copied the complete CMakeLists.txt file at the
end of this email.

Can you help me to solve this problem, please?
Thanks a lot for your help.

Happy New Year to you.

------------------------------------------------------

Source CMakeLists.txt file :

PROJECT(ATHENA)

INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
IF (USE_ITK_FILE)
  INCLUDE(${USE_ITK_FILE})
ENDIF (USE_ITK_FILE)

INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
IF (USE_VTK_FILE)
  INCLUDE(${USE_VTK_FILE})
ENDIF (USE_VTK_FILE)

INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
INCLUDE_DIRECTORIES(
        ${QT_INCLUDE_DIR}
        ${QT_INCLUDE_PATH}
)

LINK_LIBRARIES (
        ITKIO
        ${QT_QT_LIBRARY}
)

INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_SOURCE_DIR}/./0_Bases
  ${CMAKE_CURRENT_SOURCE_DIR}/./1_Registration
)

SET(ATHENA_SRCS
  main.cxx
  mainCalcul.cxx
  Graphic.cxx
  ./0_Bases/Timer.cxx
  ./1_Registration/PowellOptimizer.cxx
)

SET(ATHENA_MOC_SRCS
  Graphic.h
)

IF(QT_WRAP_CPP)
  QT_WRAP_CPP(segment ATHENA_SRCS ATHENA_MOC_SRCS)
ENDIF(QT_WRAP_CPP)

ADD_EXECUTABLE(segment ${ATHENA_SRCS})

TARGET_LINK_LIBRARIES(segment
  ITKAlgorithms
  ITKBasicFilters
  ITKCommon
  ITKIO
  ITKMetaIO
  ITKNumerics
  itkvnl
  itkvnl_algo
  itknetlib
  vtkRendering
  vtkIO
)



		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



More information about the Insight-users mailing list