CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
INCLUDE(cmake/cpPlugins_Policies.cmake)
+INCLUDE(cmake/cpPlugins_Functions.cmake)
## ==================
## == Project name ==
)
ENDFOREACH(source)
-## =============================
-## == Create global variables ==
-## =============================
-
-SET(
- cpPluginsInstances_APP
- ${PROJECT_BINARY_DIR}/cpPlugins_CreateInstances
- CACHE INTERNAL "Target location"
- )
-
## eof - $RCSfile$
--- /dev/null
+
+## -------------------------------------------------------------------------
+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$
-## ============================
-## == 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$
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$
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$
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$
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$
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$