[SCM] OCE packaging branch, debian, updated. debian/0.10-2-5-ge059424

Denis Barbier bouzim at gmail.com
Sun Aug 5 10:24:59 UTC 2012


The following commit has been merged in the debian branch:
commit a2f8ff6f25d296478028f571fa9c9ebb828d0eba
Author: Denis Barbier <bouzim at gmail.com>
Date:   Sun Aug 5 09:45:34 2012 +0200

    New patch: split-export.patch
    
    OCE-libraries.cmake references all targets which are computed
    when package is built.  As a consequence, linking against OCE
    requires that all liboce-*-dev packages are installed.
    
    Split OCE-libraries.cmake into several files, each -dev package
    embeds a file which references the shared libraries it uses.
    
    CMake reports error when building OCE package, but they are harmless.

diff --git a/debian/liboce-foundation-dev.install b/debian/liboce-foundation-dev.install
index e7d84ee..ee161d0 100644
--- a/debian/liboce-foundation-dev.install
+++ b/debian/liboce-foundation-dev.install
@@ -1,5 +1,4 @@
-usr/lib/*/oce-*/OCE-libraries.cmake
-usr/lib/*/oce-*/OCE-libraries-release.cmake
+usr/lib/*/oce-*/OCE01_FoundationTargets*.cmake
 usr/lib/*/oce-*/OCEConfig.cmake
 usr/lib/*/oce-*/OCEConfigVersion.cmake
 
diff --git a/debian/liboce-modeling-dev.install b/debian/liboce-modeling-dev.install
index 129b2e1..b8b4a8e 100644
--- a/debian/liboce-modeling-dev.install
+++ b/debian/liboce-modeling-dev.install
@@ -1,3 +1,5 @@
+usr/lib/*/oce-*/OCE02_ModelingTargets*.cmake
+
 #   PACKAGES = TKG2d TKG3d TKGeomBase TKBRep TKGeomAlgo TKTopAlgo TKPrim TKBO TKHLR TKMesh TKShHealing TKXMesh TKBool TKFillet TKFeat TKOffset TKSTL TKXSBase TKSTEPBase TKIGES TKSTEPAttr TKSTEP209 TKSTEP
 #
 # See ros/adm/make/Makefile.am
diff --git a/debian/liboce-ocaf-dev.install b/debian/liboce-ocaf-dev.install
index 7a06937..bf675bd 100644
--- a/debian/liboce-ocaf-dev.install
+++ b/debian/liboce-ocaf-dev.install
@@ -1,3 +1,5 @@
+usr/lib/*/oce-*/OCE04_OcafTargets*.cmake
+
 #   PACKAGES = TKCAF TKBin TKXml TKPCAF TKBinTObj TKXmlTObj TKStdSchema TKXCAF TKXCAFSchema TKXmlXCAF TKBinXCAF TKXDEIGES TKXDESTEP
 #
 # See ros/adm/make/Makefile.am
diff --git a/debian/liboce-ocaf-lite-dev.install b/debian/liboce-ocaf-lite-dev.install
index 4c9a7a4..72ddfc0 100644
--- a/debian/liboce-ocaf-lite-dev.install
+++ b/debian/liboce-ocaf-lite-dev.install
@@ -1,3 +1,5 @@
+usr/lib/*/oce-*/OCE03_OcafLiteTargets*.cmake
+
 #   PACKAGES = TKCDF PTKernel TKLCAF FWOSPlugin TKPShape TKBinL TKXmlL TKPLCAF TKTObj TKShapeSchema TKStdLSchema
 #
 # See ros/adm/make/Makefile.am
diff --git a/debian/liboce-visualization-dev.install b/debian/liboce-visualization-dev.install
index 4ae53f5..3e71249 100644
--- a/debian/liboce-visualization-dev.install
+++ b/debian/liboce-visualization-dev.install
@@ -1,3 +1,5 @@
+usr/lib/*/oce-*/OCE05_VisualizationTargets*.cmake
+
 #   PACKAGES = TKService TKV2d TKV3d TKOpenGl TKMeshVS TKNIS TKVoxel TKVRML
 #
 # See ros/adm/make/Makefile.am
diff --git a/debian/oce-draw.install b/debian/oce-draw.install
index b74a185..fece11f 100644
--- a/debian/oce-draw.install
+++ b/debian/oce-draw.install
@@ -1,3 +1,5 @@
+usr/lib/*/oce-*/OCE06_DrawTargets.cmake
+
 usr/bin/DRAWEXE
 usr/share/man/man1/DRAWEXE.1
 
diff --git a/debian/patches/series b/debian/patches/series
index 1a4bf30..173a70e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 add-TKQADraw.patch
+split-export.patch
diff --git a/debian/patches/split-export.patch b/debian/patches/split-export.patch
new file mode 100644
index 0000000..8843288
--- /dev/null
+++ b/debian/patches/split-export.patch
@@ -0,0 +1,95 @@
+Description: Split export file into several pieces
+Author: Denis Barbier <bouzim at gmail.com>
+Origin: Debian
+Forwarded: no
+Last-Update: 2012-08-02
+
+In Debian, OCE libraries are split into several packages.
+Prior to oce 0.10-3, the OCE-libraries-release.cmake file contained all
+targets computed when compiling.  But then CMake projects could load this
+file only if all files referenced by these targets were present, which
+means that nearly all oce packages have to be installed.
+
+With this patch, each package contains a cmake script which declares
+only its own targets, and OCEConfig.cmake loads all those scripts
+in the right order.
+
+The only downside is that cmake reports errors when generating files:
+  CMake Error: INSTALL(EXPORT "OCE02_ModelingTargets" ...) includes target "TKG2d" which requires target "TKernel" that is not in the export set.
+  CMake Error: INSTALL(EXPORT "OCE02_ModelingTargets" ...) includes target "TKG3d" which requires target "TKMath" that is not in the export set.
+  [...]
+and thus returns 1 instead of 0.
+
+This is related to
+  http://www.cmake.org/Bug/view.php?id=12588
+
+This patch is Debian specific and does not have to be forwarded upstream.
+
+Index: oce/CMakeLists.txt
+===================================================================
+--- oce.orig/CMakeLists.txt
++++ oce/CMakeLists.txt
+@@ -924,6 +924,19 @@ CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_D
+ 				${CMAKE_CURRENT_BINARY_DIR}/Version.rc)
+ ENDIF(NOT ${PROJECT_NAME}_NO_LIBRARY_VERSION)
+ 
++MACRO(DEBIAN_DECLARE_EXPORT_TARGETS packagename modules)
++	FOREACH(module ${modules})
++		SET(debianTargetExport${module} ${PROJECT_NAME}${packagename}Targets)
++	ENDFOREACH(module ${modules})
++ENDMACRO(DEBIAN_DECLARE_EXPORT_TARGETS packagename modules)
++
++DEBIAN_DECLARE_EXPORT_TARGETS(01_Foundation "TKernel;TKMath;TKAdvTools")
++DEBIAN_DECLARE_EXPORT_TARGETS(02_Modeling "TKG2d;TKG3d;TKGeomBase;TKBRep;TKGeomAlgo;TKTopAlgo;TKPrim;TKBO;TKHLR;TKMesh;TKShHealing;TKXMesh;TKBool;TKFillet;TKFeat;TKOffset;TKSTL;TKXSBase;TKSTEPBase;TKIGES;TKSTEPAttr;TKSTEP209;TKSTEP")
++DEBIAN_DECLARE_EXPORT_TARGETS(03_OcafLite "TKCDF;PTKernel;TKLCAF;FWOSPlugin;TKPShape;TKBinL;TKXmlL;TKPLCAF;TKTObj;TKShapeSchema;TKStdLSchema")
++DEBIAN_DECLARE_EXPORT_TARGETS(04_Ocaf "TKCAF;TKBin;TKXml;TKPCAF;TKBinTObj;TKXmlTObj;TKStdSchema;TKXCAF;TKXCAFSchema;TKXmlXCAF;TKBinXCAF;TKXDEIGES;TKXDESTEP")
++DEBIAN_DECLARE_EXPORT_TARGETS(05_Visualization "TKService;TKV2d;TKV3d;TKOpenGl;TKMeshVS;TKNIS;TKVRML;TKVoxel")
++DEBIAN_DECLARE_EXPORT_TARGETS(06_Draw "TKDraw;TKTopTest;TKViewerTest;TKXSDRAW;TKDCAF;TKXDEDRAW;TKTObjDRAW;TKQADraw")
++
+ MACRO(PROCESS_MODULE modulename modules_std)
+ 	set(modules ${modules_std})
+ 	IF(NOT ${PROJECT_NAME}_DISABLE_X11)
+@@ -989,7 +1002,12 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_D
+ INSTALL(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake ${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+ 	DESTINATION ${${PROJECT_NAME}_INSTALL_CMAKE_DATA_DIR} COMPONENT Development )
+ 
+-INSTALL(EXPORT ${PROJECT_NAME}-libraries DESTINATION ${${PROJECT_NAME}_INSTALL_CMAKE_DATA_DIR} COMPONENT Development)
++INSTALL(EXPORT ${PROJECT_NAME}01_FoundationTargets DESTINATION ${${PROJECT_NAME}_INSTALL_CMAKE_DATA_DIR} COMPONENT Development)
++INSTALL(EXPORT ${PROJECT_NAME}02_ModelingTargets DESTINATION ${${PROJECT_NAME}_INSTALL_CMAKE_DATA_DIR} COMPONENT Development)
++INSTALL(EXPORT ${PROJECT_NAME}03_OcafLiteTargets DESTINATION ${${PROJECT_NAME}_INSTALL_CMAKE_DATA_DIR} COMPONENT Development)
++INSTALL(EXPORT ${PROJECT_NAME}04_OcafTargets DESTINATION ${${PROJECT_NAME}_INSTALL_CMAKE_DATA_DIR} COMPONENT Development)
++INSTALL(EXPORT ${PROJECT_NAME}05_VisualizationTargets DESTINATION ${${PROJECT_NAME}_INSTALL_CMAKE_DATA_DIR} COMPONENT Development)
++INSTALL(EXPORT ${PROJECT_NAME}06_DrawTargets DESTINATION ${${PROJECT_NAME}_INSTALL_CMAKE_DATA_DIR} COMPONENT Development)
+ 
+ ############
+ # PostBuild Step
+Index: oce/ProjectConfig.cmake.in
+===================================================================
+--- oce.orig/ProjectConfig.cmake.in
++++ oce/ProjectConfig.cmake.in
+@@ -18,7 +18,11 @@ GET_FILENAME_COMPONENT(SELF_DIR "${CMAKE
+ 
+ SET(@PROJECT_NAME at _INCLUDE_DIRS "${SELF_DIR}/@OCE_CMAKE_DATA_TO_INCLUDE_RELATIVE_DIR@")
+ SET(@PROJECT_NAME at _LIBRARIES "@OCE_LIBRARIES@")
+-INCLUDE("${SELF_DIR}/@PROJECT_NAME at -libraries.cmake")
++FILE(GLOB DEBIAN_TARGET_FILES ${SELF_DIR}/@PROJECT_NAME@*Targets.cmake)
++LIST(SORT DEBIAN_TARGET_FILES)
++FOREACH(file ${DEBIAN_TARGET_FILES})
++	INCLUDE("${file}")
++ENDFOREACH(file ${DEBIAN_TARGET_FILES})
+ 
+ SET(@PROJECT_NAME at _ALL_FOUND true)
+ IF(@PROJECT_NAME at _FIND_COMPONENTS)
+Index: oce/adm/cmake/BuildToolkit.cmake
+===================================================================
+--- oce.orig/adm/cmake/BuildToolkit.cmake
++++ oce/adm/cmake/BuildToolkit.cmake
+@@ -166,7 +166,7 @@ ELSE(TOOLKIT_IS_PRIVATE)
+ ENDIF(TOOLKIT_IS_PRIVATE)
+ 
+ INSTALL(TARGETS ${TOOLKIT}
+-	EXPORT ${PROJECT_NAME}-libraries
++	EXPORT ${debianTargetExport${TOOLKIT}}
+ 	RUNTIME DESTINATION ${TOOLKIT_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries
+ 	LIBRARY DESTINATION ${TOOLKIT_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
+ 	ARCHIVE DESTINATION ${TOOLKIT_INSTALL_LIB_DIR} COMPONENT Development
diff --git a/debian/rules b/debian/rules
index 0ec6707..c77fead 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,7 +14,8 @@ endif
 	dh $@ --buildsystem=cmake --parallel --with quilt
 
 override_dh_auto_configure:
-	dh_auto_configure -- \
+	# See in debian/patches/split-export.patch why we must ignore cmake return value
+	-dh_auto_configure -- \
         -DOCE_BUILD_SHARED_LIB:BOOL=ON \
         -DOCE_BUILD_TYPE:STRING=Release \
         -DOCE_INSTALL_PREFIX:PATH=/usr \

-- 
OCE packaging



More information about the debian-science-commits mailing list