From 8ada00da37d8c4dc70b9387c1147566c62dbd41f Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Mon, 27 Jun 2016 16:15:38 -0500 Subject: [PATCH] Build procedure simplified --- CMakeLists.txt | 2 +- appli/PipelineEditor/CMakeLists.txt | 8 +- cmake/cpPlugins_Functions.cmake | 560 +++++++++++------- lib/CMakeLists.txt | 51 +- lib/Instances/CMakeLists.txt | 83 ++- lib/cpBaseQtApplication/ActorProperties.h | 2 +- lib/cpBaseQtApplication/Block.h | 2 +- lib/cpBaseQtApplication/Canvas.h | 2 +- lib/cpBaseQtApplication/Connection.h | 2 +- lib/cpBaseQtApplication/Editor.h | 2 +- lib/cpBaseQtApplication/MainWindow.h | 2 +- lib/cpBaseQtApplication/Port.h | 2 +- lib/cpExtensions/Algorithms/KalmanFilter.h | 4 +- lib/cpExtensions/Config.h.in | 2 +- lib/cpPlugins/Config.h.in | 2 +- lib/tinyxml2/tinyxml2.h | 2 +- plugins/CMakeLists.txt | 7 +- plugins/GenericFilters/JoinBoundingBoxes.h | 2 +- plugins/IO/DataReproducer.h | 2 +- plugins/IO/ImageReader.h | 2 +- plugins/IO/ImageWriter.h | 2 +- plugins/ImageFilters/AndImageFilter.h | 2 +- .../ImageFilters/BinaryContourImageFilter.h | 2 +- .../BinaryDilateParaImageFilter.h | 2 +- .../ImageFilters/BinaryErodeParaImageFilter.h | 2 +- .../ImageFilters/BinaryThresholdImageFilter.h | 2 +- plugins/ImageFilters/CastImageFilter.h | 2 +- .../ImageFilters/GaussianDensityImageFilter.h | 2 +- .../MultiScaleGaussianImageFilter.h | 2 +- plugins/ImageFilters/OrImageFilter.h | 2 +- .../RegionOfInterestImageFilter.h | 2 +- plugins/ImageFilters/ResampleImageFilter.h | 2 +- .../SignedMaurerDistanceMapImageFilter.h | 2 +- .../ImageFilters/UnaryThresholdImageFilter.h | 2 +- plugins/ImageMeshFilters/MarchingCubes.h | 2 +- .../TriangleMeshToBinaryImageFilter.h | 2 +- .../MedialnessFilters/GulsunTekMedialness.h | 2 +- plugins/MeshFilters/AppendMeshesFilter.h | 2 +- plugins/MeshSources/CylinderSource.h | 2 +- plugins/MeshSources/SphereSource.h | 2 +- plugins/Widgets/SeedWidget.h | 2 +- 41 files changed, 427 insertions(+), 356 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72a0e6c..28e32f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,6 @@ INCLUDE_DIRECTORIES( ## == Subdirs containing code == ## ============================= -SUBDIRS(cmake lib appli plugins) +SUBDIRS(appli cmake lib plugins) ## eof - $RCSfile$ diff --git a/appli/PipelineEditor/CMakeLists.txt b/appli/PipelineEditor/CMakeLists.txt index 2266e04..bfdb6f7 100644 --- a/appli/PipelineEditor/CMakeLists.txt +++ b/appli/PipelineEditor/CMakeLists.txt @@ -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) diff --git a/cmake/cpPlugins_Functions.cmake b/cmake/cpPlugins_Functions.cmake index 4337bd9..45d7552 100644 --- a/cmake/cpPlugins_Functions.cmake +++ b/cmake/cpPlugins_Functions.cmake @@ -1,102 +1,130 @@ +## ============================== +## == 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() diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 79b1d66..3c8e0ae 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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 == diff --git a/lib/Instances/CMakeLists.txt b/lib/Instances/CMakeLists.txt index 957fc7e..7fdb214 100644 --- a/lib/Instances/CMakeLists.txt +++ b/lib/Instances/CMakeLists.txt @@ -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$ diff --git a/lib/cpBaseQtApplication/ActorProperties.h b/lib/cpBaseQtApplication/ActorProperties.h index a6caec5..4372ef5 100644 --- a/lib/cpBaseQtApplication/ActorProperties.h +++ b/lib/cpBaseQtApplication/ActorProperties.h @@ -1,7 +1,7 @@ #ifndef __CPBASEQTAPPLICATION__ACTORPROPERTIES__H__ #define __CPBASEQTAPPLICATION__ACTORPROPERTIES__H__ -#include +#include #include #include diff --git a/lib/cpBaseQtApplication/Block.h b/lib/cpBaseQtApplication/Block.h index 920adbb..adac816 100644 --- a/lib/cpBaseQtApplication/Block.h +++ b/lib/cpBaseQtApplication/Block.h @@ -1,7 +1,7 @@ #ifndef __CPBASEQTAPPLICATION__BLOCK__H__ #define __CPBASEQTAPPLICATION__BLOCK__H__ -#include +#include #include #include diff --git a/lib/cpBaseQtApplication/Canvas.h b/lib/cpBaseQtApplication/Canvas.h index 3b63b54..d32adb0 100644 --- a/lib/cpBaseQtApplication/Canvas.h +++ b/lib/cpBaseQtApplication/Canvas.h @@ -1,7 +1,7 @@ #ifndef __CPBASEQTAPPLICATION__CANVAS__H__ #define __CPBASEQTAPPLICATION__CANVAS__H__ -#include +#include #include namespace cpBaseQtApplication diff --git a/lib/cpBaseQtApplication/Connection.h b/lib/cpBaseQtApplication/Connection.h index 2a30d55..b7849d7 100644 --- a/lib/cpBaseQtApplication/Connection.h +++ b/lib/cpBaseQtApplication/Connection.h @@ -1,7 +1,7 @@ #ifndef __CPBASEQTAPPLICATION__CONNECTION__H__ #define __CPBASEQTAPPLICATION__CONNECTION__H__ -#include +#include #include namespace cpBaseQtApplication diff --git a/lib/cpBaseQtApplication/Editor.h b/lib/cpBaseQtApplication/Editor.h index 5e17673..073de08 100644 --- a/lib/cpBaseQtApplication/Editor.h +++ b/lib/cpBaseQtApplication/Editor.h @@ -1,7 +1,7 @@ #ifndef __CPBASEQTAPPLICATION__EDITOR__H__ #define __CPBASEQTAPPLICATION__EDITOR__H__ -#include +#include #include #include #include diff --git a/lib/cpBaseQtApplication/MainWindow.h b/lib/cpBaseQtApplication/MainWindow.h index eca0a16..ca06a21 100644 --- a/lib/cpBaseQtApplication/MainWindow.h +++ b/lib/cpBaseQtApplication/MainWindow.h @@ -1,7 +1,7 @@ #ifndef __CPBASEQTAPPLICATION__MAINWINDOW__H__ #define __CPBASEQTAPPLICATION__MAINWINDOW__H__ -#include +#include #include #include #include diff --git a/lib/cpBaseQtApplication/Port.h b/lib/cpBaseQtApplication/Port.h index 72bdf90..1f6bda1 100644 --- a/lib/cpBaseQtApplication/Port.h +++ b/lib/cpBaseQtApplication/Port.h @@ -1,7 +1,7 @@ #ifndef __CPBASEQTAPPLICATION__PORT__H__ #define __CPBASEQTAPPLICATION__PORT__H__ -#include +#include #include namespace cpBaseQtApplication diff --git a/lib/cpExtensions/Algorithms/KalmanFilter.h b/lib/cpExtensions/Algorithms/KalmanFilter.h index bd0c17a..0039620 100644 --- a/lib/cpExtensions/Algorithms/KalmanFilter.h +++ b/lib/cpExtensions/Algorithms/KalmanFilter.h @@ -5,7 +5,7 @@ #ifndef __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__ #define __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__ -#include +#include #include #include @@ -206,9 +206,7 @@ namespace cpExtensions } // ecapseman -#ifndef ITK_MANUAL_INSTANTIATION #include -#endif // ITK_MANUAL_INSTANTIATION #endif // __CPEXTENSIONS__ALGORITHMS__KALMANFILTER__H__ diff --git a/lib/cpExtensions/Config.h.in b/lib/cpExtensions/Config.h.in index 01915ba..3f8c350 100644 --- a/lib/cpExtensions/Config.h.in +++ b/lib/cpExtensions/Config.h.in @@ -1,7 +1,7 @@ #ifndef __CPEXTENSIONS__CONFIG__H__ #define __CPEXTENSIONS__CONFIG__H__ -#include +#include /* * ========================================================================= diff --git a/lib/cpPlugins/Config.h.in b/lib/cpPlugins/Config.h.in index 53b6242..91c5b93 100644 --- a/lib/cpPlugins/Config.h.in +++ b/lib/cpPlugins/Config.h.in @@ -1,7 +1,7 @@ #ifndef __CPPLUGINS__CONFIG__H__ #define __CPPLUGINS__CONFIG__H__ -#include +#include #include /* diff --git a/lib/tinyxml2/tinyxml2.h b/lib/tinyxml2/tinyxml2.h index fec68dd..2647cd6 100644 --- a/lib/tinyxml2/tinyxml2.h +++ b/lib/tinyxml2/tinyxml2.h @@ -96,7 +96,7 @@ static const int TIXML2_MAJOR_VERSION = 3; static const int TIXML2_MINOR_VERSION = 0; static const int TIXML2_PATCH_VERSION = 0; -#include +#include #undef TINYXML2_LIB #define TINYXML2_LIB cpPlugins_tinyxml2_EXPORT diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 967f6e0..ccf20b3 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -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) diff --git a/plugins/GenericFilters/JoinBoundingBoxes.h b/plugins/GenericFilters/JoinBoundingBoxes.h index b2cf4c1..ee705a8 100644 --- a/plugins/GenericFilters/JoinBoundingBoxes.h +++ b/plugins/GenericFilters/JoinBoundingBoxes.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSGENERICFILTERS__JOINBOUNDINGBOXES__H__ #define __CPPLUGINSGENERICFILTERS__JOINBOUNDINGBOXES__H__ -#include +#include #include namespace cpPluginsGenericFilters diff --git a/plugins/IO/DataReproducer.h b/plugins/IO/DataReproducer.h index bae2979..6102ede 100644 --- a/plugins/IO/DataReproducer.h +++ b/plugins/IO/DataReproducer.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIO__DATAREPRODUCER__H__ #define __CPPLUGINSIO__DATAREPRODUCER__H__ -#include +#include #include namespace cpPluginsIO diff --git a/plugins/IO/ImageReader.h b/plugins/IO/ImageReader.h index 6b2392a..0d20b47 100644 --- a/plugins/IO/ImageReader.h +++ b/plugins/IO/ImageReader.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIO__IMAGEREADER__H__ #define __CPPLUGINSIO__IMAGEREADER__H__ -#include +#include #include namespace itk diff --git a/plugins/IO/ImageWriter.h b/plugins/IO/ImageWriter.h index a5c0061..f2c2823 100644 --- a/plugins/IO/ImageWriter.h +++ b/plugins/IO/ImageWriter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIO__IMAGEWRITER__H__ #define __CPPLUGINSIO__IMAGEWRITER__H__ -#include +#include #include namespace itk diff --git a/plugins/ImageFilters/AndImageFilter.h b/plugins/ImageFilters/AndImageFilter.h index b559435..5a0c4e1 100644 --- a/plugins/ImageFilters/AndImageFilter.h +++ b/plugins/ImageFilters/AndImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__ANDIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__ANDIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/BinaryContourImageFilter.h b/plugins/ImageFilters/BinaryContourImageFilter.h index 0a1c0d6..ce9646b 100644 --- a/plugins/ImageFilters/BinaryContourImageFilter.h +++ b/plugins/ImageFilters/BinaryContourImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__BINARYCONTOURIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__BINARYCONTOURIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/BinaryDilateParaImageFilter.h b/plugins/ImageFilters/BinaryDilateParaImageFilter.h index 2882ad4..799d57b 100644 --- a/plugins/ImageFilters/BinaryDilateParaImageFilter.h +++ b/plugins/ImageFilters/BinaryDilateParaImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__BINARYDILATEPARAIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__BINARYDILATEPARAIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/BinaryErodeParaImageFilter.h b/plugins/ImageFilters/BinaryErodeParaImageFilter.h index b7d1e01..24e09fb 100644 --- a/plugins/ImageFilters/BinaryErodeParaImageFilter.h +++ b/plugins/ImageFilters/BinaryErodeParaImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__BINARYERODEPARAIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__BINARYERODEPARAIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/BinaryThresholdImageFilter.h b/plugins/ImageFilters/BinaryThresholdImageFilter.h index f09fd29..b710c57 100644 --- a/plugins/ImageFilters/BinaryThresholdImageFilter.h +++ b/plugins/ImageFilters/BinaryThresholdImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__BINARYTHRESHOLDIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__BINARYTHRESHOLDIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/CastImageFilter.h b/plugins/ImageFilters/CastImageFilter.h index de1d87b..003cb68 100644 --- a/plugins/ImageFilters/CastImageFilter.h +++ b/plugins/ImageFilters/CastImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__CASTIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__CASTIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/GaussianDensityImageFilter.h b/plugins/ImageFilters/GaussianDensityImageFilter.h index 51d94fd..9395737 100644 --- a/plugins/ImageFilters/GaussianDensityImageFilter.h +++ b/plugins/ImageFilters/GaussianDensityImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__GAUSSIANDENSITYIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__GAUSSIANDENSITYIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/MultiScaleGaussianImageFilter.h b/plugins/ImageFilters/MultiScaleGaussianImageFilter.h index 3ee659e..edd33c2 100644 --- a/plugins/ImageFilters/MultiScaleGaussianImageFilter.h +++ b/plugins/ImageFilters/MultiScaleGaussianImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__MULTISCALEGAUSSIANIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__MULTISCALEGAUSSIANIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/OrImageFilter.h b/plugins/ImageFilters/OrImageFilter.h index 87965c3..bdb8cff 100644 --- a/plugins/ImageFilters/OrImageFilter.h +++ b/plugins/ImageFilters/OrImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__ORIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__ORIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/RegionOfInterestImageFilter.h b/plugins/ImageFilters/RegionOfInterestImageFilter.h index 3cd60f4..031cf80 100644 --- a/plugins/ImageFilters/RegionOfInterestImageFilter.h +++ b/plugins/ImageFilters/RegionOfInterestImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__REGIONOFINTERESTIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__REGIONOFINTERESTIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/ResampleImageFilter.h b/plugins/ImageFilters/ResampleImageFilter.h index 7dec074..5143d06 100644 --- a/plugins/ImageFilters/ResampleImageFilter.h +++ b/plugins/ImageFilters/ResampleImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__RESAMPLEIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__RESAMPLEIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/SignedMaurerDistanceMapImageFilter.h b/plugins/ImageFilters/SignedMaurerDistanceMapImageFilter.h index dea132f..63a0c4e 100644 --- a/plugins/ImageFilters/SignedMaurerDistanceMapImageFilter.h +++ b/plugins/ImageFilters/SignedMaurerDistanceMapImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__SIGNEDMAURERDISTANCEMAPIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__SIGNEDMAURERDISTANCEMAPIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageFilters/UnaryThresholdImageFilter.h b/plugins/ImageFilters/UnaryThresholdImageFilter.h index 008d22e..b53ec52 100644 --- a/plugins/ImageFilters/UnaryThresholdImageFilter.h +++ b/plugins/ImageFilters/UnaryThresholdImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEFILTERS__UNARYTHRESHOLDIMAGEFILTER__H__ #define __CPPLUGINSIMAGEFILTERS__UNARYTHRESHOLDIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageFilters diff --git a/plugins/ImageMeshFilters/MarchingCubes.h b/plugins/ImageMeshFilters/MarchingCubes.h index 5861bf3..da6f744 100644 --- a/plugins/ImageMeshFilters/MarchingCubes.h +++ b/plugins/ImageMeshFilters/MarchingCubes.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEMESH__MARCHINGCUBES__H__ #define __CPPLUGINSIMAGEMESH__MARCHINGCUBES__H__ -#include +#include #include namespace cpPluginsImageMeshFilters diff --git a/plugins/ImageMeshFilters/TriangleMeshToBinaryImageFilter.h b/plugins/ImageMeshFilters/TriangleMeshToBinaryImageFilter.h index 48c47ce..2109459 100644 --- a/plugins/ImageMeshFilters/TriangleMeshToBinaryImageFilter.h +++ b/plugins/ImageMeshFilters/TriangleMeshToBinaryImageFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEMESH__TRIANGLEMESHTOBINARYIMAGEFILTER__H__ #define __CPPLUGINSIMAGEMESH__TRIANGLEMESHTOBINARYIMAGEFILTER__H__ -#include +#include #include namespace cpPluginsImageMeshFilters diff --git a/plugins/MedialnessFilters/GulsunTekMedialness.h b/plugins/MedialnessFilters/GulsunTekMedialness.h index 084307e..076b97b 100644 --- a/plugins/MedialnessFilters/GulsunTekMedialness.h +++ b/plugins/MedialnessFilters/GulsunTekMedialness.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSMEDIALNESSFILTERS__GULSUNTEKMEDIALNESS__H__ #define __CPPLUGINSMEDIALNESSFILTERS__GULSUNTEKMEDIALNESS__H__ -#include +#include #include namespace cpPluginsMedialnessFilters diff --git a/plugins/MeshFilters/AppendMeshesFilter.h b/plugins/MeshFilters/AppendMeshesFilter.h index 168229b..5be746c 100644 --- a/plugins/MeshFilters/AppendMeshesFilter.h +++ b/plugins/MeshFilters/AppendMeshesFilter.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSIMAGEMESH__APPENDMESHESFILTER__H__ #define __CPPLUGINSIMAGEMESH__APPENDMESHESFILTER__H__ -#include +#include #include namespace cpPluginsMeshFilters diff --git a/plugins/MeshSources/CylinderSource.h b/plugins/MeshSources/CylinderSource.h index d2d36c3..f7092af 100644 --- a/plugins/MeshSources/CylinderSource.h +++ b/plugins/MeshSources/CylinderSource.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSMESHSOURCES__CYLINDERSOURCE__H__ #define __CPPLUGINSMESHSOURCES__CYLINDERSOURCE__H__ -#include +#include #include namespace cpPluginsMeshSources diff --git a/plugins/MeshSources/SphereSource.h b/plugins/MeshSources/SphereSource.h index f6d3381..71944fb 100644 --- a/plugins/MeshSources/SphereSource.h +++ b/plugins/MeshSources/SphereSource.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSMESHSOURCES__SPHERESOURCE__H__ #define __CPPLUGINSMESHSOURCES__SPHERESOURCE__H__ -#include +#include #include namespace cpPluginsMeshSources diff --git a/plugins/Widgets/SeedWidget.h b/plugins/Widgets/SeedWidget.h index 5c9e68a..942936a 100644 --- a/plugins/Widgets/SeedWidget.h +++ b/plugins/Widgets/SeedWidget.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINSWIDGETS__SEEDWIDGET__H__ #define __CPPLUGINSWIDGETS__SEEDWIDGET__H__ -#include +#include #include #include -- 2.45.1