]> Creatis software - cpPlugins.git/commitdiff
Now ported to macosx and easier to configure on win32... hopefully
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 11 Sep 2015 09:38:10 +0000 (11:38 +0200)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 11 Sep 2015 09:38:10 +0000 (11:38 +0200)
CMakeLists.txt
cmake/cpPluginsConfig.cmake.in
lib/cpPlugins/Extensions/CMakeLists.txt
lib/cpPlugins/Interface/CMakeLists.txt
lib/cpPlugins/Plugins/CMakeLists.txt
lib/third_party/CMakeLists.txt
lib/third_party/Pluma/CMakeLists.txt
lib/third_party/glext/GL/glext.h

index c64dad95d30951c6b8b91a26644829d4a2fe0575..93dd1ef88a9b4d8c4f99a417e33e5ae7f2e6dfb4 100644 (file)
@@ -1,8 +1,19 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 
-IF(POLICY CMP0020)
-  CMAKE_POLICY(SET CMP0020 NEW)
-ENDIF(POLICY CMP0020)
+## ============
+## = Policies =
+## ============
+
+SET(
+  policies
+  CMP0020
+  CMP0042
+  )
+FOREACH(policy ${policies})
+  IF(POLICY ${policy})
+    CMAKE_POLICY(SET ${policy} NEW)
+  ENDIF(POLICY ${policy})
+ENDFOREACH(policy)
 
 ## ================
 ## = Project name =
@@ -28,36 +39,42 @@ OPTION(BUILD_EXAMPLES "Build examples" OFF)
 ## = Packages and options =
 ## ========================
 
+# Prepare header to build shared libs (windows)
 INCLUDE(GenerateExportHeader)
 
+# Find ITK and VTK
 FIND_PACKAGE(ITK REQUIRED)
-INCLUDE(${ITK_USE_FILE})
-
 FIND_PACKAGE(VTK REQUIRED)
+
+INCLUDE(${ITK_USE_FILE})
 INCLUDE(${VTK_USE_FILE})
 
+# Do not use itk-vtk glue --> problems ahead!!!
 IF(ITKVtkGlue_LOADED)
   MESSAGE(FATAL_ERROR "ITKVtkGlue module is available. Please re-compile your ITK without it. It could lead to nasty compilation problems... Just waiting for Kitware to solve it.")
 ENDIF(ITKVtkGlue_LOADED)
 
-
+SET(QT4_FOUND "0")
 IF(USE_QT4)
   FIND_PACKAGE(Qt4 REQUIRED)
   INCLUDE(${QT_USE_FILE})
 
-  ## Check for required modules
-  IF(NOT vtkGUISupportQt_LOADED)
-    MESSAGE(
-      FATAL_ERROR
-      "vtkGUISupportQt module is required but not available."
-      )
-  ENDIF(NOT vtkGUISupportQt_LOADED)
-  IF(NOT vtkGUISupportQtOpenGL_LOADED)
-    MESSAGE(
-      FATAL_ERROR
-      "vtkGUISupportQtOpenGL module is required but not available."
-      )
-  ENDIF(NOT vtkGUISupportQtOpenGL_LOADED)
+  ## Check for required vtk-qt4 modules
+  SET(
+    vtk_required_modules
+    vtkGUISupportQt
+    vtkGUISupportQtOpenGL
+    )
+  FOREACH(vtk_module ${vtk_required_modules})
+    IF(NOT ${vtk_module}_LOADED)
+      MESSAGE(
+        FATAL_ERROR
+        "${vtk_module} module is required but not available."
+        )
+      SET(QT4_FOUND "0")
+    ENDIF(NOT ${vtk_module}_LOADED)
+  ENDFOREACH(vtk_module)
+  SET(QT4_FOUND "1")
 ENDIF(USE_QT4)
 
 ## ================================================
@@ -92,11 +109,11 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_BINARY_DIR}/lib/third_party
   ${PROJECT_BINARY_DIR}/lib/third_party/ItkVtkGlue
   )
-IF(WIN32)
+IF(WIN32 OR APPLE)
   INCLUDE_DIRECTORIES(
     ${PROJECT_SOURCE_DIR}/lib/third_party/glext
     )
-ENDIF(WIN32)
+ENDIF(WIN32 OR APPLE)
 
 ## ===========================
 ## = Subdirs containing code =
index 7367ed0a9a75f8b6b8008d4ea91f7cc8097b3ece..f6ec0f7f814d03429855bc3a54e7a844696696eb 100644 (file)
-FIND_PATH(
-  cpPlugins_INCLUDE_DIR1
-  cpPlugins/Interface/Interface.h
-  PATHS
-  /usr/include
-  /usr/local/include
-  @PROJECT_SOURCE_DIR@/lib
-  @PROJECT_BINARY_DIR@/lib
-  @CMAKE_INSTALL_PREFIX@/include
-  )
+# ===================================
+# -- Some configurations variables --
+# ===================================
 
-FIND_PATH(
-  cpPlugins_INCLUDE_DIR2
-  cpPlugins/Interface/cpPlugins_Interface_Export.h
-  PATHS
-  /usr/include
-  /usr/local/include
-  @PROJECT_SOURCE_DIR@/lib
-  @PROJECT_BINARY_DIR@/lib
-  @CMAKE_INSTALL_PREFIX@/include
-  )
+SET(cpPlugins_with_QT4 "@QT4_FOUND@")
 
-FIND_PATH(
-  cpPlugins_INCLUDE_DIR3
-  Pluma/Pluma.hpp
-  PATHS
-  /usr/include
-  /usr/local/include
-  @PROJECT_SOURCE_DIR@/lib/third_party
-  @PROJECT_BINARY_DIR@/lib/third_party
-  @CMAKE_INSTALL_PREFIX@/include
-  )
+# =========================
+# -- Include directories --
+# =========================
 
-FIND_PATH(
-  cpPlugins_INCLUDE_DIR4
-  Pluma/cpPlugins_Pluma_Export.h
-  PATHS
-  /usr/include
-  /usr/local/include
+INCLUDE_DIRECTORIES(
+  @PROJECT_SOURCE_DIR@/lib
   @PROJECT_SOURCE_DIR@/lib/third_party
-  @PROJECT_BINARY_DIR@/lib/third_party
-  @CMAKE_INSTALL_PREFIX@/include
-  )
-
-FIND_PATH(
-  cpPlugins_INCLUDE_DIR5
-  itkImageToVTKImageFilter.h
-  PATHS
-  /usr/include
-  /usr/local/include
   @PROJECT_SOURCE_DIR@/lib/third_party/ItkVtkGlue
+  @PROJECT_BINARY_DIR@/lib
+  @PROJECT_BINARY_DIR@/lib/third_party
   @PROJECT_BINARY_DIR@/lib/third_party/ItkVtkGlue
   @CMAKE_INSTALL_PREFIX@/include
+  @CMAKE_INSTALL_PREFIX@/include/third_party
+  @CMAKE_INSTALL_PREFIX@/include/third_party/ItkVtkGlue
   )
 
-INCLUDE_DIRECTORIES(
-  ${cpPlugins_INCLUDE_DIR1}
-  ${cpPlugins_INCLUDE_DIR2}
-  ${cpPlugins_INCLUDE_DIR3}
-  ${cpPlugins_INCLUDE_DIR4}
-  ${cpPlugins_INCLUDE_DIR5}
-  )
-
-FIND_LIBRARY(
-  cpPlugins_Interface_LIBRARY_NAME
-  cpPlugins_Interface
-  PATHS
-  /usr/lib
-  /usr/local/lib
-  @PROJECT_BINARY_DIR@
-  @CMAKE_INSTALL_PREFIX@/lib
-  )
+# =========================
+# -- Library directories --
+# =========================
 
-FIND_LIBRARY(
-  cpPlugins_Extensions_LIBRARY_NAME
-  cpPlugins_Extensions
-  PATHS
-  /usr/lib
-  /usr/local/lib
-  @PROJECT_BINARY_DIR@
+LINK_DIRECTORIES(
+  @PROJECT_SOURCE_DIR@/lib
+  @PROJECT_BINARY_DIR@/lib
   @CMAKE_INSTALL_PREFIX@/lib
   )
 
-FIND_LIBRARY(
-  cpPlugins_LIBRARY_NAME
-  cpPlugins
-  PATHS
-  /usr/lib
-  /usr/local/lib
-  @PROJECT_BINARY_DIR@
-  @CMAKE_INSTALL_PREFIX@/lib
-  )
+# ===================
+# -- Library names --
+# ===================
 
-SET(
-  cpPlugins_Interface_INCLUDE_DIRS
-  ${cpPlugins_INCLUDE_DIR1}
-  ${cpPlugins_INCLUDE_DIR2}
-  ${cpPlugins_INCLUDE_DIR2}
-  )
-SET(
-  cpPlugins_Interface_LIBRARIES
-  ${cpPlugins_Interface_LIBRARY_NAME}
-  ${cpPlugins_Extensions_LIBRARY_NAME}
-  )
-SET(
-  cpPlugins_LIBRARIES
-  ${cpPlugins_LIBRARY_NAME}
-  )
+SET(cpPlugins_Interface_LIBRARY cpPlugins_Interface)
+SET(cpPlugins_Extensions_LIBRARY cpPlugins_Extensions)
+SET(cpPlugins_LIBRARY cpPlugins)
 
 ## eof - $RCSfile$
index 550daf7e8796af333a9a573d04f642c9d53210fc..b18e5bdfd2b18a017b18895311a0197e1af9722f 100644 (file)
@@ -75,4 +75,45 @@ TARGET_LINK_LIBRARIES(
   ${VTK_LIBRARIES}
   )
 
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${LIBRARY_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+SET(
+  local_install_dirs
+  Algorithms
+  DataStructures
+  IO
+  Visualization
+  )
+FOREACH(dir ${local_install_dirs})
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/Extensions
+    FILES_MATCHING PATTERN "*.h"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/Extensions
+    FILES_MATCHING PATTERN "*.hxx"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/Extensions
+    FILES_MATCHING PATTERN "*.hpp"
+    )
+ENDFOREACH(dir)
+
+INSTALL(
+  FILES
+  ${PROJECT_BINARY_DIR}/lib/cpPlugins/Extensions/${LIBRARY_NAME}_Export.h
+  DESTINATION include/cpPlugins/Extensions
+  )
+
 ## eof - $RCSfile$
index 634a0fd9a4b918412fe1ce2787716cdb3992b175..b498063912a9fe88bf9615af949a6ec208654dc0 100644 (file)
@@ -35,4 +35,42 @@ TARGET_LINK_LIBRARIES(
   cpPlugins_Extensions
   )
 
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${LIBRARY_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+SET(
+  local_install_dirs
+  .
+  )
+FOREACH(dir ${local_install_dirs})
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/Interface
+    FILES_MATCHING PATTERN "*.h"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/Interface
+    FILES_MATCHING PATTERN "*.hxx"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/Interface
+    FILES_MATCHING PATTERN "*.hpp"
+    )
+ENDFOREACH(dir)
+
+INSTALL(
+  FILES
+  ${PROJECT_BINARY_DIR}/lib/cpPlugins/Interface/${LIBRARY_NAME}_Export.h
+  DESTINATION include/cpPlugins/Interface
+  )
+
 ## eof - $RCSfile$
index 372b1504dbb12cfb3f07cc48392fff9958a773ea..e8e9d5eadf6195cfe6e6aec68284fec2b7f54c43 100644 (file)
@@ -33,6 +33,18 @@ TARGET_LINK_LIBRARIES(
   ${LIBRARY_NAME}
   cpPlugins_Interface
   ${ITK_LIBRARIES}
+  ${VTK_LIBRARIES}
+  )
+
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${LIBRARY_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
   )
 
 ## eof - $RCSfile$
index 1dd3f14d9c6ad2fa5a477af051144edd1e7c093e..af1194bf6509c1e48f15f82a7ae9c2324cf632df 100644 (file)
@@ -2,4 +2,38 @@ SUBDIRS(
   Pluma
   )
 
+## ========================
+## -- Installation rules --
+## ========================
+IF(WIN32 OR APPLE)
+  SET(
+    local_install_dirs
+    ItkVtkGlue
+    glext
+    )
+ELSE()
+  SET(
+    local_install_dirs
+    ItkVtkGlue
+    )
+ENDIF(WIN32 OR APPLE)
+
+FOREACH(dir ${local_install_dirs})
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/third_party
+    FILES_MATCHING PATTERN "*.h"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/third_party
+    FILES_MATCHING PATTERN "*.hxx"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpPlugins/third_party
+    FILES_MATCHING PATTERN "*.hpp"
+    )
+ENDFOREACH(dir)
+
 ## eof - $RCSfile$
index da0147b3c5f78541c3be2a50ec8abab83cc597a5..c7e062c769dd922cced50e17a07cc628a93dadcb 100644 (file)
@@ -36,4 +36,15 @@ IF(NOT WIN32)
     )
 ENDIF(NOT WIN32)
 
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${LIBRARY_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+
 ## eof - $RCSfile$
index f1a41741454fcccebac8d64ab60aff643e82c9f1..4b8216624454e8b0003d1de414efe1ad0f845702 100644 (file)
@@ -6215,7 +6215,9 @@ typedef ptrdiff_t GLsizeiptrARB;
 #ifndef GL_ARB_shader_objects
 /* GL types for program/shader text and shader object handles */
 typedef char GLcharARB;
+#ifndef __APPLE__
 typedef unsigned int GLhandleARB;
+#endif // __APPLE__
 #endif
 
 /* GL type for "half" precision (s10e5) float data in host memory */