File: use_debian_packaged_hdf5.patch

package info (click to toggle)
gatb-core 1.4.1%2Bgit20181225.44d5a44%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,804 kB
  • sloc: cpp: 48,999; sh: 2,169; xml: 1,333; makefile: 35; python: 32
file content (129 lines) | stat: -rw-r--r-- 6,583 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Author: Andreas Tille <tille@debian.org>
Last-Update: Tue, 28 Nov 2017 10:37:22 +0100
Description: Use Debian packaged hdf5

--- a/gatb-core/thirdparty/CMakeLists.txt
+++ b/gatb-core/thirdparty/CMakeLists.txt
@@ -5,6 +5,8 @@
 #SET (HDF5_ENABLE_THREADSAFE       ON)
 #SET (H5_HAVE_THREADSAFE 1)
 
+FIND_PACKAGE(HDF5 COMPONENTS C REQUIRED)
+
 ##########  MOMENTARY DEACTIVATED => CRASH ON MACOS TO BE INVESTIGATED  ##########
 SET (HDF5_BUILD_TOOLS             ON CACHE BOOL "Build HDF5 Tools")
 #SET (CMAKE_EXE_LINKER_FLAGS       "-lpthread -lz")
@@ -16,9 +18,9 @@ SET (HDF5_EXTERNALLY_CONFIGURED     ON)
 SET (HDF5_INSTALL_BIN_DIR           bin)
 SET (HDF5_INSTALL_LIB_DIR           lib)
 
-SET (HDF5_INSTALL_INCLUDE_DIR       ${PROJECT_BINARY_DIR}/include/${CMAKE_BUILD_TYPE}/hdf5)
-SET (HDF5_INSTALL_DATA_DIR          ${PROJECT_BINARY_DIR}/share/${CMAKE_BUILD_TYPE})
-SET (HDF5_INSTALL_CMAKE_DIR         ${PROJECT_BINARY_DIR}/share/${CMAKE_BUILD_TYPE})
+SET (HDF5_INSTALL_INCLUDE_DIR       /usr/include/${CMAKE_BUILD_TYPE}/hdf5)
+SET (HDF5_INSTALL_DATA_DIR          /usr/share/${CMAKE_BUILD_TYPE})
+SET (HDF5_INSTALL_CMAKE_DIR         /usr/share/${CMAKE_BUILD_TYPE})
 
 IF (NOT DEFINED GATB_CORE_INSTALL_EXCLUDE)
     SET (HDF5_EXPORTED_TARGETS          "gatb-hdf5")
@@ -32,23 +34,6 @@ ENDIF()
 set (COMPILE_DEFINITIONS  "${COMPILE_DEFINITIONS}  -w")
 add_definitions (${COMPILE_DEFINITIONS})
 
-# add HDF5 generation
-ADD_SUBDIRECTORY (hdf5)
-
-# We add a custom target for copying header files.
-add_custom_target (hdf5_postbuild ALL)
-
-# We build the output directory
-add_custom_command (TARGET hdf5_postbuild POST_BUILD  COMMAND ${CMAKE_COMMAND} -E make_directory ${HDF5_INSTALL_INCLUDE_DIR})
-
-# We define all the header files to be copied
-file (GLOB headerfiles ${PROJECT_SOURCE_DIR}/thirdparty/hdf5/src/*.h ${PROJECT_BINARY_DIR}/thirdparty/hdf5/H5pubconf.h)
-
-# We copy each header file
-foreach (header ${headerfiles})
-  add_custom_command (TARGET hdf5_postbuild POST_BUILD  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${header} ${HDF5_INSTALL_INCLUDE_DIR}  )
-endforeach()
-
 # include other smaller libraries (json, Boophf)
 
 add_custom_target (thirdparty_copy ALL)
@@ -63,7 +48,5 @@ add_custom_command (TARGET thirdparty_co
 #  INSTALL 
 ################################################################################
 IF (NOT DEFINED GATB_CORE_INSTALL_EXCLUDE)
-    INSTALL (DIRECTORY ${PROJECT_BINARY_DIR}/include/${CMAKE_BUILD_TYPE}/hdf5 DESTINATION include)
-    INSTALL (DIRECTORY ${PROJECT_BINARY_DIR}/include/${CMAKE_BUILD_TYPE}/json DESTINATION include)
     INSTALL (DIRECTORY ${PROJECT_BINARY_DIR}/include/${CMAKE_BUILD_TYPE}/BooPHF DESTINATION include)
 ENDIF ()
--- a/gatb-core/CMakeLists.txt
+++ b/gatb-core/CMakeLists.txt
@@ -99,7 +99,7 @@ endif()
 # GENERAL DEFINITIONS
 ################################################################################
 set (LIBRARY_COMPILE_DEFINITIONS "-std=c++11")
-set (LIB_COMPILE_WARNINGS "-Wall -Wno-unused-function -Wno-format -Wno-unknown-pragmas") # last one is exclusively for BooPHF
+set (LIB_COMPILE_WARNINGS "-Wall -Wno-unused-function -Wno-unknown-pragmas") # last one is exclusively for BooPHF
 
 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
     set (debug 1)
@@ -211,16 +211,23 @@ set (gatb-core-flags ${LIBRARY_COMPILE_D
 set (gatb-core-includes ${PROJECT_BINARY_DIR}/include  ${PROJECT_BINARY_DIR}/include/${CMAKE_BUILD_TYPE} ${PROJECT_SOURCE_DIR}/src  ${PROJECT_SOURCE_DIR}/thirdparty ${gatb-core-extra-libraries-inc})
 
 # We define the libraries used for linking binary based on gatb core
-set (gatb-core-libraries   gatbcore-static  dl  pthread  z hdf5 ${gatb-core-extra-libraries})
+set (gatb-core-libraries   gatbcore-static  dl  pthread  z ${gatb-core-extra-libraries})
 
 # We define the directory where to find cmake helpers
 set (gatb-core-cmake  ${CMAKE_MODULE_PATH})
 
-# NOTE... we have to duplicate the variables for the other scopes (in particular for sub directories)
-set (gatb-core-flags          ${gatb-core-flags}          PARENT_SCOPE)
-set (gatb-core-includes       ${gatb-core-includes}       PARENT_SCOPE)
-set (gatb-core-libraries      ${gatb-core-libraries}      PARENT_SCOPE)
-set (gatb-core-cmake          ${gatb-core-cmake}          PARENT_SCOPE)
+################################################################################
+#  DEPENDENCIES 
+################################################################################
+# we must be sure that hdf5 is built and installed before building gatb-core
+find_package(HDF5 REQUIRED)
+include_directories(${HDF5_INCLUDE_DIRS})
+# Not sure what exact programs will need these libraries
+#  see https://lists.debian.org/debian-mentors/2017/11/msg00227.html
+# target_link_libraries(name_of_program_or_library ${HDF5_LIBRARIES})
+set (gatb-core-libraries  ${gatb-core-libraries} ${HDF5_LIBRARIES})
+MESSAGE(STATUS HDF5_LIBRARIES="${HDF5_LIBRARIES}")
+
 
 ################################################################################
 #  LIBRARY GENERATION 
@@ -253,11 +260,13 @@ ENDIF()
 ################################################################################
 ADD_SUBDIRECTORY(thirdparty)
 
-################################################################################
-#  DEPENDENCIES 
-################################################################################
-# we must be sure that hdf5 is built and installed before building gatb-core
-ADD_DEPENDENCIES (gatbcore-static hdf5 hdf5_postbuild)
+
+# NOTE... we have to duplicate the variables for the other scopes (in particular for sub directories)
+set (gatb-core-flags          ${gatb-core-flags}          PARENT_SCOPE)
+set (gatb-core-includes       ${gatb-core-includes}       PARENT_SCOPE)
+set (gatb-core-libraries      ${gatb-core-libraries}      PARENT_SCOPE)
+set (gatb-core-cmake          ${gatb-core-cmake}          PARENT_SCOPE)
+
 
 ################################################################################
 #  DOCUMENTATION GENERATION 
@@ -288,7 +297,7 @@ IF (NOT DEFINED GATB_CORE_INSTALL_EXCLUD
     INSTALL (FILES ${PROJECT_SOURCE_DIR}/doc/misc/README.txt  DESTINATION . OPTIONAL)
     INSTALL (FILES ${PROJECT_SOURCE_DIR}/LICENCE              DESTINATION . OPTIONAL)
     INSTALL (FILES ${PROJECT_SOURCE_DIR}/THIRDPARTIES.md      DESTINATION . OPTIONAL)
-    INSTALL (DIRECTORY ${PROJECT_SOURCE_DIR}/thirdparty/boost DESTINATION ./include)
+#    INSTALL (DIRECTORY ${PROJECT_SOURCE_DIR}/thirdparty/boost DESTINATION ./include)
 ENDIF()
 
 ################################################################################