]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Sun, 10 Apr 2016 23:06:50 +0000 (18:06 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Sun, 10 Apr 2016 23:06:50 +0000 (18:06 -0500)
CMakeLists.txt
appli/bash/CMakeLists.txt
cmake/cpPlugins_Functions.cmake [new file with mode: 0644]
lib/cpPlugins_Instances/CMakeLists.txt
plugins/cpPluginsIO/CMakeLists.txt
plugins/cpPluginsImageFilters/CMakeLists.txt
plugins/cpPluginsImageMeshFilters/CMakeLists.txt
plugins/cpPluginsMeshFilters/CMakeLists.txt
plugins/cpPluginsWidgets/CMakeLists.txt

index 7a6b789897cf756c5f3b962d3cf7a497c457011e..89eb42a73d848eff1b6ac046547269a04ba41447 100644 (file)
@@ -1,5 +1,6 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 INCLUDE(cmake/cpPlugins_Policies.cmake)
+INCLUDE(cmake/cpPlugins_Functions.cmake)
 
 ## ==================
 ## == Project name ==
index a4988506ca4edcbaa6dd691c540b5a94c8b0941a..221ab370f26dfad48dcc1a1aff65ffe19d914182 100644 (file)
@@ -23,14 +23,4 @@ FOREACH(source ${all_SOURCE_CXX_FILES})
     )
 ENDFOREACH(source)
 
-## =============================
-## == Create global variables ==
-## =============================
-
-SET(
-  cpPluginsInstances_APP
-  ${PROJECT_BINARY_DIR}/cpPlugins_CreateInstances
-  CACHE INTERNAL "Target location"
-  )
-
 ## eof - $RCSfile$
diff --git a/cmake/cpPlugins_Functions.cmake b/cmake/cpPlugins_Functions.cmake
new file mode 100644 (file)
index 0000000..ca9644e
--- /dev/null
@@ -0,0 +1,60 @@
+
+## -------------------------------------------------------------------------
+FUNCTION(cpPlugins_WrapInstances instances libprefix ver sver)
+GET_FILENAME_COMPONENT(name ${instances} NAME_WE)
+SET(i_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${name}.i")
+SET(h_FILE "${CMAKE_CURRENT_BINARY_DIR}/${name}.h")
+SET(s_FILE "${CMAKE_CURRENT_BINARY_DIR}/${name}.cxx")
+SET(e_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${name}_extra.cxx")
+SET(l_NAME "${libprefix}${name}")
+SET(x_FILE "${CMAKE_CURRENT_BINARY_DIR}/${l_NAME}_Export.h")
+ADD_CUSTOM_COMMAND(
+  OUTPUT ${h_FILE} ${s_FILE}
+  DEPENDS cpPlugins_CreateInstances ${i_FILE}
+  COMMAND cpPlugins_CreateInstances ${i_FILE} ${l_NAME} ${h_FILE} ${s_FILE}
+  )
+IF(EXISTS ${e_FILE})
+  ADD_LIBRARY(${l_NAME} SHARED ${s_FILE} ${e_FILE})
+ELSE(EXISTS ${e_FILE})
+  ADD_LIBRARY(${l_NAME} SHARED ${s_FILE})
+ENDIF(EXISTS ${e_FILE})
+SET_TARGET_PROPERTIES(
+  ${l_NAME} PROPERTIES
+  VERSION "${ver}"
+  SOVERSION "${sver}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${l_NAME}
+  BASE_NAME ${l_NAME}
+  EXPORT_MACRO_NAME ${l_NAME}_EXPORT
+  EXPORT_FILE_NAME ${x_FILE}
+  STATIC_DEFINE ${l_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(${l_NAME} ${ARGN})
+ENDFUNCTION()
+
+## -------------------------------------------------------------------------
+FUNCTION(cpPlugins_WrapPlugins libname ver sver headers sources other_sources qtheaders)
+SET(host ${CMAKE_CURRENT_BINARY_DIR}/${libname}_Host.cxx)
+ADD_CUSTOM_COMMAND(
+  OUTPUT ${host}
+  DEPENDS cpPlugins_HostCreator ${headers}
+  COMMAND cpPlugins_HostCreator ${host} ${headers}
+  )
+ADD_LIBRARY(${libname} SHARED ${host} ${sources} ${other_sources})
+SET_TARGET_PROPERTIES(
+  ${libname} PROPERTIES
+  VERSION "${ver}"
+  SOVERSION "${sver}"
+  )
+GENERATE_EXPORT_HEADER(
+  ${libname}
+  BASE_NAME ${libname}
+  EXPORT_MACRO_NAME ${libname}_EXPORT
+  EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/${libname}_Export.h
+  STATIC_DEFINE ${libname}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(${libname} ${ARGN})
+ENDFUNCTION()
+
+## eof - $RCSfile$
index 8042a986664f07e8b9d45a56680011656867768e..cfba0f783df3ca135d3a9babd56d8484be733a81 100644 (file)
@@ -1,72 +1,62 @@
-## ============================
-## == Configure source files ==
-## ============================
-
-FILE(
-  GLOB all_INSTANCES_FILES RELATIVE
-  "${CMAKE_CURRENT_SOURCE_DIR}"
-  "${CMAKE_CURRENT_SOURCE_DIR}/*.i"
-  )
-
 ## =================================
 ## == Compile instances libraries ==
 ## =================================
-SET(all_INSTANCES_LIBS "")
-FOREACH(libID ${all_INSTANCES_FILES})
-  GET_FILENAME_COMPONENT(name ${libID} NAME_WE)
-  SET(instances "${CMAKE_CURRENT_SOURCE_DIR}/${name}.i")
-  SET(header "${CMAKE_CURRENT_BINARY_DIR}/${name}.h")
-  SET(source "${CMAKE_CURRENT_BINARY_DIR}/${name}.cxx")
-  SET(extra "${CMAKE_CURRENT_SOURCE_DIR}/${name}_extra.cxx")
-  SET(libname cpPlugins_Instances_${name})
-  ADD_CUSTOM_COMMAND(
-    OUTPUT ${header} ${source}
-    DEPENDS "${cpPluginsInstances_APP}" ${instances}
-    COMMAND "${cpPluginsInstances_APP}" ${instances} ${libname} ${header} ${source}
-    )
-  IF(EXISTS ${extra})
-    ADD_LIBRARY(${libname} SHARED ${source} ${extra})
-  ELSE(EXISTS ${extra})
-    ADD_LIBRARY(${libname} SHARED ${source})
-  ENDIF(EXISTS ${extra})
-  SET_TARGET_PROPERTIES(
-    ${libname} PROPERTIES
-    VERSION "${prj_VER}"
-    SOVERSION "${prj_sVER}"
-    )
-  GENERATE_EXPORT_HEADER(
-    ${libname}
-    BASE_NAME ${libname}
-    EXPORT_MACRO_NAME ${libname}_EXPORT
-    EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/${libname}_Export.h
-    STATIC_DEFINE ${libname}_BUILT_AS_STATIC
-    )
-  SET(all_INSTANCES_LIBS "${all_INSTANCES_LIBS};${libname}")
-ENDFOREACH(libID)
-SET(cpPlugins_LIBRARIES ${all_INSTANCES_LIBS} CACHE INTERNAL "All libraries" FORCE)
 
-## =============
-## == Linking ==
-## =============
+SET(pfx "cpPlugins_Instances_")
+SET(arg ${pfx} ${prj_VER} ${prj_sVER})
 
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_BaseObjects ${ITK_LIBRARIES})
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_Decorators ${ITK_LIBRARIES})
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ColorPixels cpPlugins_Instances_BaseObjects)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ScalarImages cpPlugins_Instances_BaseObjects)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ColorImages cpPlugins_Instances_ColorPixels cpPlugins_Instances_ScalarImages)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_VectorImages cpPlugins_Instances_ColorPixels cpPlugins_Instances_ScalarImages)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_ScalarImages)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ImagesIO cpPlugins_Instances_ScalarImages cpPlugins_Instances_ColorImages cpPlugins_Instances_VectorImages cpPlugins_Instances_Decorators)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ImageITK2VTK cpPlugins_Instances_ScalarImages cpPlugins_Instances_ColorImages cpPlugins_Instances_VectorImages ${VTK_LIBRARIES})
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_Paths cpPlugins_Instances_ScalarImages ${VTK_LIBRARIES})
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_Mesh cpPlugins_Instances_BaseObjects)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_Transforms cpPlugins_Instances_BaseObjects)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ScalarVectorImagesBaseFilters cpPlugins_Instances_ScalarImages cpPlugins_Instances_VectorImages)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_GaussianImageFilters cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_ScalarVectorImagesBaseFilters)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ThresholdFilters cpPlugins_Instances_ScalarImagesBaseFilters)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ResamplingFilters cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_Transforms)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_ImageMeshFilters cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_Mesh)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_NeighborhoodIterators cpPlugins_Instances_ScalarImages)
-TARGET_LINK_LIBRARIES(cpPlugins_Instances_DistanceMapFilters cpPlugins_Instances_ScalarImagesBaseFilters cpPlugins_Instances_NeighborhoodIterators cpPlugins_Instances_ThresholdFilters)
+cpPlugins_WrapInstances(BaseObjects ${arg} ${ITK_LIBRARIES})
+cpPlugins_WrapInstances(Decorators ${arg} ${ITK_LIBRARIES})
+cpPlugins_WrapInstances(Mesh ${arg} ${pfx}BaseObjects)
+cpPlugins_WrapInstances(Transforms ${arg} ${pfx}BaseObjects)
+cpPlugins_WrapInstances(ColorPixels ${arg} ${pfx}BaseObjects)
+cpPlugins_WrapInstances(ScalarImages ${arg} ${pfx}BaseObjects)
+cpPlugins_WrapInstances(ColorImages ${arg} ${pfx}ColorPixels ${pfx}ScalarImages)
+cpPlugins_WrapInstances(VectorImages ${arg} ${pfx}ScalarImages)
+cpPlugins_WrapInstances(Paths ${arg} ${pfx}ScalarImages ${VTK_LIBRARIES})
+cpPlugins_WrapInstances(NeighborhoodIterators ${arg} ${pfx}ScalarImages)
+cpPlugins_WrapInstances(
+  ImageITK2VTK ${arg} ${pfx}ScalarImages ${pfx}ColorImages ${pfx}VectorImages ${VTK_LIBRARIES}
+  )
+cpPlugins_WrapInstances(
+  ImagesIO ${arg} ${pfx}ScalarImages ${pfx}ColorImages ${pfx}VectorImages ${pfx}Decorators
+  )
+cpPlugins_WrapInstances(ScalarImagesBaseFilters ${arg} ${pfx}ScalarImages)
+cpPlugins_WrapInstances(ScalarVectorImagesBaseFilters ${arg} ${pfx}ScalarImages ${pfx}VectorImages)
+cpPlugins_WrapInstances(ThresholdFilters ${arg} ${pfx}ScalarImagesBaseFilters)
+cpPlugins_WrapInstances(ImageMeshFilters ${arg} ${pfx}ScalarImagesBaseFilters ${pfx}Mesh)
+cpPlugins_WrapInstances(ResamplingFilters ${arg} ${pfx}ScalarImagesBaseFilters ${pfx}Transforms)
+cpPlugins_WrapInstances(
+  DistanceMapFilters ${arg}
+  ${pfx}ScalarImagesBaseFilters ${pfx}NeighborhoodIterators ${pfx}ThresholdFilters
+  )
+cpPlugins_WrapInstances(
+  GaussianImageFilters ${arg}
+  ${pfx}ScalarImagesBaseFilters ${pfx}ScalarVectorImagesBaseFilters
+  )
+
+SET(
+  cpPlugins_LIBRARIES
+  ${pfx}BaseObjects
+  ${pfx}Decorators
+  ${pfx}Mesh
+  ${pfx}Transforms
+  ${pfx}ColorPixels
+  ${pfx}ScalarImages
+  ${pfx}ColorImages
+  ${pfx}VectorImages
+  ${pfx}Paths
+  ${pfx}NeighborhoodIterators
+  ${pfx}ImageITK2VTK
+  ${pfx}ImagesIO
+  ${pfx}ScalarImagesBaseFilters
+  ${pfx}ScalarVectorImagesBaseFilters
+  ${pfx}ThresholdFilters
+  ${pfx}ImageMeshFilters
+  ${pfx}ResamplingFilters
+  ${pfx}DistanceMapFilters
+  ${pfx}GaussianImageFilters
+  CACHE INTERNAL "All valid instances." FORCE
+  )
 
 ## eof - $RCSfile$
index 6d46d0361c99e9e4825f384fba4e4519a0d4787a..cf0ac1c0f2418da534ec55bcc2974e515fa53237 100644 (file)
@@ -1,79 +1,27 @@
 SET(lib_NAME cpPluginsIO)
-SET(lib_DIR  cpPluginsIO)
+FILE(GLOB lib_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+FILE(GLOB lib_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx")
+SET(lib_OTHER_SOURCES "")
+SET(lib_QT4_HEADERS "")
 
-## ===============
-## = Source code =
-## ===============
-
-FILE(GLOB lib_HEADERS_H   "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
-FILE(GLOB lib_HEADERS_HPP "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
-FILE(GLOB lib_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
-FILE(GLOB lib_SOURCES_C   "${CMAKE_CURRENT_SOURCE_DIR}/*.c")
-FILE(GLOB lib_SOURCES_CPP "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
-FILE(GLOB lib_SOURCES_CXX "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx")
-
-# ===================================
-# = Integrate all source file names =
-# ===================================
-
-SET(
-  lib_HOST
-  ${CMAKE_CURRENT_BINARY_DIR}/${lib_NAME}_Host.cxx
-  )
-
-SET(
-  lib_HEADERS
-  ${lib_HEADERS_H}
-  ${lib_HEADERS_HPP}
-  ${lib_HEADERS_HXX}
-  )
-
-SET(
-  lib_SOURCES
-  ${lib_SOURCES_C}
-  ${lib_SOURCES_CPP}
-  ${lib_SOURCES_CXX}
+cpPlugins_WrapPlugins(
+  ${lib_NAME} ${prj_VER} ${prj_sVER}
+  "${lib_HEADERS}"
+  "${lib_SOURCES}"
+  "${lib_OTHER_SOURCES}"
+  "${lib_QT4_HEADERS}"
+  cpPlugins ${cpPlugins_LIBRARIES}
   )
 
-SET(
-  target_LIBRARIES
-  cpPlugins
-  ${cpPlugins_LIBRARIES}
-  )
-
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${lib_HOST}
-  DEPENDS cpPlugins_HostCreator ${LIB_HEADERS_H}
-  COMMAND cpPlugins_HostCreator ${lib_HOST} ${lib_HEADERS_H}
-  )
-ADD_LIBRARY(${lib_NAME} SHARED ${lib_HOST} ${lib_SOURCES})
-SET_TARGET_PROPERTIES(
-  ${lib_NAME} PROPERTIES
-  VERSION "${prj_VER}"
-  SOVERSION "${prj_sVER}"
-  )
-GENERATE_EXPORT_HEADER(
-  ${lib_NAME}
-  BASE_NAME ${lib_NAME}
-  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
-  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
-  )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
-
 ## ========================
 ## -- Installation rules --
 ## ========================
 
-INSTALL(
-  TARGETS ${lib_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
+#INSTALL(
+#  TARGETS ${lib_NAME}
+#  RUNTIME DESTINATION bin
+#  LIBRARY DESTINATION lib
+#  ARCHIVE DESTINATION lib/static
+#  )
 
 ## eof - $RCSfile$
index 029f273043aa29b433c1cbfc1bdb2583db32a9c9..fa550da30d8f83547f5b20c4b719ddb5c711442b 100644 (file)
@@ -1,74 +1,27 @@
 SET(lib_NAME cpPluginsImageFilters)
-SET(lib_DIR  cpPluginsImageFilters)
-
-## ===============
-## = Source code =
-## ===============
-
-FILE(GLOB lib_HEADERS_H   "*.h")
-FILE(GLOB lib_HEADERS_HPP "*.hpp")
-FILE(GLOB lib_HEADERS_HXX "*.hxx")
-FILE(GLOB lib_SOURCES_C   "*.c")
-FILE(GLOB lib_SOURCES_CPP "*.cpp")
-FILE(GLOB lib_SOURCES_CXX "*.cxx")
-
-# ===================================
-# = Integrate all source file names =
-# ===================================
-
-SET(
-  lib_HEADERS
-  ${lib_HEADERS_H}
-  ${lib_HEADERS_HPP}
-  ${lib_HEADERS_HXX}
-  )
-
-SET(
-  lib_SOURCES
-  ${lib_SOURCES_C}
-  ${lib_SOURCES_CPP}
-  ${lib_SOURCES_CXX}
-  )
-
-SET(
-  target_LIBRARIES
-  cpPlugins
-  ${cpPlugins_LIBRARIES}
+FILE(GLOB lib_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+FILE(GLOB lib_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx")
+SET(lib_OTHER_SOURCES "")
+SET(lib_QT4_HEADERS "")
+
+cpPlugins_WrapPlugins(
+  ${lib_NAME} ${prj_VER} ${prj_sVER}
+  "${lib_HEADERS}"
+  "${lib_SOURCES}"
+  "${lib_OTHER_SOURCES}"
+  "${lib_QT4_HEADERS}"
+  cpPlugins ${cpPlugins_LIBRARIES}
   )
 
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${lib_NAME}_Host.cxx
-  DEPENDS cpPlugins_HostCreator ${lib_HEADERS_H}
-  COMMAND cpPlugins_HostCreator ${lib_NAME}_Host.cxx ${lib_HEADERS_H}
-  )
-ADD_LIBRARY(${lib_NAME} SHARED ${lib_NAME}_Host.cxx ${lib_SOURCES})
-SET_TARGET_PROPERTIES(
-  ${lib_NAME} PROPERTIES
-  VERSION "${prj_VER}"
-  SOVERSION "${prj_sVER}"
-  )
-GENERATE_EXPORT_HEADER(
-  ${lib_NAME}
-  BASE_NAME ${lib_NAME}
-  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
-  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
-  )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
-
 ## ========================
 ## -- Installation rules --
 ## ========================
 
-INSTALL(
-  TARGETS ${lib_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
+#INSTALL(
+#  TARGETS ${lib_NAME}
+#  RUNTIME DESTINATION bin
+#  LIBRARY DESTINATION lib
+#  ARCHIVE DESTINATION lib/static
+#  )
 
 ## eof - $RCSfile$
index af1b4769d8834bf66558348750a8f9752c944840..9ad287ae87280ac0065e41871aba9ae85995fb8c 100644 (file)
@@ -1,75 +1,27 @@
 SET(lib_NAME cpPluginsImageMeshFilters)
-SET(lib_DIR  cpPluginsImageMeshFilters)
-
-## ===============
-## = Source code =
-## ===============
-
-FILE(GLOB lib_HEADERS_H   "*.h")
-FILE(GLOB lib_HEADERS_HPP "*.hpp")
-FILE(GLOB lib_HEADERS_HXX "*.hxx")
-FILE(GLOB lib_SOURCES_C   "*.c")
-FILE(GLOB lib_SOURCES_CPP "*.cpp")
-FILE(GLOB lib_SOURCES_CXX "*.cxx")
-
-# ===================================
-# = Integrate all source file names =
-# ===================================
-
-SET(
-  lib_HEADERS
-  ${lib_HEADERS_H}
-  ${lib_HEADERS_HPP}
-  ${lib_HEADERS_HXX}
-  )
-
-SET(
-  lib_SOURCES
-  ${lib_SOURCES_C}
-  ${lib_SOURCES_CPP}
-  ${lib_SOURCES_CXX}
-  )
-
-SET(
-  target_LIBRARIES
-  cpExtensions
-  cpPlugins
-  ${cpPlugins_LIBRARIES}
+FILE(GLOB lib_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+FILE(GLOB lib_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx")
+SET(lib_OTHER_SOURCES "")
+SET(lib_QT4_HEADERS "")
+
+cpPlugins_WrapPlugins(
+  ${lib_NAME} ${prj_VER} ${prj_sVER}
+  "${lib_HEADERS}"
+  "${lib_SOURCES}"
+  "${lib_OTHER_SOURCES}"
+  "${lib_QT4_HEADERS}"
+  cpPlugins ${cpPlugins_LIBRARIES}
   )
 
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${lib_NAME}_Host.cxx
-  DEPENDS cpPlugins_HostCreator ${LIB_HEADERS_H}
-  COMMAND cpPlugins_HostCreator ${lib_NAME}_Host.cxx ${lib_HEADERS_H}
-  )
-ADD_LIBRARY(${lib_NAME} SHARED ${lib_NAME}_Host.cxx ${lib_SOURCES})
-SET_TARGET_PROPERTIES(
-  ${lib_NAME} PROPERTIES
-  VERSION "${prj_VER}"
-  SOVERSION "${prj_sVER}"
-  )
-GENERATE_EXPORT_HEADER(
-  ${lib_NAME}
-  BASE_NAME ${lib_NAME}
-  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
-  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
-  )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
-
 ## ========================
 ## -- Installation rules --
 ## ========================
 
-INSTALL(
-  TARGETS ${lib_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
+#INSTALL(
+#  TARGETS ${lib_NAME}
+#  RUNTIME DESTINATION bin
+#  LIBRARY DESTINATION lib
+#  ARCHIVE DESTINATION lib/static
+#  )
 
 ## eof - $RCSfile$
index 3692c0ffc185a62caf59bf221d2b4dea79484256..fc68d30c73b1c5b082a0b0c80484f3539efb1845 100644 (file)
@@ -1,75 +1,27 @@
 SET(lib_NAME cpPluginsMeshFilters)
-SET(lib_DIR  cpPluginsMeshFilters)
-
-## ===============
-## = Source code =
-## ===============
-
-FILE(GLOB lib_HEADERS_H   "*.h")
-FILE(GLOB lib_HEADERS_HPP "*.hpp")
-FILE(GLOB lib_HEADERS_HXX "*.hxx")
-FILE(GLOB lib_SOURCES_C   "*.c")
-FILE(GLOB lib_SOURCES_CPP "*.cpp")
-FILE(GLOB lib_SOURCES_CXX "*.cxx")
-
-# ===================================
-# = Integrate all source file names =
-# ===================================
-
-SET(
-  lib_HEADERS
-  ${lib_HEADERS_H}
-  ${lib_HEADERS_HPP}
-  ${lib_HEADERS_HXX}
-  )
-
-SET(
-  lib_SOURCES
-  ${lib_SOURCES_C}
-  ${lib_SOURCES_CPP}
-  ${lib_SOURCES_CXX}
-  )
-
-SET(
-  target_LIBRARIES
-  cpExtensions
-  cpPlugins
-  ${cpPlugins_LIBRARIES}
+FILE(GLOB lib_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+FILE(GLOB lib_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx")
+SET(lib_OTHER_SOURCES "")
+SET(lib_QT4_HEADERS "")
+
+cpPlugins_WrapPlugins(
+  ${lib_NAME} ${prj_VER} ${prj_sVER}
+  "${lib_HEADERS}"
+  "${lib_SOURCES}"
+  "${lib_OTHER_SOURCES}"
+  "${lib_QT4_HEADERS}"
+  cpPlugins ${cpPlugins_LIBRARIES}
   )
 
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${lib_NAME}_Host.cxx
-  DEPENDS cpPlugins_HostCreator ${LIB_HEADERS_H}
-  COMMAND cpPlugins_HostCreator ${lib_NAME}_Host.cxx ${lib_HEADERS_H}
-  )
-ADD_LIBRARY(${lib_NAME} SHARED ${lib_NAME}_Host.cxx ${lib_SOURCES})
-SET_TARGET_PROPERTIES(
-  ${lib_NAME} PROPERTIES
-  VERSION "${prj_VER}"
-  SOVERSION "${prj_sVER}"
-  )
-GENERATE_EXPORT_HEADER(
-  ${lib_NAME}
-  BASE_NAME ${lib_NAME}
-  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
-  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
-  )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
-
 ## ========================
 ## -- Installation rules --
 ## ========================
 
-INSTALL(
-  TARGETS ${lib_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
+#INSTALL(
+#  TARGETS ${lib_NAME}
+#  RUNTIME DESTINATION bin
+#  LIBRARY DESTINATION lib
+#  ARCHIVE DESTINATION lib/static
+#  )
 
 ## eof - $RCSfile$
index 330ffe6f4fd2fed92b18328fe985a61ac09f5071..3da18c33a022d353a3d97fbfef90599f427a3763 100644 (file)
@@ -1,75 +1,27 @@
 SET(lib_NAME cpPluginsWidgets)
-SET(lib_DIR  cpPluginsWidgets)
-
-## ===============
-## = Source code =
-## ===============
-
-FILE(GLOB lib_HEADERS_H   "*.h")
-FILE(GLOB lib_HEADERS_HPP "*.hpp")
-FILE(GLOB lib_HEADERS_HXX "*.hxx")
-FILE(GLOB lib_SOURCES_C   "*.c")
-FILE(GLOB lib_SOURCES_CPP "*.cpp")
-FILE(GLOB lib_SOURCES_CXX "*.cxx")
-
-# ===================================
-# = Integrate all source file names =
-# ===================================
-
-SET(
-  lib_HEADERS
-  ${lib_HEADERS_H}
-  ${lib_HEADERS_HPP}
-  ${lib_HEADERS_HXX}
-  )
-
-SET(
-  lib_SOURCES
-  ${lib_SOURCES_C}
-  ${lib_SOURCES_CPP}
-  ${lib_SOURCES_CXX}
-  )
-
-SET(
-  target_LIBRARIES
-  cpExtensions
-  cpPlugins
-  ${cpPlugins_LIBRARIES}
+FILE(GLOB lib_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+FILE(GLOB lib_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx")
+SET(lib_OTHER_SOURCES "")
+SET(lib_QT4_HEADERS "")
+
+cpPlugins_WrapPlugins(
+  ${lib_NAME} ${prj_VER} ${prj_sVER}
+  "${lib_HEADERS}"
+  "${lib_SOURCES}"
+  "${lib_OTHER_SOURCES}"
+  "${lib_QT4_HEADERS}"
+  cpPlugins ${cpPlugins_LIBRARIES}
   )
 
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${lib_NAME}_Host.cxx
-  DEPENDS cpPlugins_HostCreator ${LIB_HEADERS_H}
-  COMMAND cpPlugins_HostCreator ${lib_NAME}_Host.cxx ${lib_HEADERS_H}
-  )
-ADD_LIBRARY(${lib_NAME} SHARED ${lib_NAME}_Host.cxx ${lib_SOURCES})
-SET_TARGET_PROPERTIES(
-  ${lib_NAME} PROPERTIES
-  VERSION "${prj_VER}"
-  SOVERSION "${prj_sVER}"
-  )
-GENERATE_EXPORT_HEADER(
-  ${lib_NAME}
-  BASE_NAME ${lib_NAME}
-  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
-  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
-  )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
-
 ## ========================
 ## -- Installation rules --
 ## ========================
 
-INSTALL(
-  TARGETS ${lib_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
+#INSTALL(
+#  TARGETS ${lib_NAME}
+#  RUNTIME DESTINATION bin
+#  LIBRARY DESTINATION lib
+#  ARCHIVE DESTINATION lib/static
+#  )
 
 ## eof - $RCSfile$