implement "ninja install"
Stefan Schuermans

Stefan Schuermans commited on 2020-07-31 18:09:23
Showing 4 changed files, with 50 additions and 0 deletions.


set prefix using "cmake -DCMAKE_INSTALL_PREFIX"
... ...
@@ -15,3 +15,10 @@ set_target_properties(
15 15
   LIBRARY_OUTPUT_DIRECTORY
16 16
   ${CMAKE_BINARY_DIR}/lib/uproctrace
17 17
 )
18
+
19
+install(
20
+  PROGRAMS
21
+  ${CMAKE_BINARY_DIR}/lib/uproctrace/libuptpl.so
22
+  DESTINATION
23
+  lib/uproctrace
24
+)
... ...
@@ -2,6 +2,10 @@ set(
2 2
   PYTHON_UPT_DIR
3 3
   ${CMAKE_BINARY_DIR}/lib/python3/dist-packages/uproctrace
4 4
 )
5
+set(
6
+  PYTHON_UPT_INSTALL_DIR
7
+  lib/python3/dist-packages/uproctrace
8
+)
5 9
 
6 10
 add_custom_command(
7 11
   OUTPUT
... ...
@@ -13,6 +17,12 @@ add_custom_command(
13 17
          --python_out ${PYTHON_UPT_DIR}
14 18
          ${CMAKE_SOURCE_DIR}/uproctrace.proto
15 19
 )
20
+install(
21
+  FILES
22
+  ${PYTHON_UPT_DIR}/uproctrace_pb2.py
23
+  DESTINATION
24
+  ${PYTHON_UPT_INSTALL_DIR}
25
+)
16 26
 
17 27
 add_custom_command(
18 28
   OUTPUT
... ...
@@ -28,6 +38,12 @@ add_custom_command(
28 38
   ${CMAKE_CURRENT_SOURCE_DIR}/gui_glade_footer.py
29 39
   > ${PYTHON_UPT_DIR}/gui_glade.py
30 40
 )
41
+install(
42
+  FILES
43
+  ${PYTHON_UPT_DIR}/gui_glade.py
44
+  DESTINATION
45
+  ${PYTHON_UPT_INSTALL_DIR}
46
+)
31 47
 
32 48
 function(pyfile NAME)
33 49
   add_custom_command(
... ...
@@ -41,6 +57,12 @@ function(pyfile NAME)
41 57
   )
42 58
   list(APPEND PYFILES ${PYTHON_UPT_DIR}/${NAME}.py)
43 59
   set(PYFILES ${PYFILES} PARENT_SCOPE)
60
+  install(
61
+    FILES
62
+    ${PYTHON_UPT_DIR}/${NAME}.py
63
+    DESTINATION
64
+    ${PYTHON_UPT_INSTALL_DIR}
65
+  )
44 66
 endfunction(pyfile)
45 67
 
46 68
 pyfile(__init__)
... ...
@@ -25,3 +25,17 @@ add_custom_target(
25 25
   ${CMAKE_BINARY_DIR}/lib/uproctrace/upt-tool.py
26 26
   ${CMAKE_BINARY_DIR}/bin/upt-tool
27 27
 )
28
+
29
+install(
30
+  PROGRAMS
31
+  ${CMAKE_BINARY_DIR}/lib/uproctrace/upt-tool.py
32
+  DESTINATION
33
+  lib/uproctrace
34
+)
35
+
36
+install(
37
+  PROGRAMS
38
+  ${CMAKE_BINARY_DIR}/bin/upt-tool
39
+  DESTINATION
40
+  bin
41
+)
... ...
@@ -14,3 +14,10 @@ add_custom_target(
14 14
   DEPENDS
15 15
   ${CMAKE_BINARY_DIR}/bin/upt-trace
16 16
 )
17
+
18
+install(
19
+  PROGRAMS
20
+  ${CMAKE_BINARY_DIR}/bin/upt-trace
21
+  DESTINATION
22
+  bin
23
+)
17 24