# -- 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 --
# -- 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$
## = 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 =
${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}
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
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$