Commit 365fc1cf authored by Brad King's avatar Brad King 💬
Browse files

ENH: Exporting the Qt that VTK found as VTK_QT_QT_LIBRARY and...

ENH: Exporting the Qt that VTK found as VTK_QT_QT_LIBRARY and VTK_QT_QT_INCLUDE_DIR.  This allows outside projects to use the Qt against which QVTK is linked.  Other settings like the MOC executable may need to be exported also but that is not up to me.
parent cff534da
......@@ -14,8 +14,9 @@ SET (SRCS
SET (MOC_HDRS
)
# Use the include path and library for Qt that is used by VTK.
INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIR}
${VTK_QT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
......@@ -45,7 +46,7 @@ ADD_EXECUTABLE( qtevents ${SRCS} ${UI_SRCS})
TARGET_LINK_LIBRARIES( qtevents
QVTK
${QT_QT_LIBRARY}
${VTK_QT_QT_LIBRARY}
vtkRendering
vtkGraphics
vtkIO
......
......@@ -6,13 +6,12 @@ IF(NOT VTK_DIR)
ENDIF(NOT VTK_DIR)
INCLUDE(${VTK_USE_FILE})
INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
SET (SRCS
main.cxx
)
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
# Use the include path and library for Qt that is used by VTK.
INCLUDE_DIRECTORIES( ${VTK_QT_INCLUDE_DIR} )
ADD_EXECUTABLE( qtimageviewer ${SRCS})
......@@ -22,7 +21,7 @@ ADD_EXECUTABLE( qtimageviewer ${SRCS})
TARGET_LINK_LIBRARIES( qtimageviewer
QVTK
${QT_QT_LIBRARY}
${VTK_QT_QT_LIBRARY}
vtkRendering
vtkGraphics
vtkIO
......
......@@ -6,8 +6,6 @@ IF(NOT VTK_DIR)
ENDIF(NOT VTK_DIR)
INCLUDE(${VTK_USE_FILE})
INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
SET (SimpleViewSrcs
main.cxx
SimpleView.cxx
......@@ -16,8 +14,9 @@ SET (SimpleViewHeaders
SimpleView.h
)
# Use the include path and library for Qt that is used by VTK.
INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIR}
${VTK_QT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
......@@ -42,7 +41,7 @@ ADD_EXECUTABLE( qtsimpleview ${SimpleViewSrcs} ${UISrcs} ${MOCSrcs})
TARGET_LINK_LIBRARIES( qtsimpleview
QVTK
${QT_QT_LIBRARY}
${VTK_QT_QT_LIBRARY}
vtkRendering
vtkGraphics
vtkIO
......
......@@ -69,6 +69,11 @@ TARGET_LINK_LIBRARIES( QVTKWidgetPlugin
vtkCommon
)
# Configure the VTKConfigQt.cmake support file.
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/VTKConfigQt.cmake.in
${VTK_BINARY_DIR}/VTKConfigQt.cmake @ONLY IMMEDIATE)
# install rules
# install at /plugins/designer allows one to set their designer plugin path
......@@ -88,8 +93,8 @@ ENDIF ( UNIX )
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL_FILES( ${VTK_INSTALL_INCLUDE_DIR} .h ${QVTKLibSrcs})
INSTALL_FILES( ${VTK_INSTALL_LIB_DIR} FILES ${VTK_BINARY_DIR}/VTKConfigQt.cmake )
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
IF(NOT VTK_INSTALL_NO_LIBRARIES)
INSTALL_TARGETS( ${VTK_INSTALL_LIB_DIR} QVTK )
ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
#-----------------------------------------------------------------------------
#
# VTKConfigQt.cmake - VTK Qt CMake configuration file for external projects.
#
# This file is configured by VTK and used by the VTKConfig.cmake module
# to load VTK's Qt settings for an external project.
SET(VTK_QT_QT_LIBRARY "@QT_QT_LIBRARY@")
SET(VTK_QT_INCLUDE_DIR "@QT_INCLUDE_DIR@")
......@@ -115,6 +115,11 @@ SET(VTK_JPEG_LIBRARIES "@VTK_JPEG_LIBRARIES@")
SET(VTK_TIFF_LIBRARIES "@VTK_TIFF_LIBRARIES@")
SET(VTK_EXPAT_LIBRARIES "@VTK_EXPAT_LIBRARIES@")
# The VTK Qt configuration.
IF(VTK_USE_QVTK)
INCLUDE(${VTK_DIR}/VTKConfigQt.cmake)
ENDIF(VTK_USE_QVTK)
# The VTK library dependencies.
IF(NOT VTK_NO_LIBRARY_DEPENDS)
INCLUDE("@VTK_LIBRARY_DEPENDS_FILE@")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment