]> Creatis software - cpPlugins.git/commitdiff
Installation system updated.
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Thu, 1 Oct 2015 23:10:16 +0000 (18:10 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Thu, 1 Oct 2015 23:10:16 +0000 (18:10 -0500)
appli/bash/CMakeLists.txt
cmake/cpPluginsConfig.cmake.in
lib/cpExtensions/CMakeLists.txt
lib/cpPlugins/Plugins/CMakeLists.txt

index da6d729411fe3d264010b8cfebabc221c9bf6367..116999cfb553bfa83474e81b2e425488f65a1af6 100644 (file)
@@ -9,6 +9,12 @@ SET(
 
 FOREACH(prog ${BASH_PROGRAMS}) 
   ADD_EXECUTABLE(${prog} ${prog}.cxx)
+  INSTALL(
+    TARGETS ${prog}
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib/static
+    )
 ENDFOREACH(prog)
 
 ## eof - $RCSfile$
index 8c2e0a86998995b665759ff65f8536f323725d1e..6cd79041721f193332f3e8d34466fa5599329842 100644 (file)
@@ -2,7 +2,47 @@
 # -- Some configurations variables --
 # ===================================
 
-SET(cpPlugins_with_QT4 "@QT4_FOUND@")
+SET(USE_QT4 "@QT4_FOUND@")
+
+# =======================
+# -- Find dependencies --
+# =======================
+
+# Find ITK and VTK
+SET(ITK_DIR @ITK_DIR@)
+FIND_PACKAGE(ITK REQUIRED)
+INCLUDE(${ITK_USE_FILE})
+
+SET(VTK_DIR @VTK_DIR@)
+FIND_PACKAGE(VTK REQUIRED)
+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)
+
+IF(USE_QT4 EQUAL "1")
+  SET(QT_QMAKE_EXECUTABLE @QT_QMAKE_EXECUTABLE@)
+  FIND_PACKAGE(Qt4 REQUIRED)
+  INCLUDE(${QT_USE_FILE})
+
+  ## 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."
+        )
+    ENDIF(NOT ${vtk_module}_LOADED)
+  ENDFOREACH(vtk_module)
+ENDIF(USE_QT4 EQUAL "1")
+
 
 # =========================
 # -- Include directories --
@@ -50,9 +90,13 @@ SET(cpPlugins_LIBRARY cpPlugins)
 # -- Executable names --
 # ======================
 
-SET(
+FIND_PROGRAM(
   cpPlugins_createHost_APP
-  @PROJECT_BINARY_DIR@/cpPlugins_createHost
+  NAMES cpPlugins_createHost
+  HINTS /usr /usr/local
+  PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@
+  PATH_SUFFIXES bin sbin
+  DOC "Where is cpPlugins_createHost?"
   )
 
 ## eof - $RCSfile$
index 8819756bfda67e484662e5532894dd6c76e36b86..07b7e420f9eb1dcb1a60121df2846a7803987af0 100644 (file)
@@ -4,40 +4,52 @@ SET(LIBRARY_NAME cpExtensions)
 ## = Source code =
 ## ===============
 
-FILE(GLOB LIB_HEADERS_H   "*.h")
-FILE(GLOB LIB_HEADERS_HPP "*.hpp")
-FILE(GLOB LIB_HEADERS_HXX "*.hxx")
-FILE(GLOB LIB_SOURCES_C   "*.c")
-FILE(GLOB LIB_SOURCES_CPP "*.cpp")
-FILE(GLOB LIB_SOURCES_CXX "*.cxx")
+SET(LIB_HEADERS_H   "")
+SET(LIB_HEADERS_HPP "")
+SET(LIB_HEADERS_HXX "")
+SET(LIB_SOURCES_C   "")
+SET(LIB_SOURCES_CPP "")
+SET(LIB_SOURCES_CXX "")
 
-FILE(GLOB LIB_DataStructures_HEADERS_H   "DataStructures/*.h")
-FILE(GLOB LIB_DataStructures_HEADERS_HPP "DataStructures/*.hpp")
-FILE(GLOB LIB_DataStructures_HEADERS_HXX "DataStructures/*.hxx")
-FILE(GLOB LIB_DataStructures_SOURCES_C   "DataStructures/*.c")
-FILE(GLOB LIB_DataStructures_SOURCES_CPP "DataStructures/*.cpp")
-FILE(GLOB LIB_DataStructures_SOURCES_CXX "DataStructures/*.cxx")
-
-FILE(GLOB LIB_Algorithms_HEADERS_H   "Algorithms/*.h")
-FILE(GLOB LIB_Algorithms_HEADERS_HPP "Algorithms/*.hpp")
-FILE(GLOB LIB_Algorithms_HEADERS_HXX "Algorithms/*.hxx")
-FILE(GLOB LIB_Algorithms_SOURCES_C   "Algorithms/*.c")
-FILE(GLOB LIB_Algorithms_SOURCES_CPP "Algorithms/*.cpp")
-FILE(GLOB LIB_Algorithms_SOURCES_CXX "Algorithms/*.cxx")
+SET(
+  lib_DIRECTORIES
+  .
+  DataStructures
+  Algorithms
+  IO
+  Visualization
+  )
+FOREACH(dir ${lib_DIRECTORIES})
+  FILE(GLOB dir_LIB_HEADERS_H   "${dir}/*.h")
+  FILE(GLOB dir_LIB_HEADERS_HPP "${dir}/*.hpp")
+  FILE(GLOB dir_LIB_HEADERS_HXX "${dir}/*.hxx")
+  FILE(GLOB dir_LIB_SOURCES_C   "${dir}/*.c")
+  FILE(GLOB dir_LIB_SOURCES_CPP "${dir}/*.cpp")
+  FILE(GLOB dir_LIB_SOURCES_CXX "${dir}/*.cxx")
 
-FILE(GLOB LIB_IO_HEADERS_H   "IO/*.h")
-FILE(GLOB LIB_IO_HEADERS_HPP "IO/*.hpp")
-FILE(GLOB LIB_IO_HEADERS_HXX "IO/*.hxx")
-FILE(GLOB LIB_IO_SOURCES_C   "IO/*.c")
-FILE(GLOB LIB_IO_SOURCES_CPP "IO/*.cpp")
-FILE(GLOB LIB_IO_SOURCES_CXX "IO/*.cxx")
+  SET(LIB_HEADERS_H   "${LIB_HEADERS_H};${dir_LIB_HEADERS_H}")
+  SET(LIB_HEADERS_HPP "${LIB_HEADERS_HPP};${dir_LIB_HEADERS_HPP}")
+  SET(LIB_HEADERS_HXX "${LIB_HEADERS_HXX};${dir_LIB_HEADERS_HXX}")
+  SET(LIB_SOURCES_C   "${LIB_SOURCES_C};${dir_LIB_SOURCES_C}")
+  SET(LIB_SOURCES_CPP "${LIB_SOURCES_CPP};${dir_LIB_SOURCES_CPP}")
+  SET(LIB_SOURCES_CXX "${LIB_SOURCES_CXX};${dir_LIB_SOURCES_CXX}")
 
-FILE(GLOB LIB_Visualization_HEADERS_H   "Visualization/*.h")
-FILE(GLOB LIB_Visualization_HEADERS_HPP "Visualization/*.hpp")
-FILE(GLOB LIB_Visualization_HEADERS_HXX "Visualization/*.hxx")
-FILE(GLOB LIB_Visualization_SOURCES_C   "Visualization/*.c")
-FILE(GLOB LIB_Visualization_SOURCES_CPP "Visualization/*.cpp")
-FILE(GLOB LIB_Visualization_SOURCES_CXX "Visualization/*.cxx")
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.h"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.hpp"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.hxx"
+    )
+ENDFOREACH(dir)
 
 ## =====================
 ## = Compilation rules =
@@ -49,18 +61,6 @@ ADD_LIBRARY(
   ${LIB_SOURCES_C}
   ${LIB_SOURCES_CPP}
   ${LIB_SOURCES_CXX}
-  ${LIB_DataStructures_SOURCES_C}
-  ${LIB_DataStructures_SOURCES_CPP}
-  ${LIB_DataStructures_SOURCES_CXX}
-  ${LIB_Algorithms_SOURCES_C}
-  ${LIB_Algorithms_SOURCES_CPP}
-  ${LIB_Algorithms_SOURCES_CXX}
-  ${LIB_IO_SOURCES_C}
-  ${LIB_IO_SOURCES_CPP}
-  ${LIB_IO_SOURCES_CXX}
-  ${LIB_Visualization_SOURCES_C}
-  ${LIB_Visualization_SOURCES_CPP}
-  ${LIB_Visualization_SOURCES_CXX}
   )
 GENERATE_EXPORT_HEADER(
   ${LIBRARY_NAME}
@@ -85,31 +85,6 @@ INSTALL(
   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/cpExtensions
-    FILES_MATCHING PATTERN "*.h"
-    )
-  INSTALL(
-    DIRECTORY ${dir}
-    DESTINATION include/cpExtensions
-    FILES_MATCHING PATTERN "*.hxx"
-    )
-  INSTALL(
-    DIRECTORY ${dir}
-    DESTINATION include/cpExtensions
-    FILES_MATCHING PATTERN "*.hpp"
-    )
-ENDFOREACH(dir)
-
 INSTALL(
   FILES
   ${PROJECT_BINARY_DIR}/lib/cpExtensions/${LIBRARY_NAME}_Export.h
index 477f5007fe29127c8203e2b8d6d3f9e7e712f2e3..6fe1263cf23ade46b94ff02cf84ef6e6e7d02d09 100644 (file)
@@ -3,59 +3,4 @@ SUBDIRS(
   BasicFilters
   )
 
-# SET(LIBRARY_NAME cpPlugins)
-
-# ## ===============
-# ## = Source code =
-# ## ===============
-
-# FILE(GLOB LIB_HEADERS_H   "*.h")
-# FILE(GLOB LIB_HEADERS_HPP "*.hpp")
-# FILE(GLOB LIB_HEADERS_HXX "*.hxx")
-# FILE(GLOB LIB_SOURCES_C   "*.c")
-# FILE(GLOB LIB_SOURCES_CPP "*.cpp")
-# FILE(GLOB LIB_SOURCES_CXX "*.cxx")
-
-# ## =====================
-# ## = Compilation rules =
-# ## =====================
-
-# ADD_CUSTOM_COMMAND(
-#   OUTPUT ${LIBRARY_NAME}_Host.cxx
-#   DEPENDS ${PROJECT_BINARY_DIR}/cpPlugins_createHost ${LIB_HEADERS_H} ${LIB_HEADERS_HPP} ${LIB_HEADERS_HXX}
-#   COMMAND ${PROJECT_BINARY_DIR}/cpPlugins_createHost ${LIBRARY_NAME}_Host.cxx cpPlugins::Plugins ${LIB_HEADERS_H}
-#   )
-
-# ADD_LIBRARY(
-#   ${LIBRARY_NAME}
-#   SHARED
-#   ${LIBRARY_NAME}_Host.cxx
-#   ${LIB_SOURCES_C}
-#   ${LIB_SOURCES_CPP}
-#   ${LIB_SOURCES_CXX}
-#   )
-# GENERATE_EXPORT_HEADER(
-#   ${LIBRARY_NAME}
-#   BASE_NAME ${LIBRARY_NAME}
-#   EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
-#   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpPlugins/Plugins/${LIBRARY_NAME}_Export.h
-#   STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
-#   )
-# TARGET_LINK_LIBRARIES(
-#   ${LIBRARY_NAME}
-#   cpExtensions
-#   cpPlugins_Interface
-#   )
-
-# ## ========================
-# ## -- Installation rules --
-# ## ========================
-
-# INSTALL(
-#   TARGETS ${LIBRARY_NAME}
-#   RUNTIME DESTINATION bin
-#   LIBRARY DESTINATION lib
-#   ARCHIVE DESTINATION lib/static
-#   )
-
-# ## eof - $RCSfile$
+## eof - $RCSfile$