mirror of https://github.com/CGAL/cgal
65 lines
1.6 KiB
CMake
65 lines
1.6 KiB
CMake
project(image_to_vtk_viewer)
|
|
|
|
cmake_minimum_required(VERSION 2.8.10)
|
|
if(POLICY CMP0043)
|
|
cmake_policy(SET CMP0043 OLD)
|
|
endif()
|
|
|
|
|
|
set(PACKAGE_ROOT ../..)
|
|
|
|
# Add several CGAL packages to the include and link paths,
|
|
# if they lie in ${PACKAGE_ROOT}/.
|
|
foreach(INC_DIR ${PACKAGE_ROOT}/include
|
|
${PACKAGE_ROOT}/../CGAL_ImageIO/include )
|
|
if(EXISTS ${INC_DIR})
|
|
include_directories (BEFORE ${INC_DIR})
|
|
endif()
|
|
endforeach()
|
|
foreach(LIB_DIR ${PACKAGE_ROOT}/../CGAL_ImageIO/src/CGAL_ImageIO)
|
|
if (EXISTS ${LIB_DIR})
|
|
link_directories (${LIB_DIR})
|
|
endif()
|
|
endforeach()
|
|
|
|
|
|
find_package(CGAL REQUIRED ImageIO)
|
|
include( ${CGAL_USE_FILE} )
|
|
find_package(VTK QUIET)
|
|
find_package(Qt4 QUIET)
|
|
|
|
if(QT_FOUND AND VTK_FOUND)
|
|
add_definitions(-DCGAL_USE_VTK)
|
|
include(${VTK_USE_FILE})
|
|
include(${QT_USE_FILE})
|
|
|
|
add_definitions(${QT_DEFINITIONS})
|
|
|
|
if(VTK_USE_QVTK)
|
|
include_directories( ${VTK_QT_INCLUDE_DIR} )
|
|
include_directories( ${QT_INCLUDE_DIR} )
|
|
add_executable( image_to_vtk_viewer image_to_vtk_viewer.cpp )
|
|
add_to_cached_list( CGAL_EXECUTABLE_TARGETS image_to_vtk_viewer )
|
|
|
|
target_link_libraries( image_to_vtk_viewer
|
|
QVTK
|
|
vtkRendering
|
|
vtkGraphics
|
|
vtkIO
|
|
vtkCommon
|
|
${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}
|
|
${VTK_QT_QT_LIBRARY}
|
|
${QT_LIBRARIES}
|
|
)
|
|
else(VTK_USE_QVTK)
|
|
message(STATUS "NOTICE: This demo needs QVTK, and will not be compiled.")
|
|
endif(VTK_USE_QVTK)
|
|
else()
|
|
if(NOT VTK_FOUND)
|
|
message(STATUS "NOTICE: This demo needs VTK, and will not be compiled.")
|
|
endif()
|
|
if(NOT QT_FOUND)
|
|
message(STATUS "NOTICE: This demo needs Qt4, and will not be compiled.")
|
|
endif()
|
|
endif()
|