Skip to content

Commit eca5a3c

Browse files
martinezjaviernaushir
authored andcommitted
build: Set a SONAME version in the libraries
The libraries built are currently unversioned, but donwstream users expect these to have a proper SONAME version in order to package them. Most Linux distributions packaging guidelines for example have this as a requirement. There are alredy released versions and git tags, so let's use those as the libraries version, and the major number as the SONAME version. This is the convention used by most projects. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
1 parent dc86fee commit eca5a3c

File tree

7 files changed

+7
-2
lines changed

7 files changed

+7
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.6)
22

3-
project(libcamera-apps)
3+
project(libcamera-apps VERSION 1.1.0)
44

55
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
66
if (NOT CMAKE_BUILD_TYPE)

core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set_source_files_properties(version.cpp PROPERTIES GENERATED 1)
1010
add_library(libcamera_app libcamera_app.cpp post_processor.cpp version.cpp options.cpp)
1111
add_dependencies(libcamera_app VersionCpp)
1212

13-
set_target_properties(libcamera_app PROPERTIES PREFIX "" IMPORT_PREFIX "")
13+
set_target_properties(libcamera_app PROPERTIES PREFIX "" IMPORT_PREFIX "" VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
1414
target_link_libraries(libcamera_app pthread preview ${LIBCAMERA_LINK_LIBRARIES} ${Boost_LIBRARIES} post_processing_stages)
1515

1616
install(TARGETS libcamera_app LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

encoder/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ else()
3131
endif()
3232

3333
add_library(encoders ${SRC})
34+
set_target_properties(encoders PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
3435
target_link_libraries(encoders ${TARGET_LIBS})
3536
target_compile_definitions(encoders PUBLIC LIBAV_PRESENT=${LIBAV_PRESENT})
3637

image/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ find_library(TIFF_LIBRARY tiff REQUIRED)
88
find_library(PNG_LIBRARY png REQUIRED)
99

1010
add_library(images bmp.cpp yuv.cpp jpeg.cpp png.cpp dng.cpp)
11+
set_target_properties(images PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
1112
target_link_libraries(images jpeg exif png tiff)
1213

1314
install(TARGETS images LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

output/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.6)
33
include(GNUInstallDirs)
44

55
add_library(outputs output.cpp file_output.cpp net_output.cpp circular_output.cpp)
6+
set_target_properties(outputs PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
67

78
install(TARGETS outputs LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
89

post_processing_stages/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ else()
4949
endif()
5050

5151
add_library(post_processing_stages ${SRC})
52+
set_target_properties(post_processing_stages PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
5253
target_link_libraries(post_processing_stages ${TARGET_LIBS})
5354
target_compile_definitions(post_processing_stages PUBLIC OPENCV_PRESENT=${OpenCV_FOUND})
5455

preview/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ else()
6464
endif()
6565

6666
add_library(preview null_preview.cpp ${SRC})
67+
set_target_properties(preview PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
6768
target_link_libraries(preview ${TARGET_LIBS})
6869

6970
target_compile_definitions(preview PUBLIC LIBDRM_PRESENT=${DRM_FOUND})

0 commit comments

Comments
 (0)