From 0c22ea8a82db915fa32f09c6b68c7bc3d1a3b92b Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Wed, 28 Jan 2015 14:04:42 -0500 Subject: [PATCH] Some project updates --- CMakeLists.txt | 43 ++++++++++++++++++++-------- appli/ImageMPR/CMakeLists.txt | 1 - lib/cpPlugins/Plugins/CMakeLists.txt | 1 - lib/third_party/Pluma/CMakeLists.txt | 2 +- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9918041..fc04422 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,20 +21,24 @@ ENDIF( ## ================ 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) @@ -44,13 +48,28 @@ INCLUDE(${ITK_USE_FILE}) 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 = diff --git a/appli/ImageMPR/CMakeLists.txt b/appli/ImageMPR/CMakeLists.txt index 5660c19..56b4f38 100644 --- a/appli/ImageMPR/CMakeLists.txt +++ b/appli/ImageMPR/CMakeLists.txt @@ -60,7 +60,6 @@ IF(USE_QT4) cpPlugins_Interface ${QT_LIBRARIES} vtkGUISupportQt - ) ENDIF(USE_QT4) diff --git a/lib/cpPlugins/Plugins/CMakeLists.txt b/lib/cpPlugins/Plugins/CMakeLists.txt index 372b150..d32fafb 100644 --- a/lib/cpPlugins/Plugins/CMakeLists.txt +++ b/lib/cpPlugins/Plugins/CMakeLists.txt @@ -32,7 +32,6 @@ GENERATE_EXPORT_HEADER( TARGET_LINK_LIBRARIES( ${LIBRARY_NAME} cpPlugins_Interface - ${ITK_LIBRARIES} ) ## eof - $RCSfile$ diff --git a/lib/third_party/Pluma/CMakeLists.txt b/lib/third_party/Pluma/CMakeLists.txt index 9a86949..da0147b 100644 --- a/lib/third_party/Pluma/CMakeLists.txt +++ b/lib/third_party/Pluma/CMakeLists.txt @@ -26,7 +26,7 @@ GENERATE_EXPORT_HEADER( ${LIBRARY_NAME} BASE_NAME ${LIBRARY_NAME} EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT - EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/third_party/Pluma/${LIBRARY_NAME}_Export.h + EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/third_party/Pluma/${LIBRARY_NAME}_Export.h STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC ) IF(NOT WIN32) -- 2.47.1