File: add-install-rule.patch

package info (click to toggle)
ne10 1.2.1-6
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 7,816 kB
  • sloc: ansic: 26,841; asm: 8,546; cpp: 2,428; python: 342; javascript: 136; sh: 135; objc: 105; xml: 63; java: 35; makefile: 12
file content (141 lines) | stat: -rw-r--r-- 4,670 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
130
131
132
133
134
135
136
137
138
139
140
141
Index: ne10-1.2.1/CMakeLists.txt
===================================================================
--- ne10-1.2.1.orig/CMakeLists.txt
+++ ne10-1.2.1/CMakeLists.txt
@@ -184,3 +184,61 @@ endif()
 if(IOS_PLATFORM AND IOS_DEMO)
     add_subdirectory(ios)
 endif()
+
+if(GNULINUX_PLATFORM)
+    # package config
+    set(prefix ${CMAKE_INSTALL_PREFIX})
+    set(exec_prefix "\${prefix}")
+    set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
+    set(includedir "\${prefix}/include")
+
+    configure_file(
+        ${CMAKE_CURRENT_SOURCE_DIR}/ne10.pc.in
+        ${CMAKE_CURRENT_BINARY_DIR}/ne10.pc
+    @ONLY)
+
+    install( FILES ${CMAKE_CURRENT_BINARY_DIR}/ne10.pc
+             DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+
+    # install rules
+    install( DIRECTORY inc/
+             DESTINATION include/ne10
+             FILES_MATCHING PATTERN "*.h")
+    install( DIRECTORY common/
+             DESTINATION include/ne10
+             FILES_MATCHING PATTERN "*.h")
+
+    if(NE10_ENABLE_DSP)
+        install( DIRECTORY modules/dsp/
+                 DESTINATION include/ne10/dsp
+                 FILES_MATCHING PATTERN "*.h")
+    endif()
+
+    if(NE10_ENABLE_MATH)
+        install( DIRECTORY modules/math/
+                 DESTINATION include/ne10/math
+                 FILES_MATCHING PATTERN "*.h")
+    endif()
+
+    if(NE10_ENABLE_IMGPROC)
+        install( DIRECTORY modules/imgproc/
+                 DESTINATION include/ne10/imgproc
+                 FILES_MATCHING PATTERN "*.h")
+    endif()
+
+    if(NE10_ENABLE_PHYSICS)
+        install( DIRECTORY modules/physics/
+                 DESTINATION include/ne10/physics
+                 FILES_MATCHING PATTERN "*.h")
+    endif()
+    # uninstall rules
+    configure_file(
+        ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
+        ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
+        @ONLY)
+
+    add_custom_target(uninstall
+        ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
+    )
+
+endif()
\ No newline at end of file
Index: ne10-1.2.1/cmake/cmake_uninstall.cmake.in
===================================================================
--- /dev/null
+++ ne10-1.2.1/cmake/cmake_uninstall.cmake.in
@@ -0,0 +1,30 @@
+IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+  MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+STRING(REGEX REPLACE "\n" ";" files "${files}")
+FOREACH(file ${files})
+  MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+  IF(EXISTS "$ENV{DESTDIR}${file}")
+    EXEC_PROGRAM(
+      "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+      OUTPUT_VARIABLE rm_out
+      RETURN_VALUE rm_retval
+      )
+    IF(NOT "${rm_retval}" STREQUAL 0)
+      MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+    ENDIF(NOT "${rm_retval}" STREQUAL 0)
+  ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}")
+    EXEC_PROGRAM(
+      "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+      OUTPUT_VARIABLE rm_out
+      RETURN_VALUE rm_retval
+      )
+    IF(NOT "${rm_retval}" STREQUAL 0)
+      MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+    ENDIF(NOT "${rm_retval}" STREQUAL 0)
+  ELSE(EXISTS "$ENV{DESTDIR}${file}")
+    MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+  ENDIF(EXISTS "$ENV{DESTDIR}${file}")
+ENDFOREACH(file)
\ No newline at end of file
Index: ne10-1.2.1/modules/CMakeLists.txt
===================================================================
--- ne10-1.2.1.orig/modules/CMakeLists.txt
+++ ne10-1.2.1/modules/CMakeLists.txt
@@ -387,6 +387,8 @@ if(NE10_BUILD_STATIC OR ANDROID_PLATFORM
     install(TARGETS NE10
       DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../ios/NE10Demo/libs/)
   endif(IOS_DEMO)
+
+  install(TARGETS NE10 DESTINATION lib)
 endif()
 
 if(NE10_BUILD_SHARED)
@@ -421,5 +423,5 @@ if(NE10_BUILD_SHARED)
     )
 
     target_link_libraries(NE10_test m)
-
+    install(TARGETS NE10_shared DESTINATION lib)
 endif()
Index: ne10-1.2.1/ne10.pc.in
===================================================================
--- /dev/null
+++ ne10-1.2.1/ne10.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+LV_CXXFLAGS=@LV_CXXFLAGS@
+
+Name: ne10
+Description: Ne10: An open optimized software library project for the ARMĀ® Architecture
+Requires:
+Version: @LIBVER@
+Libs: -L${libdir} -lne10
+Cflags: -I${includedir} ${LV_CXXFLAGS}
\ No newline at end of file