cmake_minimum_required(VERSION 2.6) # -------------------------------- Project name --------------------------------- PROJECT(Virtomy) # --------------- Find VTK toolkit and incorporate into project ------------------ FIND_PACKAGE(VTK) IF(NOT VTK_DIR) MESSAGE(FATAL_ERROR "Please set VTK_DIR.") ENDIF(NOT VTK_DIR) INCLUDE(${VTK_USE_FILE}) # --------------- Find Insight toolkit and incorporate into the project ---------- # FIND_PACKAGE(ITK) # IF(NOT ITK_FOUND) # MESSAGE(FATAL_ERROR "Please set ITK_DIR.") # ENDIF(ITK_FOUND) # INCLUDE(FATAL_ERROR ${ITK_USE_FILE}) # --------------- Find Qt toolkit and incorporate into the project --------------- FIND_PACKAGE(Qt4) SET(QT_USE_QTXML 1) INCLUDE(${QT_USE_FILE}) INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) # Generate list (PrgResourceFiles) of resource files: FILE(GLOB PrgResourceFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qrc) # Add list of resource files: QT4_ADD_RESOURCES(PrgResources ${PrgResourceFiles} ) # Generate list (PrgSourceFiles) of c++ source files: FILE(GLOB PrgSourceFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) # Generate list (UIFiles) of User Interface Forms: FILE(GLOB UIFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.ui) # Generate UIs: QT4_WRAP_UI(UIs ${UIFiles}) # Generate list (PrgHeaderFiles) of header files: FILE(GLOB PrgHeaderFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h) # Create MOC code from list of files: QT4_WRAP_CPP(MOCSources ${PrgHeaderFiles} ) ADD_DEFINITIONS(-DQT_GUI_LIBS -DQT_CORE_LIB) SET_SOURCE_FILES_PROPERTIES(${PrgSourceFiles} PROPERTIES OBJECT_DEPENDS "${UIs}") # ------------------ Add executable with specified source files ------------------ ADD_EXECUTABLE( Virtomy ${PrgSourceFiles} ${PrgHeaderFiles} ${MOCSources} ${UIs} ${PrgResources} ) # ---------------------- Link exe with the following libraries ------------------- TARGET_LINK_LIBRARIES( Virtomy QVTK ${QT_LIBRARIES} vtkCommon vtkDicomParser vtkexoIIc vtkexpat vtkFiltering vtkfreetype vtkftgl vtkGenericFiltering vtkGraphics vtkHybrid vtkImaging vtkIO vtkjpeg vtkNetCDF vtkpng vtkRendering vtksys vtktiff vtkVolumeRendering vtkWidgets vtkzlib vtkGraphics vtkIO vtkCommon ) # --------------------------------------------------------------------------------