## ================
PROJECT(cpPlugins)
-SET(cpPlugins_MAJOR_VERSION "0")
-SET(cpPlugins_MINOR_VERSION "0")
-SET(cpPlugins_RELEASE_VERSION "1")
-SET(cpPlugins_VERSION "${cpPlugins_MAJOR_VERSION}.${cpPlugins_MINOR_VERSION}.${cpPlugins_RELEASE_VERSION}")
+SET(prj_MAJOR_VERSION "0")
+SET(prj_MINOR_VERSION "0")
+SET(prj_RELEASE_VERSION "1")
+SET(
+ prj_VERSION
+ "${prj_MAJOR_VERSION}.${prj_MINOR_VERSION}.${prj_RELEASE_VERSION}"
+ )
## ===========
## = Options =
## ===========
+OPTION(USE_QT4 "Build Qt4-based code" OFF)
OPTION(BUILD_EXAMPLES "Build examples" OFF)
-## ============
-## = Packages =
-## ============
+## ========================
+## = Packages and options =
+## ========================
INCLUDE(GenerateExportHeader)
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
-IF(BUILD_EXAMPLES)
- OPTION(USE_QT4 "Build Qt4-based examples" OFF)
- IF(USE_QT4)
+IF(USE_QT4)
+ FIND_LIBRARY(
+ VTK_USES_QT
+ NAMES vtkGUISupportQt-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
+ HINTS ${VTK_LIBRARY_DIRS}
+ PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
+ )
+ FIND_LIBRARY(
+ VTK_USES_QT_OPENGL
+ vtkGUISupportQtOpenGL-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
+ HINTS ${VTK_LIBRARY_DIRS}
+ PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
+ )
+ MARK_AS_ADVANCED(FORCE VTK_USES_QT)
+ MARK_AS_ADVANCED(FORCE VTK_USES_QT_OPENGL)
+ IF(VTK_USES_QT AND VTK_USES_QT_OPENGL)
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})
- ENDIF(USE_QT4)
-ENDIF(BUILD_EXAMPLES)
+ ELSE(VTK_USES_QT AND VTK_USES_QT_OPENGL)
+ MESSAGE(FATAL_ERROR "VTK ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} was not compiled with Qt4 support!")
+ ENDIF(VTK_USES_QT AND VTK_USES_QT_OPENGL)
+ENDIF(USE_QT4)
## ================================================
## = Do not allow to build inside the source tree =