Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit df7bf55

Browse files
committed
Install libraries as per GNU Coding Standards
Includes GNUInstallDirs and uses LIBDIR (instead of hardcoded lib) to install libraries. Fixes packaging on aarch64 systems where LIBDIR=lib64 (not lib). Signed-off-by: Damian Wrobel <[email protected]>
1 parent f73fca0 commit df7bf55

File tree

22 files changed

+26
-24
lines changed

22 files changed

+26
-24
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ SET(PROJECT_VER_PATCH 0)
88
SET(PROJECT_VER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
99
SET(PROJECT_APIVER "${PROJECT_VER}")
1010

11+
include(GNUInstallDirs)
12+
1113
if(ARM64)
1214
set(BUILD_MMAL FALSE)
1315
set(BUILD_MMAL_APPS FALSE)
@@ -125,7 +127,7 @@ if(PKG_CONFIG_FOUND)
125127
foreach(PCFILE bcm_host.pc brcmegl.pc brcmglesv2.pc brcmvg.pc vcsm.pc mmal.pc)
126128
configure_file("pkgconfig/${PCFILE}.in" "${PCFILE}" @ONLY)
127129
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PCFILE}"
128-
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
130+
DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
129131
endforeach()
130132
endif()
131133
# Remove cache entry, if one added by command line

containers/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ set(packetizers_SRCS ${packetizers_SRCS} ${SOURCE_DIR}/h264/avc1_packetizer.c)
6666

6767
add_library(containers ${LIBRARY_TYPE} ${core_SRCS} ${io_SRCS} ${net_SRCS} ${packetizers_SRCS})
6868
target_link_libraries(containers vcos)
69-
install(TARGETS containers DESTINATION lib)
69+
install(TARGETS containers DESTINATION ${LIBDIR})
7070

7171
set(container_readers)
7272
set(container_writers)

helpers/dtoverlay/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ add_library (dtovl ${SHARED}
2222

2323
target_link_libraries(dtovl fdt)
2424

25-
install (TARGETS dtovl DESTINATION lib)
25+
install (TARGETS dtovl DESTINATION ${LIBDIR})

host_applications/linux/libs/bcm_host/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ add_library(bcm_host ${SHARED} bcm_host.c)
1919

2020
target_link_libraries(bcm_host vcos vchostif)
2121

22-
install(TARGETS bcm_host DESTINATION lib)
22+
install(TARGETS bcm_host DESTINATION ${LIBDIR})
2323

host_applications/linux/libs/debug_sym/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ include_directories (
1111
add_library(debug_sym ${SHARED} debug_sym.c)
1212
add_library(debug_sym_static STATIC debug_sym.c)
1313

14-
install(TARGETS debug_sym DESTINATION lib)
15-
install(TARGETS debug_sym_static DESTINATION lib)
14+
install(TARGETS debug_sym DESTINATION ${LIBDIR})
15+
install(TARGETS debug_sym_static DESTINATION ${LIBDIR})
1616
install(FILES debug_sym.h DESTINATION include/interface/debug_sym)

host_applications/linux/libs/sm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ add_library(vcsm ${SHARED} user-vcsm.c)
1414

1515
target_link_libraries(vcsm vcos)
1616

17-
install(TARGETS vcsm DESTINATION lib)
17+
install(TARGETS vcsm DESTINATION ${LIBDIR})
1818
install(FILES user-vcsm.h DESTINATION include/interface/vcsm)

interface/khronos/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ target_link_libraries(GLESv2 EGL khrn_client vcos)
7878
target_link_libraries(WFC EGL)
7979
target_link_libraries(OpenVG EGL)
8080

81-
install(TARGETS EGL GLESv2 OpenVG WFC khrn_client DESTINATION lib)
82-
install(TARGETS EGL_static GLESv2_static khrn_static DESTINATION lib)
81+
install(TARGETS EGL GLESv2 OpenVG WFC khrn_client DESTINATION ${LIBDIR})
82+
install(TARGETS EGL_static GLESv2_static khrn_static DESTINATION ${LIBDIR})
8383

8484
# recommended names to use to avoid conflicts with mesa libs
8585
add_library(brcmEGL ${SHARED} ${EGL_SOURCE})

interface/mmal/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ add_subdirectory(client)
1616

1717
target_link_libraries(mmal mmal_core mmal_util mmal_vc_client vcos mmal_components)
1818

19-
install(TARGETS mmal DESTINATION lib)
19+
install(TARGETS mmal DESTINATION ${LIBDIR})
2020
install(FILES
2121
mmal.h
2222
mmal_buffer.h

interface/mmal/components/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ set(container_libs ${container_libs} containers)
3030
target_link_libraries(mmal_components ${container_libs} mmal_util)
3131
target_link_libraries(mmal_components mmal_core)
3232

33-
install(TARGETS mmal_components DESTINATION lib)
33+
install(TARGETS mmal_components DESTINATION ${LIBDIR})
3434

interface/mmal/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ add_library (mmal_core ${LIBRARY_TYPE}
1313

1414
target_link_libraries (mmal_core vcos)
1515

16-
install(TARGETS mmal_core DESTINATION lib)
16+
install(TARGETS mmal_core DESTINATION ${LIBDIR})
1717
install(FILES
1818
mmal_buffer_private.h
1919
mmal_clock_private.h

0 commit comments

Comments
 (0)