From 3077f0a33552a68b48a4c9cd9a3b845f76ba467f Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Thu, 1 Oct 2015 18:10:16 -0500 Subject: [PATCH] Installation system updated. --- appli/bash/CMakeLists.txt | 6 ++ cmake/cpPluginsConfig.cmake.in | 50 +++++++++++- lib/cpExtensions/CMakeLists.txt | 111 +++++++++++---------------- lib/cpPlugins/Plugins/CMakeLists.txt | 57 +------------- 4 files changed, 97 insertions(+), 127 deletions(-) diff --git a/appli/bash/CMakeLists.txt b/appli/bash/CMakeLists.txt index da6d729..116999c 100644 --- a/appli/bash/CMakeLists.txt +++ b/appli/bash/CMakeLists.txt @@ -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$ diff --git a/cmake/cpPluginsConfig.cmake.in b/cmake/cpPluginsConfig.cmake.in index 8c2e0a8..6cd7904 100644 --- a/cmake/cpPluginsConfig.cmake.in +++ b/cmake/cpPluginsConfig.cmake.in @@ -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$ diff --git a/lib/cpExtensions/CMakeLists.txt b/lib/cpExtensions/CMakeLists.txt index 8819756..07b7e42 100644 --- a/lib/cpExtensions/CMakeLists.txt +++ b/lib/cpExtensions/CMakeLists.txt @@ -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 diff --git a/lib/cpPlugins/Plugins/CMakeLists.txt b/lib/cpPlugins/Plugins/CMakeLists.txt index 477f500..6fe1263 100644 --- a/lib/cpPlugins/Plugins/CMakeLists.txt +++ b/lib/cpPlugins/Plugins/CMakeLists.txt @@ -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$ -- 2.47.1