build: use GNUInstallDirs where possible 60/40260/3
authorWim de With <wf@dewith.io>
Sun, 28 Jan 2024 10:05:15 +0000 (11:05 +0100)
committerDamjan Marion <dmarion@0xa5.net>
Wed, 10 Apr 2024 13:59:41 +0000 (13:59 +0000)
Some installation destinations were already converted to the
GNUInstallDirs standard in e3cf4d0cf. This patch converts the share and
include directories (typically /usr/share and /usr/include respectively)
as well.

Type: improvement
Change-Id: Id481b16604f3f52203166a5c0647f43d6eb05239
Signed-off-by: Wim de With <wf@dewith.io>
src/cmake/api.cmake
src/cmake/library.cmake
src/cmake/plugin.cmake
src/tools/appimage/CMakeLists.txt
src/tools/vppapigen/CMakeLists.txt
src/vpp-api/vapi/CMakeLists.txt

index 0e273a7..10e89d7 100644 (file)
@@ -70,7 +70,7 @@ function(vpp_generate_api_json_header file dir component)
   )
   install(
     FILES ${output_name}
-    DESTINATION share/vpp/api/${dir}/
+    DESTINATION ${CMAKE_INSTALL_DATADIR}/vpp/api/${dir}/
     COMPONENT ${component}
   )
 endfunction()
@@ -101,7 +101,7 @@ function(vpp_generate_vapi_c_header f)
   )
   install(
     FILES ${output_name}
-    DESTINATION include/vapi
+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vapi
     COMPONENT vpp-dev
   )
 endfunction ()
@@ -128,7 +128,7 @@ function (vpp_generate_vapi_cpp_header f)
   )
   install(
     FILES ${output_name}
-    DESTINATION include/vapi
+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vapi
     COMPONENT vpp-dev
   )
 endfunction ()
index 45b3944..a06a795 100644 (file)
@@ -72,7 +72,7 @@ macro(add_vpp_library lib)
        ${CMAKE_CURRENT_BINARY_DIR}/${file}_types.h
        ${CMAKE_CURRENT_BINARY_DIR}/${file}_tojson.h
        ${CMAKE_CURRENT_BINARY_DIR}/${file}_fromjson.h
-       DESTINATION include/${lib}/${dir}
+       DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${lib}/${dir}
        COMPONENT vpp-dev
       )
     endforeach()
@@ -96,7 +96,7 @@ macro(add_vpp_library lib)
       get_filename_component(dir ${file} DIRECTORY)
       install(
        FILES ${file}
-       DESTINATION include/${lib}/${dir}
+       DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${lib}/${dir}
        COMPONENT ${ARG_COMPONENT}-dev
       )
     endforeach()
@@ -111,7 +111,7 @@ function (add_vpp_headers path)
     get_filename_component(dir ${file} DIRECTORY)
     install(
       FILES ${file}
-      DESTINATION include/${path}/${dir}
+      DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${path}/${dir}
       COMPONENT vpp-dev
     )
   endforeach()
index df96aa8..f971e5f 100644 (file)
@@ -44,7 +44,7 @@ macro(add_vpp_plugin name)
       ${CMAKE_CURRENT_BINARY_DIR}/${f}.h
       ${CMAKE_CURRENT_BINARY_DIR}/${f}_enum.h
       ${CMAKE_CURRENT_BINARY_DIR}/${f}_types.h
-      DESTINATION include/vpp_plugins/${name}/${dir}
+      DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vpp_plugins/${name}/${dir}
       COMPONENT ${PLUGIN_DEV_COMPONENT}
     )
   endforeach()
@@ -86,7 +86,7 @@ macro(add_vpp_plugin name)
       get_filename_component(dir ${file} DIRECTORY)
       install(
        FILES ${file}
-       DESTINATION include/vpp_plugins/${name}/${dir}
+       DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vpp_plugins/${name}/${dir}
        COMPONENT vpp-dev
       )
     endforeach()
index 1b83656..26ef77d 100644 (file)
@@ -18,7 +18,7 @@ if(VPP_BUILD_APPIMAGE)
                 WORLD_READ WORLD_EXECUTE)
   install(FILES vpp.desktop DESTINATION .)
   install(FILES vpp.png DESTINATION .)
-  install(FILES vpp.svg DESTINATION share/icons/hicolor/scalable/vpp.svg)
+  install(FILES vpp.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/vpp.svg)
   install(CODE "EXECUTE_PROCESS(COMMAND ln -s . ./usr
                 WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})")
   install(CODE "EXECUTE_PROCESS(
index 04ebed5..97a6d35 100644 (file)
@@ -43,7 +43,7 @@ install(
     vppapigen_json.py
     generate_json.py
   DESTINATION
-    share/vpp
+    ${CMAKE_INSTALL_DATADIR}/vpp
   COMPONENT
     vpp-dev
 )
index e016922..e53d3e8 100644 (file)
@@ -45,7 +45,7 @@ install(
     vapi_json_parser.py
     vapi_cpp_gen.py
   DESTINATION
-    share/vpp
+    ${CMAKE_INSTALL_DATADIR}/vpp
   COMPONENT
     vpp-dev
 )