File: 04_use-mkoctfile.diff

package info (click to toggle)
plplot 5.10.0%2Bdfsg2-0.4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 25,792 kB
  • ctags: 13,517
  • sloc: ansic: 83,001; xml: 27,081; ada: 18,878; cpp: 15,966; tcl: 11,651; python: 7,075; f90: 7,058; ml: 6,974; java: 6,665; perl: 5,029; sh: 2,208; makefile: 210; lisp: 75; sed: 25; fortran: 7
file content (85 lines) | stat: -rwxr-xr-x 2,610 bytes parent folder | download | duplicates (3)
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
#! /bin/sh /usr/share/dpatch/dpatch-run
## 04_use-mkoctfile.dpatch by Rafael Laboissiere <rafael@debian.org>
##
## DP: Build plplot_octave.oct using mkoctfile and not as a shared library

@DPATCH@

--- plplot-5.9.5.orig/bindings/octave/CMakeLists.txt
+++ plplot-5.9.5/bindings/octave/CMakeLists.txt
@@ -136,49 +136,6 @@
   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/plplot_octave.cc
     PROPERTIES GENERATED ON)
 
-  # Build octave interface.
-  set(octave_interface_INCLUDE_PATHS
-    ${CMAKE_SOURCE_DIR}/include
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_BINARY_DIR}/include
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CMAKE_CURRENT_BINARY_DIR}
-    ${OCTAVE_INCLUDE_PATH}
-    )
-  include_directories(${octave_interface_INCLUDE_PATHS})
-
-  add_library(plplot_octave MODULE ${CMAKE_CURRENT_BINARY_DIR}/plplot_octave.cc)
-  target_link_libraries(
-    plplot_octave
-    plplot${LIB_TAG}
-    "${OCTAVE_LIBRARIES}"
-    "${OCTINTERP_LIBRARIES}"
-    )
-
-  if(USE_RPATH)
-    get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH)
-    # (Reasonable) assumption here is that OCTAVE_LIBRARIES and
-    # OCTINTERP_LIBRARIES have the same path.
-    get_filename_component(OCTAVE_INSTALL_RPATH "${OCTAVE_LIBRARIES}" PATH)
-    set(LIB_INSTALL_RPATH ${LIB_INSTALL_RPATH} ${OCTAVE_INSTALL_RPATH})
-    set_target_properties(
-      plplot_octave
-      PROPERTIES
-      PREFIX "" 
-      SUFFIX ".oct"
-      INSTALL_RPATH "${LIB_INSTALL_RPATH}"
-      INSTALL_NAME_DIR "${OCTAVE_OCT_DIR}"
-      )
-  else(USE_RPATH)
-    set_target_properties(
-      plplot_octave
-      PROPERTIES
-      PREFIX "" 
-      SUFFIX ".oct"
-      INSTALL_NAME_DIR "${OCTAVE_OCT_DIR}"
-      )
-  endif(USE_RPATH)
-
   # Have to be specific about permissions for some reason (probably oct suffix).
   set(PERM_MODULES
     OWNER_READ
@@ -190,9 +147,22 @@
     WORLD_EXECUTE
     )
 
+  add_custom_command(
+    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plplot_octave.oct
+    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/plplot_octave.cc
+    COMMAND ${MKOCTFILE} ${CMAKE_CURRENT_BINARY_DIR}/plplot_octave.cc
+    -I${CMAKE_CURRENT_BINARY_DIR} -I${CMAKE_SOURCE_DIR}/bindings/octave
+    -I${CMAKE_SOURCE_DIR}/include --strip
+    -L${CMAKE_BINARY_DIR}/src -lplplot${LIB_TAG}
+    )
+
+  add_custom_target(
+    plplot_octave_oct_file ALL
+    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/plplot_octave.oct
+    )
+
+  install( 
+    FILES ${CMAKE_CURRENT_BINARY_DIR}/plplot_octave.oct
-  install(TARGETS plplot_octave
-    EXPORT export_plplot
-    LIBRARY
     DESTINATION ${OCTAVE_OCT_DIR}
     PERMISSIONS ${PERM_MODULES}
     )