]> Creatis software - cpPlugins.git/commitdiff
Build procedure simplified
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 27 Jun 2016 21:15:38 +0000 (16:15 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 27 Jun 2016 21:15:38 +0000 (16:15 -0500)
41 files changed:
CMakeLists.txt
appli/PipelineEditor/CMakeLists.txt
cmake/cpPlugins_Functions.cmake
lib/CMakeLists.txt
lib/Instances/CMakeLists.txt
lib/cpBaseQtApplication/ActorProperties.h
lib/cpBaseQtApplication/Block.h
lib/cpBaseQtApplication/Canvas.h
lib/cpBaseQtApplication/Connection.h
lib/cpBaseQtApplication/Editor.h
lib/cpBaseQtApplication/MainWindow.h
lib/cpBaseQtApplication/Port.h
lib/cpExtensions/Algorithms/KalmanFilter.h
lib/cpExtensions/Config.h.in
lib/cpPlugins/Config.h.in
lib/tinyxml2/tinyxml2.h
plugins/CMakeLists.txt
plugins/GenericFilters/JoinBoundingBoxes.h
plugins/IO/DataReproducer.h
plugins/IO/ImageReader.h
plugins/IO/ImageWriter.h
plugins/ImageFilters/AndImageFilter.h
plugins/ImageFilters/BinaryContourImageFilter.h
plugins/ImageFilters/BinaryDilateParaImageFilter.h
plugins/ImageFilters/BinaryErodeParaImageFilter.h
plugins/ImageFilters/BinaryThresholdImageFilter.h
plugins/ImageFilters/CastImageFilter.h
plugins/ImageFilters/GaussianDensityImageFilter.h
plugins/ImageFilters/MultiScaleGaussianImageFilter.h
plugins/ImageFilters/OrImageFilter.h
plugins/ImageFilters/RegionOfInterestImageFilter.h
plugins/ImageFilters/ResampleImageFilter.h
plugins/ImageFilters/SignedMaurerDistanceMapImageFilter.h
plugins/ImageFilters/UnaryThresholdImageFilter.h
plugins/ImageMeshFilters/MarchingCubes.h
plugins/ImageMeshFilters/TriangleMeshToBinaryImageFilter.h
plugins/MedialnessFilters/GulsunTekMedialness.h
plugins/MeshFilters/AppendMeshesFilter.h
plugins/MeshSources/CylinderSource.h
plugins/MeshSources/SphereSource.h
plugins/Widgets/SeedWidget.h

index 72a0e6cc75601488deb8fb05759a1ad18581a99e..28e32f4def619dc141067fc9f093707fdc7dc9f2 100644 (file)
@@ -46,6 +46,6 @@ INCLUDE_DIRECTORIES(
 ## == Subdirs containing code ==
 ## =============================
 
-SUBDIRS(cmake lib appli plugins)
+SUBDIRS(appli cmake lib plugins)
 
 ## eof - $RCSfile$
index 2266e04f237d95e772a81045ffc74a0444434898..bfdb6f7ef93a5369178585ae44af3ae5ec8d7915 100644 (file)
@@ -1,8 +1,8 @@
 IF(Qt4_FOUND)
-  cpPlugins_BuildAppFromDirectory(
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${cpBaseQtApplication_LIB}
-    )
+  cpPlugins_BuildAppFromDirectory(_app_name ${CMAKE_CURRENT_SOURCE_DIR})
+  IF(_app_name)
+    TARGET_LINK_LIBRARIES(${_app_name} ${cpBaseQtApplication_LIB})
+  ENDIF(_app_name)
 ENDIF(Qt4_FOUND)
 
 
index 4337bd9f670347c4e54806604d85552d99e038b4..45d75528add1ed2bd4fff0184bf41fc780dde292 100644 (file)
 
+## ==============================
+## == Macro to normalize paths ==
+## ==============================
+
+FUNCTION(cpPlugins_NormalizePaths output_files)
+SET(_out)
+FOREACH(_f ${ARGN})
+  SET(_d)
+  FILE(TO_CMAKE_PATH ${_f} _d)
+  LIST(APPEND _out ${_d})
+ENDFOREACH(_f)
+SET(${output_files} "${_out}" PARENT_SCOPE)
+ENDFUNCTION()
+
+## ==========================
+## == Macro to wrap qt-uis ==
+## ==========================
+
+FUNCTION(cpPlugins_Wrap_Qt_ui output_files)
+cpPlugins_NormalizePaths(_source_dir ${PROJECT_SOURCE_DIR})
+cpPlugins_NormalizePaths(_binary_dir ${PROJECT_BINARY_DIR})
+SET(_out)
+FOREACH(_f ${ARGN})
+  IF(EXISTS ${_f})
+    GET_FILENAME_COMPONENT(_name ${_f} NAME_WE)
+    GET_FILENAME_COMPONENT(_dir ${_f} DIRECTORY)
+    SET(_base_dir ${_source_dir})
+    STRING(FIND "${_dir}" "${_base_dir}" _pos)
+    IF(${_pos} EQUAL -1)
+      SET(_base_dir ${_binary_dir})
+      STRING(FIND "${_dir}" "${_base_dir}" _pos)
+    ENDIF(${_pos} EQUAL -1)
+    IF(NOT ${_pos} EQUAL -1)
+      STRING(REPLACE "${_base_dir}/" "" _dir ${_dir})
+      SET(_out_f ${_binary_dir}/${_dir}/ui_${_name}.h)
+      LIST(APPEND _out ${_out_f})
+      ADD_CUSTOM_COMMAND(
+        OUTPUT ${_out_f}
+        COMMAND Qt4::uic
+        ARGS -o ${_out_f} ${_f}
+        MAIN_DEPENDENCY ${_f} VERBATIM
+        )
+    ENDIF(NOT ${_pos} EQUAL -1)
+  ENDIF(EXISTS ${_f})
+ENDFOREACH(_f)
+SET(${output_files} "${_out}" PARENT_SCOPE)
+ENDFUNCTION()
+
+## ==========================
+## == Macro to wrap qt-moc ==
+## ==========================
+
+FUNCTION(cpPlugins_Wrap_Qt_cpp output_files)
+SET(_out)
+FOREACH(_f ${ARGN})
+  IF(EXISTS ${_f})
+    FILE(READ ${_f} _txt)
+    STRING(FIND "${_txt}" "Q_OBJECT" _pos)
+    IF(NOT ${_pos} EQUAL -1)
+      SET(_s)
+      QT4_WRAP_CPP(_s ${_f})
+      SET(_out ${_out} ${_s})
+    ENDIF(NOT ${_pos} EQUAL -1)
+  ENDIF(EXISTS ${_f})
+ENDFOREACH(_f)
+SET(${output_files} "${_out}" PARENT_SCOPE)
+ENDFUNCTION()
+
 ## =================================
 ## == Function to build a library ==
 ## =================================
 
-FUNCTION(cpPlugins_ManageLibrary library_name type sources headers qt_files version short_version)
+FUNCTION(
+  cpPlugins_CreateLibrary
+  lib_name
+  lib_type
+  lib_source_files
+  lib_header_files
+  lib_qt_ui_files
+  lib_version
+  lib_short_version
+  )
 
-## -- Configure some simple values
-SET(_all_sources ${sources})
-SET(_all_headers ${headers})
+## -- Configure inputs to be cmake-path compatible
+cpPlugins_NormalizePaths(_sources ${lib_source_files})
+cpPlugins_NormalizePaths(_headers ${lib_header_files})
+cpPlugins_NormalizePaths(_qt_uis ${lib_qt_ui_files})
 
-## -- Guess what headers sould be qt-moc'ed
+# -- Prepare Qt4-based code
 IF(Qt4_FOUND)
-  FOREACH(_h ${headers})
-    FILE(READ ${_h} _txt)
-    STRING(FIND "${_txt}" "Q_OBJECT" _r)
-    IF(NOT ${_r} EQUAL -1)
-      SET(_s)
-      QT4_WRAP_CPP(_s ${_h})
-      SET(_all_sources ${_all_sources} ${_s})
-    ENDIF(NOT ${_r} EQUAL -1)
-  ENDFOREACH(_h)
-ENDIF(Qt4_FOUND)
 
-## -- Guess what qt-ui's sould be qt-uic'ed
-## -- Wrap qt-ui headers: this is equivalent to QT4_WRAP_UI except to change the
-## -- output file
-IF(Qt4_FOUND)
-  FOREACH(_ui ${qt_files})
-    SET(_base_dir ${CMAKE_CURRENT_SOURCE_DIR})
-    STRING(FIND "${_ui}" "${_base_dir}" _pos)
-    IF(${_pos} EQUAL -1)
-      SET(_base_dir ${CMAKE_CURRENT_BINARY_DIR})
-      STRING(FIND "${_ui}" "${_base_dir}" _pos)
-    ENDIF(${_pos} EQUAL -1)
-    SET(_relative_dir)
-    IF(NOT ${_pos} EQUAL -1)
-      FILE(TO_CMAKE_PATH ${_base_dir} _base_cmake_dir)
-      FILE(TO_CMAKE_PATH ${_ui} _ui_dir)
-      STRING(REPLACE "${_base_cmake_dir}/" "" _relative_dir ${_ui_dir})
-    ENDIF(NOT ${_pos} EQUAL -1)
-    GET_FILENAME_COMPONENT(_ui_name ${_ui} NAME_WE)
-    STRING(FIND "${_relative_dir}" "/" _pos REVERSE)
-    STRING(SUBSTRING "${_relative_dir}" 0 ${_pos} _o)
-    SET(_o_name ${CMAKE_CURRENT_BINARY_DIR}/${_o}/ui_${_ui_name}.h)
-    ADD_CUSTOM_COMMAND(
-      OUTPUT ${_o_name}
-      COMMAND Qt4::uic
-      ARGS -o ${_o_name} ${_ui}
-      MAIN_DEPENDENCY ${_ui} VERBATIM
-      )
-    SET(_all_sources ${_all_sources} ${_o_name})
-  ENDFOREACH(_ui)
+  ## -- Guess what headers sould be qt-moc'ed
+  cpPlugins_Wrap_Qt_cpp(_qt_moc_sources ${_headers})
+  IF(_qt_moc_sources)
+    SET(_sources ${_sources} ${_qt_moc_sources})
+  ENDIF(_qt_moc_sources)
+
+  ## -- Guess what qt-ui's sould be qt-uic'ed
+  ## -- Wrap qt-ui headers: this is equivalent to QT4_WRAP_UI except to change the
+  ## -- output file
+  cpPlugins_Wrap_Qt_ui(_qt_ui_headers ${_qt_uis})
+  IF(_qt_ui_headers)
+    SET(_headers ${_headers} ${_qt_ui_headers})
+    SET(_sources ${_sources} ${_qt_ui_headers})
+  ENDIF(_qt_ui_headers)
 ENDIF(Qt4_FOUND)
 
 ## -- Ok, compile library
-IF(_all_sources)
-
-  ## -- Try to guess the binary directory
-  SET(_relative_dir)
-  FOREACH(_s ${_all_sources})
-    GET_FILENAME_COMPONENT(_d ${_s} DIRECTORY)
-    SET(_base_dir ${CMAKE_CURRENT_SOURCE_DIR})
-    STRING(FIND "${_d}" "${_base_dir}" _pos)
-    IF(${_pos} EQUAL -1)
-      SET(_base_dir ${CMAKE_CURRENT_BINARY_DIR})
-      STRING(FIND "${_d}" "${_base_dir}" _pos)
-    ENDIF(${_pos} EQUAL -1)
-    IF(NOT ${_pos} EQUAL -1)
-      FILE(TO_CMAKE_PATH ${_base_dir} _base_cmake_dir)
-      FILE(TO_CMAKE_PATH ${_d} _d_dir)
-      STRING(REPLACE "${_base_cmake_dir}/" "" _almost_relative_dir ${_d_dir})
-      STRING(FIND "${_almost_relative_dir}" "/" _pos)
-      IF(NOT ${_pos} EQUAL -1)
-        STRING(SUBSTRING ${_almost_relative_dir} 0 ${_pos} _relative_dir)
-      ELSE(NOT ${_pos} EQUAL -1)
-        SET(_relative_dir ${_almost_relative_dir})
-      ENDIF(NOT ${_pos} EQUAL -1)
-      BREAK()
-    ENDIF(NOT ${_pos} EQUAL -1)
-  ENDFOREACH(_s)
-  SET(_cur_binary_dir "${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir}")
-
-  ADD_LIBRARY(${library_name} SHARED ${_all_sources})
+IF(_sources)
+  cpPlugins_NormalizePaths(_cur_binary_dir ${CMAKE_CURRENT_BINARY_DIR})
+  ADD_LIBRARY(${lib_name} SHARED ${_sources} ${_headers})
   SET_TARGET_PROPERTIES(
-    ${library_name} PROPERTIES
-    VERSION "${version}"
-    SOVERSION "${short_version}"
+    ${lib_name}
+    PROPERTIES
+    VERSION "${lib_version}"
+    SOVERSION "${lib_short_version}"
     )
   GENERATE_EXPORT_HEADER(
-    ${library_name}
-    BASE_NAME ${library_name}
-    EXPORT_MACRO_NAME ${library_name}_EXPORT
-    EXPORT_FILE_NAME ${_cur_binary_dir}/${library_name}_Export.h
-    STATIC_DEFINE ${library_name}_BUILT_AS_STATIC
+    ${lib_name}
+    BASE_NAME ${lib_name}
+    EXPORT_MACRO_NAME ${lib_name}_EXPORT
+    EXPORT_FILE_NAME ${_cur_binary_dir}/${lib_name}_Export.h
+    STATIC_DEFINE ${lib_name}_BUILT_AS_STATIC
     )
-  TARGET_LINK_LIBRARIES(${library_name} ${ARGN})
-  SET(${library_name}_LIB ${library_name} CACHE INTERNAL "Library ${name}")
-ENDIF(_all_sources)
+  SET(${lib_name}_LIB ${lib_name} CACHE INTERNAL "Library ${lib_name}")
+ENDIF(_sources)
 
 ENDFUNCTION()
 
@@ -104,67 +132,92 @@ ENDFUNCTION()
 ## == Function to build a library from a directory ==
 ## ==================================================
 
-FUNCTION(cpPlugins_CreateLibraryFromDirectory library_name type source_dir binary_dir version short_version)
+FUNCTION(
+  cpPlugins_CreateLibraryFromDirectory
+  lib_name
+  lib_type
+  lib_source_dir
+  lib_version
+  lib_short_version
+  )
 
-## -- Some useful variables
-SET(_all_sources_extensions c cpp cxx)
-SET(_all_headers_extensions h hpp hxx)
-SET(_all_qt_ui_extensions ui)
-SET(_all_dirs ${source_dir} ${binary_dir})
-SET(_all_sources)
-SET(_all_headers)
-SET(_all_qt_ui)
+## -- Configure inputs to be cmake-path compatible
+cpPlugins_NormalizePaths(_global_source_dir ${PROJECT_SOURCE_DIR})
+cpPlugins_NormalizePaths(_global_binary_dir ${PROJECT_BINARY_DIR})
+cpPlugins_NormalizePaths(_source_dir ${lib_source_dir})
+STRING(REPLACE "${_global_source_dir}" "" _local_source_dir ${_source_dir})
+SET(_binary_dir ${_global_binary_dir}${_local_source_dir})
 
-## -- Configure some files
-FILE(GLOB_RECURSE _all_configs "${source_dir}/*.in")
-FOREACH(_c ${_all_configs})
-  SET(_base_dir ${CMAKE_CURRENT_SOURCE_DIR})
-  STRING(FIND "${_c}" "${_base_dir}" _pos)
-  IF(${_pos} EQUAL -1)
-    SET(_base_dir ${CMAKE_CURRENT_BINARY_DIR})
-    STRING(FIND "${_c}" "${_base_dir}" _pos)
-  ENDIF(${_pos} EQUAL -1)
-  SET(_relative_dir)
-  IF(NOT ${_pos} EQUAL -1)
-    FILE(TO_CMAKE_PATH ${_base_dir} _base_cmake_dir)
-    FILE(TO_CMAKE_PATH ${_c} _c_dir)
-    STRING(REPLACE "${_base_cmake_dir}/" "" _almost_relative_dir ${_c_dir})
-    STRING(FIND "${_almost_relative_dir}" "/" _pos)
-    SET(_relative_dir ${_almost_relative_dir})
-    IF(NOT ${_pos} EQUAL -1)
-      STRING(SUBSTRING ${_almost_relative_dir} 0 ${_pos} _relative_dir)
-    ENDIF(NOT ${_pos} EQUAL -1)
-  ENDIF(NOT ${_pos} EQUAL -1)
-  GET_FILENAME_COMPONENT(_c_name ${_c} NAME)
-  STRING(REGEX REPLACE ".in" "" _o_name ${_c_name})
-  CONFIGURE_FILE(
-    ${_c} ${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir}/${_o_name} @ONLY
-    )
-  SET(_all_headers ${_all_headers} ${CMAKE_CURRENT_BINARY_DIR}/${_relative_dir}/${_o_name})
-ENDFOREACH(_c)
+## -- Some useful variables
+SET(_sources_extensions .c .cpp .cxx)
+SET(_headers_extensions .h .hpp .hxx)
+SET(_qt_ui_extensions .ui)
+SET(_dirs ${_source_dir} ${_binary_dir})
+SET(_sources)
+SET(_headers)
+SET(_qt_uis)
 
 ## -- Glob source code
-FOREACH(_d ${_all_dirs})
-  FOREACH(_e ${_all_sources_extensions})
-    FILE(GLOB_RECURSE _f "${_d}/*.${_e}")
-    SET(_all_sources ${_all_sources} ${_f})
+FOREACH(_d ${_dirs})
+  FOREACH(_e ${_sources_extensions})
+    FILE(GLOB_RECURSE _f "${_d}/*${_e}")
+    SET(_sources ${_sources} ${_f})
   ENDFOREACH(_e)
-  FOREACH(_e ${_all_headers_extensions})
-    FILE(GLOB_RECURSE _f "${_d}/*.${_e}")
-    SET(_all_headers ${_all_headers} ${_f})
+  FOREACH(_e ${_headers_extensions})
+    FILE(GLOB_RECURSE _f "${_d}/*${_e}")
+    SET(_headers ${_headers} ${_f})
   ENDFOREACH(_e)
-  FOREACH(_e ${_all_qt_ui_extensions})
-    FILE(GLOB_RECURSE _f "${_d}/*.${_e}")
-    SET(_all_qt_ui ${_all_qt_ui} ${_f})
+  FOREACH(_e ${_qt_ui_extensions})
+    FILE(GLOB_RECURSE _f "${_d}/*${_e}")
+    SET(_qt_uis ${_qt_uis} ${_f})
   ENDFOREACH(_e)
 ENDFOREACH(_d)
 
+## -- Configure some files
+FILE(GLOB_RECURSE _configs "${_source_dir}/*.in")
+FOREACH(_c ${_configs})
+
+  ## -- Build input and output names
+  cpPlugins_NormalizePaths(_input_file ${_c})
+  GET_FILENAME_COMPONENT(_input_name ${_input_file} NAME)
+  GET_FILENAME_COMPONENT(_input_dir ${_input_file} DIRECTORY)
+  STRING(REPLACE ".in" "" _output_name ${_input_name})
+  STRING(REPLACE "${_global_source_dir}" "" _output_dir ${_input_dir})
+  SET(_output_file "${_global_binary_dir}${_output_dir}/${_output_name}")
+
+  ## -- Configure file
+  CONFIGURE_FILE(${_input_file} ${_output_file} @ONLY)
+
+  ## -- Add it to the correct list
+  GET_FILENAME_COMPONENT(_output_ext ${_output_name} EXT)
+  IF(
+      "${_output_ext}" STREQUAL ".h"
+      OR
+      "${_output_ext}" STREQUAL ".hpp"
+      OR
+      "${_output_ext}" STREQUAL ".hxx"
+      )
+    SET(_headers ${_headers})
+  ENDIF()
+  IF(
+      "${_output_ext}" STREQUAL ".c"
+      OR
+      "${_output_ext}" STREQUAL ".cpp"
+      OR
+      "${_output_ext}" STREQUAL ".cxx"
+      )
+    SET(_sources ${_sources})
+  ENDIF()
+  IF("${_output_ext}" STREQUAL ".ui")
+    SET(_qt_uis ${_qt_uis})
+  ENDIF()
+ENDFOREACH(_c)
+
 ## -- Create library
-cpPlugins_ManageLibrary(
-  ${library_name} ${type}
-  "${_all_sources}" "${_all_headers}" "${_all_qt_ui}"
-  "${version}" "${short_version}"
-  ${ARGN}
+cpPlugins_CreateLibrary(
+  ${lib_name} ${lib_type}
+  "${_sources}" "${_headers}" "${_qt_uis}"
+  "${lib_version}" "${lib_short_version}"
   )
 
 ENDFUNCTION()
@@ -173,35 +226,48 @@ ENDFUNCTION()
 ## == Function to wrap instances ==
 ## ================================
 
-FUNCTION(cpPlugins_WrapInstances def_file prefix version short_version)
+FUNCTION(
+  cpPlugins_WrapInstances
+  out_lib_name
+  def_file
+  prefix
+  version
+  short_version
+  )
 
-## -- Configure some simple values
-SET(_def_canonical_file "${CMAKE_CURRENT_SOURCE_DIR}/${def_file}.i")
-SET(_header_file        "${CMAKE_CURRENT_BINARY_DIR}/${prefix}${def_file}.h")
-SET(_code_file          "${CMAKE_CURRENT_BINARY_DIR}/${prefix}${def_file}.cxx")
-SET(_extra_code_file    "${CMAKE_CURRENT_SOURCE_DIR}/${def_file}_extra.cxx")
-SET(_library_name       "${prefix}${def_file}")
+## -- Configure inputs to be cmake-path compatible
+cpPlugins_NormalizePaths(_def_file ${def_file})
+GET_FILENAME_COMPONENT(_def_name ${_def_file} NAME_WE)
+GET_FILENAME_COMPONENT(_def_dir ${_def_file} DIRECTORY)
+cpPlugins_NormalizePaths(_global_source_dir ${PROJECT_SOURCE_DIR})
+cpPlugins_NormalizePaths(_global_binary_dir ${PROJECT_BINARY_DIR})
+STRING(REPLACE "${_global_source_dir}" "" _out_dir ${_def_dir})
+SET(_out_base "${_global_binary_dir}${_out_dir}")
+SET(_out_header "${prefix}${_def_name}.h")
+SET(_out_code "${prefix}${_def_name}.cxx")
+SET(_lib_name "${prefix}${_def_name}")
+SET(_input_extra_code "${_global_source_dir}${_out_dir}/${_def_name}_extra.cxx")
 
 ## -- Add extra code, if any
-SET(_all_code_files ${_code_file})
-IF(EXISTS ${_extra_code_file})
-  SET(_all_code_files ${_all_code_files} ${_extra_code_file})
-ENDIF(EXISTS ${_extra_code_file})
+SET(_all_out_code ${_out_base}/${_out_code})
+IF(EXISTS ${_input_extra_code})
+  SET(_all_out_code ${_all_out_code} ${_input_extra_code})
+ENDIF(EXISTS ${_input_extra_code})
 
 ## -- Command to write source code
 ADD_CUSTOM_COMMAND(
-  OUTPUT ${_header_file} ${_code_file}
-  DEPENDS ${cpPlugins_CreateInstances_APP} ${_def_canonical_file}
-  COMMAND ${cpPlugins_CreateInstances_APP} ${_def_canonical_file} ${_library_name} ${CMAKE_CURRENT_BINARY_DIR}
+  OUTPUT ${_out_base}/${_out_header} ${_out_base}/${_out_code}
+  DEPENDS ${cpPlugins_CreateInstances_APP} ${_def_file}
+  COMMAND ${cpPlugins_CreateInstances_APP} ${_def_file} ${_lib_name} ${_out_base}
   )
 
 ## -- Create library
-cpPlugins_ManageLibrary(
-  ${_library_name} SHARED
-  "${_all_code_files}" "" ""
+cpPlugins_CreateLibrary(
+  "${_lib_name}" SHARED
+  "${_all_out_code}" "${_out_base}/${_out_header}" ""
   "${version}" "${short_version}"
-  ${ARGN}
   )
+SET(${out_lib_name} ${_lib_name} PARENT_SCOPE)
 
 ENDFUNCTION()
 
@@ -209,12 +275,17 @@ ENDFUNCTION()
 ## == Function to wrap plugins hosts ==
 ## ====================================
 
-FUNCTION(cpPlugins_WrapPlugins source_dir version short_version prefix)
+FUNCTION(cpPlugins_WrapPlugins output_lib source_dir version short_version prefix)
 
-## -- Some configuration values
-SET(_source_dir ${CMAKE_CURRENT_SOURCE_DIR}/${source_dir})
-SET(_binary_dir ${CMAKE_CURRENT_BINARY_DIR}/${source_dir})
-SET(_lib_name ${prefix}${source_dir})
+## -- Configure inputs to be cmake-path compatible
+cpPlugins_NormalizePaths(_source_dir ${source_dir})
+cpPlugins_NormalizePaths(_global_source_dir ${PROJECT_SOURCE_DIR})
+cpPlugins_NormalizePaths(_global_binary_dir ${PROJECT_BINARY_DIR})
+STRING(REPLACE "${_global_source_dir}" "" _out_dir ${_source_dir})
+SET(_out_dir "${_global_binary_dir}${_out_dir}")
+FILE(MAKE_DIRECTORY ${_out_dir})
+GET_FILENAME_COMPONENT(_lib_name ${_source_dir} NAME_WE)
+SET(_lib_name ${prefix}${_lib_name})
 
 ## -- Get source code
 FILE(GLOB_RECURSE _hdr_h   "${_source_dir}/*.h")
@@ -241,7 +312,7 @@ SET(_all_hdr ${_hdr_h} ${_hdr_hpp} ${_hdr_hxx})
 
 ## -- Wrap plugins
 IF(_hdr_to_wrap)
-  SET(_host ${_binary_dir}/${_lib_name}_host.cxx)
+  SET(_host ${_out_dir}/${_lib_name}_host.cxx)
   ADD_CUSTOM_COMMAND(
     OUTPUT ${_host}
     DEPENDS ${cpPlugins_HostCreator_APP} ${_hdr_to_wrap}
@@ -252,90 +323,127 @@ ENDIF(_hdr_to_wrap)
 
 ## -- Ok, build library
 IF(_all_src)
-  cpPlugins_ManageLibrary(
+  cpPlugins_CreateLibrary(
     ${_lib_name} SHARED
     "${_all_src}" "${_all_hdr}" "${_qt_ui}"
     "${version}" "${short_version}"
     ${ARGN}
     )
+  SET(${output_lib} ${_lib_name} PARENT_SCOPE)
 ELSE(_all_src)
   MESSAGE(FATAL_ERROR "No source code found to build \"${_lib_name}\"")
 ENDIF(_all_src)
-
 ENDFUNCTION()
 
 ## ======================================
 ## == Function to build an application ==
 ## ======================================
 
-FUNCTION(cpPlugins_BuildAppFromDirectory directory)
-
-## -- Some configuration values
-FILE(TO_CMAKE_PATH ${directory} _src_dir)
-STRING(REPLACE "${PROJECT_SOURCE_DIR}/" "" _bin_dir ${_src_dir})
-SET(_bin_dir "${PROJECT_BINARY_DIR}/${_bin_dir}")
-GET_FILENAME_COMPONENT(_app_name ${_src_dir} NAME)
-SET(_all_sources_extensions c cpp cxx)
-SET(_all_headers_extensions h hpp hxx)
-SET(_all_qt_ui_extensions ui)
-SET(_all_dirs ${_src_dir} ${_bin_dir})
-SET(_all_sources)
-SET(_all_headers)
-SET(_all_qt_ui)
-
-## -- Compilation option
-OPTION(BUILD_${_app_name} "Build \"${_app_name}\" application" OFF)
-
-## -- Glob source code
-FOREACH(_d ${_all_dirs})
-  FOREACH(_e ${_all_sources_extensions})
-    FILE(GLOB_RECURSE _f "${_d}/*.${_e}")
-    SET(_all_sources ${_all_sources} ${_f})
-  ENDFOREACH(_e)
-  FOREACH(_e ${_all_headers_extensions})
-    FILE(GLOB_RECURSE _f "${_d}/*.${_e}")
-    SET(_all_headers ${_all_headers} ${_f})
-  ENDFOREACH(_e)
-  FOREACH(_e ${_all_qt_ui_extensions})
-    FILE(GLOB_RECURSE _f "${_d}/*.${_e}")
-    SET(_all_qt_ui ${_all_qt_ui} ${_f})
-  ENDFOREACH(_e)
-ENDFOREACH(_d)
+FUNCTION(cpPlugins_BuildAppFromDirectory output_app source_dir)
 
-## -- Guess what headers sould be qt-moc'ed
-FOREACH(_h ${_all_headers})
-  FILE(READ ${_h} _txt)
-  STRING(FIND "${_txt}" "Q_OBJECT" _r)
-  IF(NOT ${_r} EQUAL -1)
-    SET(_s)
-    QT4_WRAP_CPP(_s ${_h})
-    SET(_all_sources ${_all_sources} ${_s})
-  ENDIF(NOT ${_r} EQUAL -1)
-ENDFOREACH(_h)
+## -- Configure inputs to be cmake-path compatible
+cpPlugins_NormalizePaths(_global_source_dir ${PROJECT_SOURCE_DIR})
+cpPlugins_NormalizePaths(_global_binary_dir ${PROJECT_BINARY_DIR})
+cpPlugins_NormalizePaths(_source_dir ${source_dir})
+STRING(REPLACE "${_global_source_dir}" "" _local_source_dir ${_source_dir})
+SET(_binary_dir ${_global_binary_dir}${_local_source_dir})
+GET_FILENAME_COMPONENT(_app_name ${_source_dir} NAME_WE)
+OPTION(BUILD_${_app_name} "Build \"${_app_name}\" application" OFF)
 
-## -- Guess what qt-ui's sould be qt-uic'ed
-## -- Wrap qt-ui headers: this is equivalent to QT4_WRAP_UI except to change the
-## -- output file
-FOREACH(_ui ${_all_qt_ui})
-  GET_FILENAME_COMPONENT(_r_ui ${_ui} NAME_WE)
-  SET(_o_ui ${_bin_dir}/ui_${_r_ui}.h)
-  ADD_CUSTOM_COMMAND(
-    OUTPUT ${_o_ui}
-    COMMAND Qt4::uic
-    ARGS -o ${_o_ui} ${_ui}
-    MAIN_DEPENDENCY ${_ui} VERBATIM
-    )
-  SET(_all_sources ${_all_sources} ${_o_ui})
-  SET(_all_headers ${_all_headers} ${_o_ui})
-ENDFOREACH(_ui)
-
-## -- Ok, compile application
-IF(_all_sources)
-  ADD_EXECUTABLE(${_app_name} ${_all_sources})
-  TARGET_LINK_LIBRARIES(${_app_name} ${ARGN})
-ELSE(_all_sources)
-  MESSAGE(FATAL_ERROR "No source code found to build \"${_app_name}\"")
-ENDIF(_all_sources)
+IF(BUILD_${_app_name})
+
+  ## -- Some useful variables
+  SET(_sources_extensions .c .cpp .cxx)
+  SET(_headers_extensions .h .hpp .hxx)
+  SET(_qt_ui_extensions .ui)
+  SET(_dirs ${_source_dir} ${_binary_dir})
+  SET(_sources)
+  SET(_headers)
+  SET(_qt_uis)
+
+  ## -- Glob source code
+  FOREACH(_d ${_dirs})
+    FOREACH(_e ${_sources_extensions})
+      FILE(GLOB_RECURSE _f "${_d}/*${_e}")
+      SET(_sources ${_sources} ${_f})
+    ENDFOREACH(_e)
+    FOREACH(_e ${_headers_extensions})
+      FILE(GLOB_RECURSE _f "${_d}/*${_e}")
+      SET(_headers ${_headers} ${_f})
+    ENDFOREACH(_e)
+    FOREACH(_e ${_qt_ui_extensions})
+      FILE(GLOB_RECURSE _f "${_d}/*${_e}")
+      SET(_qt_uis ${_qt_uis} ${_f})
+    ENDFOREACH(_e)
+  ENDFOREACH(_d)
+
+  ## -- Configure some files
+  FILE(GLOB_RECURSE _configs "${_source_dir}/*.in")
+  FOREACH(_c ${_configs})
+
+    ## -- Build input and output names
+    cpPlugins_NormalizePaths(_input_file ${_c})
+    GET_FILENAME_COMPONENT(_input_name ${_input_file} NAME)
+    GET_FILENAME_COMPONENT(_input_dir ${_input_file} DIRECTORY)
+    STRING(REPLACE ".in" "" _output_name ${_input_name})
+    STRING(REPLACE "${_global_source_dir}" "" _output_dir ${_input_dir})
+    SET(_output_file "${_global_binary_dir}${_output_dir}/${_output_name}")
+
+    ## -- Configure file
+    CONFIGURE_FILE(${_input_file} ${_output_file} @ONLY)
+
+    ## -- Add it to the correct list
+    GET_FILENAME_COMPONENT(_output_ext ${_output_name} EXT)
+    IF(
+        "${_output_ext}" STREQUAL ".h"
+        OR
+        "${_output_ext}" STREQUAL ".hpp"
+        OR
+        "${_output_ext}" STREQUAL ".hxx"
+        )
+      SET(_headers ${_headers})
+    ENDIF()
+    IF(
+        "${_output_ext}" STREQUAL ".c"
+        OR
+        "${_output_ext}" STREQUAL ".cpp"
+        OR
+        "${_output_ext}" STREQUAL ".cxx"
+        )
+      SET(_sources ${_sources})
+    ENDIF()
+    IF("${_output_ext}" STREQUAL ".ui")
+      SET(_qt_uis ${_qt_uis})
+    ENDIF()
+  ENDFOREACH(_c)
+
+  # -- Prepare Qt4-based code
+  IF(Qt4_FOUND)
+
+    ## -- Guess what headers sould be qt-moc'ed
+    cpPlugins_Wrap_Qt_cpp(_qt_moc_sources ${_headers})
+    IF(_qt_moc_sources)
+      SET(_sources ${_sources} ${_qt_moc_sources})
+    ENDIF(_qt_moc_sources)
+
+    ## -- Guess what qt-ui's sould be qt-uic'ed
+    ## -- Wrap qt-ui headers: this is equivalent to QT4_WRAP_UI except to
+    ## -- change the output file
+    cpPlugins_Wrap_Qt_ui(_qt_ui_headers ${_qt_uis})
+    IF(_qt_ui_headers)
+      SET(_headers ${_headers} ${_qt_ui_headers})
+      SET(_sources ${_sources} ${_qt_ui_headers})
+    ENDIF(_qt_ui_headers)
+  ENDIF(Qt4_FOUND)
+
+  ## -- Ok, compile application
+  IF(_sources)
+    ADD_EXECUTABLE(${_app_name} ${_sources})
+    SET(${output_app} ${_app_name} PARENT_SCOPE)
+  ELSE(_sources)
+    MESSAGE(FATAL_ERROR "No source code found to build \"${_app_name}\"")
+  ENDIF(_sources)
+ENDIF(BUILD_${_app_name})
 
 ENDFUNCTION()
 
index 79b1d66a669573954639b7f8eeb4e5ecea28c285..3c8e0aee971168ce6c31523d631b40b913050e6c 100644 (file)
@@ -1,11 +1,4 @@
 
-## ======================
-## == Useful variables ==
-## ======================
-
-SET(_src "${CMAKE_CURRENT_SOURCE_DIR}")
-SET(_bin "${CMAKE_CURRENT_BINARY_DIR}")
-
 ## =====================
 ## == Build instances ==
 ## =====================
@@ -16,40 +9,22 @@ SUBDIRS(Instances)
 ## == Manage every directory as a library ==
 ## =========================================
 
-cpPlugins_CreateLibraryFromDirectory(
-  cpPlugins_tinyxml2 SHARED
-  ${_src}/tinyxml2 ${_bin}/tinyxml2
-  ${prj_VERSION} ${prj_SHORT_VERSION}
-  )
-
-cpPlugins_CreateLibraryFromDirectory(
- cpPlugins_Itk2Vtk SHARED
-  ${_src}/Itk2Vtk ${_bin}/Itk2Vtk
-  ${prj_VERSION} ${prj_SHORT_VERSION}
-  ${ITK_LIBRARIES} ${VTK_LIBRARIES}
-  )
+SET(_dir ${CMAKE_CURRENT_SOURCE_DIR})
+SET(_pfx cpPlugins)
+SET(_ver ${prj_VERSION} ${prj_SHORT_VERSION})
 
-cpPlugins_CreateLibraryFromDirectory(
-  cpExtensions SHARED
-  ${_src}/cpExtensions ${_bin}/cpExtensions
-  ${prj_VERSION} ${prj_SHORT_VERSION}
-  ${ITK_LIBRARIES} ${VTK_LIBRARIES} ${QT_LIBRARIES}
-  )
+cpPlugins_CreateLibraryFromDirectory(${_pfx}_tinyxml2 SHARED ${_dir}/tinyxml2 ${_ver})
+cpPlugins_CreateLibraryFromDirectory(cpExtensions SHARED ${_dir}/cpExtensions ${_ver})
+cpPlugins_CreateLibraryFromDirectory(cpPlugins SHARED ${_dir}/cpPlugins ${_ver})
+cpPlugins_CreateLibraryFromDirectory(cpBaseQtApplication SHARED ${_dir}/cpBaseQtApplication ${_ver})
 
-cpPlugins_CreateLibraryFromDirectory(
-  cpPlugins SHARED
-  ${_src}/cpPlugins ${_bin}/cpPlugins
-  ${prj_VERSION} ${prj_SHORT_VERSION}
-  ${cpPlugins_Instances}
-  ${cpPlugins_tinyxml2_LIB}
-  )
+## ========================
+## == Links to libraries ==
+## ========================
 
-cpPlugins_CreateLibraryFromDirectory(
-  cpBaseQtApplication SHARED
-  ${_src}/cpBaseQtApplication ${_bin}/cpBaseQtApplication
-  ${prj_VERSION} ${prj_SHORT_VERSION}
-  ${cpPlugins_LIB} ${cpExtensions_LIB}
-  )
+TARGET_LINK_LIBRARIES(cpExtensions ${ITK_LIBRARIES} ${VTK_LIBRARIES})
+TARGET_LINK_LIBRARIES(cpPlugins ${cpPlugins_Instances} ${cpPlugins_tinyxml2_LIB})
+TARGET_LINK_LIBRARIES(cpBaseQtApplication ${cpPlugins_LIB})
 
 ## ===================================
 ## == Libraries to dynamically load ==
index 957fc7e26eb0f42f8e8947b5a622ab5e707949bc..7fdb21474b53704660e5a1f7af280b6158880286 100644 (file)
@@ -4,57 +4,44 @@
 
 SET(pfx "cpPlugins_Instances_")
 SET(arg ${pfx} ${prj_VERSION} ${prj_SHORT_VERSION})
+SET(_all_instances)
 
-cpPlugins_WrapInstances(BaseObjects ${arg} ${ITK_LIBRARIES} ${VTK_LIBRARIES})
-cpPlugins_WrapInstances(Paths ${arg} ${pfx}BaseObjects)
-cpPlugins_WrapInstances(BaseImages ${arg} ${pfx}BaseObjects)
-cpPlugins_WrapInstances(Transforms ${arg} ${pfx}BaseObjects)
-cpPlugins_WrapInstances(ScalarImages ${arg} ${pfx}BaseImages)
-cpPlugins_WrapInstances(NeighborhoodIterators ${arg} ${pfx}ScalarImages)
-cpPlugins_WrapInstances(ColorImages ${arg} ${pfx}BaseImages)
-cpPlugins_WrapInstances(VectorImages ${arg} ${pfx}BaseImages)
-cpPlugins_WrapInstances(BaseImageFilters ${arg} ${pfx}ScalarImages ${pfx}ColorImages ${pfx}VectorImages)
-cpPlugins_WrapInstances(ImageReaders ${arg} ${pfx}BaseImageFilters)
-cpPlugins_WrapInstances(ImageWriters ${arg} ${pfx}BaseImageFilters)
-cpPlugins_WrapInstances(ScalarImagesFilters ${arg} ${pfx}BaseImageFilters)
-cpPlugins_WrapInstances(CastImageFilters ${arg} ${pfx}ScalarImagesFilters)
-cpPlugins_WrapInstances(BitwiseImageFilters ${arg} ${pfx}ScalarImagesFilters)
-cpPlugins_WrapInstances(ThresholdFilters ${arg} ${pfx}ScalarImagesFilters)
-cpPlugins_WrapInstances(DistanceMapFilters ${arg} ${pfx}ThresholdFilters ${pfx}NeighborhoodIterators)
-cpPlugins_WrapInstances(MorphologicalImageFilters ${arg} ${pfx}ScalarImagesFilters ${pfx}ThresholdFilters)
-cpPlugins_WrapInstances(GaussianImageFilters ${arg} ${cpExtensions_LIB} ${pfx}ScalarImagesFilters ${pfx}VectorImages)
-cpPlugins_WrapInstances(ExtractImageFilters ${arg} ${pfx}ScalarImagesFilters)
-cpPlugins_WrapInstances(ResamplingFilters ${arg} ${pfx}ScalarImagesFilters ${pfx}Transforms)
-cpPlugins_WrapInstances(Mesh ${arg} ${pfx}BaseObjects)
-cpPlugins_WrapInstances(ImageMeshFilters ${arg} ${pfx}ScalarImagesFilters ${pfx}Mesh)
-cpPlugins_WrapInstances(MedialnessFilters ${arg} ${pfx}ScalarImages ${pfx}VectorImages)
-
+FILE(GLOB _intances "${CMAKE_CURRENT_SOURCE_DIR}/*.i")
+FOREACH(_i ${_intances})
+  cpPlugins_WrapInstances(_instance ${_i} ${arg})
+  SET(_all_instances ${_all_instances} ${_instance})
+ENDFOREACH(_i)
 SET(
-  cpPlugins_Instances
-  ${pfx}BaseObjects
-  ${pfx}Paths
-  ${pfx}BaseImages
-  ${pfx}ScalarImages
-  ${pfx}NeighborhoodIterators
-  ${pfx}ColorImages
-  ${pfx}VectorImages
-  ${pfx}BaseImageFilters
-  ${pfx}ImageReaders
-  ${pfx}ImageWriters
-  ${pfx}ScalarImagesFilters
-  ${pfx}CastImageFilters
-  ${pfx}BitwiseImageFilters
-  ${pfx}MorphologicalImageFilters
-  ${pfx}ThresholdFilters
-  ${pfx}DistanceMapFilters
-  ${pfx}GaussianImageFilters
-  ${pfx}ExtractImageFilters
-  ${pfx}ResamplingFilters
-  ${pfx}Transforms
-  ${pfx}Mesh
-  ${pfx}ImageMeshFilters
-  ${pfx}MedialnessFilters
+  cpPlugins_Instances ${_all_instances}
   CACHE INTERNAL "All valid instances." FORCE
   )
 
+## ===============
+## == Link them ==
+## ===============
+
+TARGET_LINK_LIBRARIES(${pfx}BaseObjects ${ITK_LIBRARIES} ${VTK_LIBRARIES})
+TARGET_LINK_LIBRARIES(${pfx}BaseImages ${pfx}BaseObjects)
+TARGET_LINK_LIBRARIES(${pfx}Mesh ${pfx}BaseObjects)
+TARGET_LINK_LIBRARIES(${pfx}Paths ${pfx}BaseObjects)
+TARGET_LINK_LIBRARIES(${pfx}Transforms ${pfx}BaseObjects)
+TARGET_LINK_LIBRARIES(${pfx}ScalarImages ${pfx}BaseImages)
+TARGET_LINK_LIBRARIES(${pfx}ColorImages ${pfx}BaseImages)
+TARGET_LINK_LIBRARIES(${pfx}VectorImages ${pfx}BaseImages)
+TARGET_LINK_LIBRARIES(${pfx}MedialnessFilters ${pfx}ScalarImages ${pfx}VectorImages)
+TARGET_LINK_LIBRARIES(${pfx}NeighborhoodIterators ${pfx}ScalarImages)
+TARGET_LINK_LIBRARIES(${pfx}BaseImageFilters ${pfx}ScalarImages ${pfx}ColorImages ${pfx}VectorImages)
+TARGET_LINK_LIBRARIES(${pfx}ImageReaders ${pfx}BaseImageFilters)
+TARGET_LINK_LIBRARIES(${pfx}ImageWriters ${pfx}BaseImageFilters)
+TARGET_LINK_LIBRARIES(${pfx}ScalarImagesFilters ${pfx}BaseImageFilters)
+TARGET_LINK_LIBRARIES(${pfx}CastImageFilters ${pfx}ScalarImagesFilters)
+TARGET_LINK_LIBRARIES(${pfx}BitwiseImageFilters ${pfx}ScalarImagesFilters)
+TARGET_LINK_LIBRARIES(${pfx}ThresholdFilters ${pfx}ScalarImagesFilters)
+TARGET_LINK_LIBRARIES(${pfx}ExtractImageFilters ${pfx}ScalarImagesFilters)
+TARGET_LINK_LIBRARIES(${pfx}DistanceMapFilters ${pfx}ThresholdFilters ${pfx}NeighborhoodIterators)
+TARGET_LINK_LIBRARIES(${pfx}MorphologicalImageFilters ${pfx}ScalarImagesFilters ${pfx}ThresholdFilters)
+TARGET_LINK_LIBRARIES(${pfx}GaussianImageFilters ${cpExtensions_LIB} ${pfx}ScalarImagesFilters ${pfx}VectorImages)
+TARGET_LINK_LIBRARIES(${pfx}ResamplingFilters ${pfx}ScalarImagesFilters ${pfx}Transforms)
+TARGET_LINK_LIBRARIES(${pfx}ImageMeshFilters ${pfx}ScalarImagesFilters ${pfx}Mesh)
+
 ## eof - $RCSfile$
index a6caec54c547da66865e1cce6fb671a3188e1607..4372ef5d6d35ffe167d1fde0ac85848a14975ce1 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPBASEQTAPPLICATION__ACTORPROPERTIES__H__
 #define __CPBASEQTAPPLICATION__ACTORPROPERTIES__H__
 
-#include <cpBaseQtApplication/cpBaseQtApplication_Export.h>
+#include <cpBaseQtApplication_Export.h>
 #include <cpPlugins/Config.h>
 
 #include <set>
index 920adbb590c30f9929eda3c3ecb6f2eb2693a4e7..adac816e8506ab3f83c0b96fa89a9f3883555d29 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPBASEQTAPPLICATION__BLOCK__H__\r
 #define __CPBASEQTAPPLICATION__BLOCK__H__\r
 \r
-#include <cpBaseQtApplication/cpBaseQtApplication_Export.h>\r
+#include <cpBaseQtApplication_Export.h>\r
 #include <QGraphicsPathItem>\r
 #include <cpPlugins/ProcessObject.h>\r
 \r
index 3b63b5433d84a8cb64c288e6adb992bccb409b37..d32adb09fad6b1a4649d206309e8c3b2fdba690c 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPBASEQTAPPLICATION__CANVAS__H__
 #define __CPBASEQTAPPLICATION__CANVAS__H__
 
-#include <cpBaseQtApplication/cpBaseQtApplication_Export.h>
+#include <cpBaseQtApplication_Export.h>
 #include <QtGui/QGraphicsView>
 
 namespace cpBaseQtApplication
index 2a30d551140e04a23406a80ca77357e97dba5e85..b7849d70428e6eedb7129dcfef95b92f71ffb8c5 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPBASEQTAPPLICATION__CONNECTION__H__\r
 #define __CPBASEQTAPPLICATION__CONNECTION__H__\r
 \r
-#include <cpBaseQtApplication/cpBaseQtApplication_Export.h>\r
+#include <cpBaseQtApplication_Export.h>\r
 #include <QGraphicsPathItem>\r
 \r
 namespace cpBaseQtApplication\r
index 5e17673bbaf677e0ba6ec65d72ad12924b10aa0b..073de08f415e79a3c9ad332bf3f8710dcb16c11d 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPBASEQTAPPLICATION__EDITOR__H__\r
 #define __CPBASEQTAPPLICATION__EDITOR__H__\r
 \r
-#include <cpBaseQtApplication/cpBaseQtApplication_Export.h>\r
+#include <cpBaseQtApplication_Export.h>\r
 #include <cpExtensions/DataStructures/Graph.h>\r
 #include <cpPlugins/Workspace.h>\r
 #include <QObject>\r
index eca0a16511f4e970a44bab2650c8ad22624e937e..ca06a2167bd10cc91f8c0b6579b7a6704c388cc4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPBASEQTAPPLICATION__MAINWINDOW__H__
 #define __CPBASEQTAPPLICATION__MAINWINDOW__H__
 
-#include <cpBaseQtApplication/cpBaseQtApplication_Export.h>
+#include <cpBaseQtApplication_Export.h>
 #include <QMainWindow>
 #include <cpPlugins/Interface.h>
 #include <cpPlugins/Workspace.h>
index 72bdf904f85968f9f3c0a4d562bdaa92dc5bd665..1f6bda1289c84a196801648df445a238e7637451 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPBASEQTAPPLICATION__PORT__H__\r
 #define __CPBASEQTAPPLICATION__PORT__H__\r
 \r
-#include <cpBaseQtApplication/cpBaseQtApplication_Export.h>\r
+#include <cpBaseQtApplication_Export.h>\r
 #include <QGraphicsPathItem>\r
 \r
 namespace cpBaseQtApplication\r
index bd0c17a701a5505bbc7d93c43459ee916a44ae46..003962087b696126875ad45ebe0bbdae0ed6ab7e 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__
 #define __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__
 
-#include <cpExtensions/cpExtensions_Export.h>
+#include <cpExtensions/Config.h>
 
 #include <itkObject.h>
 #include <itkObjectFactory.h>
@@ -206,9 +206,7 @@ namespace cpExtensions
 
 } // ecapseman
 
-#ifndef ITK_MANUAL_INSTANTIATION
 #include <cpExtensions/Algorithms/KalmanFilter.hxx>
-#endif // ITK_MANUAL_INSTANTIATION
 
 #endif // __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__
 
index 01915bacbc5d723b0dc6546c2d4df24fd57bf69f..3f8c350e537961424ba743c39e8c4573ca0ed6b7 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPEXTENSIONS__CONFIG__H__
 #define __CPEXTENSIONS__CONFIG__H__
 
-#include <cpExtensions/cpExtensions_Export.h>
+#include <cpExtensions_Export.h>
 
 /*
  * =========================================================================
index 53b6242ddc47b050132446b31c0a44f8d07ec479..91c5b9319ec28ece30a1d3bd191bfe4ab69b784f 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINS__CONFIG__H__
 #define __CPPLUGINS__CONFIG__H__
 
-#include <cpPlugins/cpPlugins_Export.h>
+#include <cpPlugins_Export.h>
 #include <string>
 
 /*
index fec68ddc3eeecb0c5f148bafb890ad4194d1bc6f..2647cd60d57d04cc1a3d3e473153bf0dabd46a9d 100644 (file)
@@ -96,7 +96,7 @@ static const int TIXML2_MAJOR_VERSION = 3;
 static const int TIXML2_MINOR_VERSION = 0;\r
 static const int TIXML2_PATCH_VERSION = 0;\r
 \r
-#include <tinyxml2/cpPlugins_tinyxml2_Export.h>\r
+#include <cpPlugins_tinyxml2_Export.h>\r
 #undef TINYXML2_LIB\r
 #define TINYXML2_LIB cpPlugins_tinyxml2_EXPORT\r
 \r
index 967f6e0311c6722ca63d5bfe4c035410a5b6bac6..ccf20b33f954e5042cb575b579cd7c24d6f97428 100644 (file)
@@ -17,10 +17,13 @@ ENDFOREACH(_child)
 
 FOREACH(_dir ${_dirlist})
   cpPlugins_WrapPlugins(
-    ${_dir}
+    _plugin
+    ${_curdir}/${_dir}
     ${prj_VERSION} ${prj_SHORT_VERSION}
     cpPlugins
-    ${cpPlugins_LIB} ${cpExtensions_LIB} ${cpPlugins_Instances}
+    )
+  TARGET_LINK_LIBRARIES(
+    ${_plugin} ${cpPlugins_LIB} ${cpExtensions_LIB} ${cpPlugins_Instances}
     )
 ENDFOREACH(_dir)
 
index b2cf4c1edb6eee400d90087baac83b0007f731f4..ee705a84b0159c2cd4e277eb692a1e1e5ba9e6de 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSGENERICFILTERS__JOINBOUNDINGBOXES__H__
 #define __CPPLUGINSGENERICFILTERS__JOINBOUNDINGBOXES__H__
 
-#include <plugins/GenericFilters/cpPluginsGenericFilters_Export.h>
+#include <plugins/cpPluginsGenericFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsGenericFilters
index bae2979f7b0173867894cd2556b67142103051ea..6102ede5886efbb53a8e935d754c2536c5eaceb7 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIO__DATAREPRODUCER__H__
 #define __CPPLUGINSIO__DATAREPRODUCER__H__
 
-#include <plugins/IO/cpPluginsIO_Export.h>
+#include <plugins/cpPluginsIO_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsIO
index 6b2392a291a96c38c51eb8586e947ce168cc101a..0d20b47547672a2fd10f19bf9d3d67313d21b756 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIO__IMAGEREADER__H__
 #define __CPPLUGINSIO__IMAGEREADER__H__
 
-#include <plugins/IO/cpPluginsIO_Export.h>
+#include <plugins/cpPluginsIO_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace itk
index a5c0061dd8ad6fc97c31926670158d9a6a7cd5de..f2c2823a32ed8374738f4d3bcce789e553f6c0d1 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIO__IMAGEWRITER__H__
 #define __CPPLUGINSIO__IMAGEWRITER__H__
 
-#include <plugins/IO/cpPluginsIO_Export.h>
+#include <plugins/cpPluginsIO_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace itk
index b559435f992999961cb12c98e241beeb7805e883..5a0c4e14b6ba4a1a1cc1e9afd093f1565d828b5f 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__ANDIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__ANDIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 0a1c0d6e885c651213170133c3bea6759ff30459..ce9646b7955530998d98a163aba859e4dd4e68fb 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__BINARYCONTOURIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__BINARYCONTOURIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 2882ad44c3295a4d073fde15d8ee87d2be4de0b2..799d57b58aa42ebd3158572d92f30eb3cff5875d 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__BINARYDILATEPARAIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__BINARYDILATEPARAIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index b7d1e016d1d2139e9e962d38f93238baf3df2200..24e09fb9d371e17d17a8035c8321f739a0030ed3 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__BINARYERODEPARAIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__BINARYERODEPARAIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index f09fd2986fa96352475c237c2810abae0f87c43b..b710c57fe7a36c2a029dbd0f273d7682f6afa709 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__BINARYTHRESHOLDIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__BINARYTHRESHOLDIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index de1d87baa8ebb33d178bc3063cb48add3bd57dc7..003cb6806f016669e60020dd43eadcbada7857fd 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__CASTIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__CASTIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 51d94fd21b7c437babc2ec9753349037acff050e..9395737a31fdb16a2cbf210fe554c2905c43fb34 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__GAUSSIANDENSITYIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__GAUSSIANDENSITYIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 3ee659ec25483cb8182cb3ba5735300866d6e600..edd33c2c8ce7ea3354ff0aec78f3ce1cdc8bfe76 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__MULTISCALEGAUSSIANIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__MULTISCALEGAUSSIANIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 87965c37514b214d8c70719b4c3b5041d9476dfc..bdb8cff0dbf281a3b84079106cdd74a716a41739 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__ORIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__ORIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 3cd60f4ec45e7cf842f922dcad3f6ce5917f0c33..031cf80b12ffc6aac78734c11dfa87df57deb8e3 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__REGIONOFINTERESTIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__REGIONOFINTERESTIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 7dec07451912a8b23df6ef314c8e493845aace6e..5143d062256f7b2bfcb42cb457c0d33cd33c424b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__RESAMPLEIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__RESAMPLEIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index dea132ff1416fae9860e9ccf66d6d66519e00519..63a0c4e2bc5b515964e16ef2bddfc1f21776ca70 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__SIGNEDMAURERDISTANCEMAPIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__SIGNEDMAURERDISTANCEMAPIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 008d22e050b2bbd588beb45243f28dedc9123107..b53ec52c691c32992361e5fe5790d6b5c8dd80b5 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEFILTERS__UNARYTHRESHOLDIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEFILTERS__UNARYTHRESHOLDIMAGEFILTER__H__
 
-#include <plugins/ImageFilters/cpPluginsImageFilters_Export.h>
+#include <plugins/cpPluginsImageFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageFilters
index 5861bf3c24a3a093e451286928b0e387543fdf6a..da6f74487aaa8f7483693bb6c0ed4d934e2922d6 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEMESH__MARCHINGCUBES__H__
 #define __CPPLUGINSIMAGEMESH__MARCHINGCUBES__H__
 
-#include <plugins/ImageMeshFilters/cpPluginsImageMeshFilters_Export.h>
+#include <plugins/cpPluginsImageMeshFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageMeshFilters
index 48c47cefd412093c9ae1307db31d4aa24a1e318a..2109459feed39b1f47c514d4908baabae5696720 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEMESH__TRIANGLEMESHTOBINARYIMAGEFILTER__H__
 #define __CPPLUGINSIMAGEMESH__TRIANGLEMESHTOBINARYIMAGEFILTER__H__
 
-#include <plugins/ImageMeshFilters/cpPluginsImageMeshFilters_Export.h>
+#include <plugins/cpPluginsImageMeshFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsImageMeshFilters
index 084307e71d2fdd528dd765c38bdaec6b3daa5476..076b97b17e487dacaa176043010bda87fdca8161 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSMEDIALNESSFILTERS__GULSUNTEKMEDIALNESS__H__
 #define __CPPLUGINSMEDIALNESSFILTERS__GULSUNTEKMEDIALNESS__H__
 
-#include <plugins/MedialnessFilters/cpPluginsMedialnessFilters_Export.h>
+#include <plugins/cpPluginsMedialnessFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsMedialnessFilters
index 168229b6fa78840f0403fc93250169c3a2cbd098..5be746c2c57faa759a2c346a6811f25ec486f5ab 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSIMAGEMESH__APPENDMESHESFILTER__H__
 #define __CPPLUGINSIMAGEMESH__APPENDMESHESFILTER__H__
 
-#include <plugins/MeshFilters/cpPluginsMeshFilters_Export.h>
+#include <plugins/cpPluginsMeshFilters_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsMeshFilters
index d2d36c3f2f0f3605037fa0d57e2b9516e57804e3..f7092af09632d9e662bba2582fdcdba288dd3bc5 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSMESHSOURCES__CYLINDERSOURCE__H__
 #define __CPPLUGINSMESHSOURCES__CYLINDERSOURCE__H__
 
-#include <plugins/MeshSources/cpPluginsMeshSources_Export.h>
+#include <plugins/cpPluginsMeshSources_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsMeshSources
index f6d33819956aca4242461492beda20e7d8654cb9..71944fbcb9ab7b78426ec1ebdd352858a444931e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSMESHSOURCES__SPHERESOURCE__H__
 #define __CPPLUGINSMESHSOURCES__SPHERESOURCE__H__
 
-#include <plugins/MeshSources/cpPluginsMeshSources_Export.h>
+#include <plugins/cpPluginsMeshSources_Export.h>
 #include <cpPlugins/ProcessObject.h>
 
 namespace cpPluginsMeshSources
index 5c9e68a6b8dbe683daba1231afb2bbc97789e723..942936af8e8c82b30223ab621754d79cb5f79a3d 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPPLUGINSWIDGETS__SEEDWIDGET__H__
 #define __CPPLUGINSWIDGETS__SEEDWIDGET__H__
 
-#include <plugins/Widgets/cpPluginsWidgets_Export.h>
+#include <plugins/cpPluginsWidgets_Export.h>
 #include <cpPlugins/BaseWidget.h>
 
 #include <cpExtensions/Interaction/SeedWidget.h>