From 312dc06a1c6de078128d6d58633109eb277fa22f Mon Sep 17 00:00:00 2001 From: Jonathan Steffan Date: Tue, 21 May 2024 18:32:55 -0600 Subject: [PATCH] Add SONAME Versioning - Add SOVERSION to all SOs --- components/pango_core/CMakeLists.txt | 3 +++ components/pango_display/CMakeLists.txt | 4 ++++ components/pango_geometry/CMakeLists.txt | 4 ++++ components/pango_glgeometry/CMakeLists.txt | 4 ++++ components/pango_image/CMakeLists.txt | 4 ++++ components/pango_opengl/CMakeLists.txt | 4 ++++ components/pango_packetstream/CMakeLists.txt | 4 ++++ components/pango_plot/CMakeLists.txt | 4 ++++ components/pango_python/CMakeLists.txt | 11 +++++++++++ components/pango_scene/CMakeLists.txt | 4 ++++ components/pango_tools/CMakeLists.txt | 4 ++++ components/pango_vars/CMakeLists.txt | 4 ++++ components/pango_video/CMakeLists.txt | 4 ++++ components/pango_windowing/CMakeLists.txt | 3 +++ components/tinyobj/CMakeLists.txt | 5 +++++ 15 files changed, 66 insertions(+) diff --git a/components/pango_core/CMakeLists.txt b/components/pango_core/CMakeLists.txt index 23fedecb4..e3c6044c8 100644 --- a/components/pango_core/CMakeLists.txt +++ b/components/pango_core/CMakeLists.txt @@ -36,6 +36,9 @@ elseif(WIN32 OR WIN64) target_link_libraries(${COMPONENT} PRIVATE shlwapi.lib) endif() +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) target_compile_features(${COMPONENT} PUBLIC cxx_decltype_auto ) target_include_directories(${COMPONENT} PUBLIC diff --git a/components/pango_display/CMakeLists.txt b/components/pango_display/CMakeLists.txt index 3a7c4b87c..79e40b145 100644 --- a/components/pango_display/CMakeLists.txt +++ b/components/pango_display/CMakeLists.txt @@ -16,6 +16,10 @@ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/fonts.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} PUBLIC pango_core pango_opengl pango_windowing pango_vars ) target_include_directories(${COMPONENT} PUBLIC diff --git a/components/pango_geometry/CMakeLists.txt b/components/pango_geometry/CMakeLists.txt index 01deabf05..281209fae 100644 --- a/components/pango_geometry/CMakeLists.txt +++ b/components/pango_geometry/CMakeLists.txt @@ -10,6 +10,10 @@ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/geometry_ply.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} pango_core pango_image tinyobj Eigen3::Eigen) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_glgeometry/CMakeLists.txt b/components/pango_glgeometry/CMakeLists.txt index bc0164f75..fcac936db 100644 --- a/components/pango_glgeometry/CMakeLists.txt +++ b/components/pango_glgeometry/CMakeLists.txt @@ -5,6 +5,10 @@ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/glgeometry.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} pango_geometry pango_opengl) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_image/CMakeLists.txt b/components/pango_image/CMakeLists.txt index dbd8832c3..b82e7c3fb 100644 --- a/components/pango_image/CMakeLists.txt +++ b/components/pango_image/CMakeLists.txt @@ -105,6 +105,10 @@ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/image_io_tiff.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} PUBLIC pango_core Eigen3::Eigen) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_opengl/CMakeLists.txt b/components/pango_opengl/CMakeLists.txt index 7b04bf7f3..e48e1d174 100644 --- a/components/pango_opengl/CMakeLists.txt +++ b/components/pango_opengl/CMakeLists.txt @@ -26,6 +26,10 @@ find_package(Eigen3 REQUIRED NO_MODULE) message(STATUS "Found Eigen: '${EIGEN3_INCLUDE_DIRS}'") target_compile_definitions(${COMPONENT} PUBLIC HAVE_EIGEN HAVE_GLEW) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} PUBLIC pango_core pango_image Eigen3::Eigen) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_packetstream/CMakeLists.txt b/components/pango_packetstream/CMakeLists.txt index 1b4ee9040..2b08d229c 100644 --- a/components/pango_packetstream/CMakeLists.txt +++ b/components/pango_packetstream/CMakeLists.txt @@ -9,6 +9,10 @@ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/playback_session.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_compile_definitions(${COMPONENT} PRIVATE "PANGOLIN_VERSION_STRING=\"${PANGOLIN_VERSION}\"") target_link_libraries(${COMPONENT} PUBLIC pango_core) target_include_directories(${COMPONENT} PUBLIC diff --git a/components/pango_plot/CMakeLists.txt b/components/pango_plot/CMakeLists.txt index 62ce1bd13..c2c3d96a9 100644 --- a/components/pango_plot/CMakeLists.txt +++ b/components/pango_plot/CMakeLists.txt @@ -7,6 +7,10 @@ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/loaders/csv_table_loader.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} pango_display) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_python/CMakeLists.txt b/components/pango_python/CMakeLists.txt index 9edf9c078..bfe77af07 100644 --- a/components/pango_python/CMakeLists.txt +++ b/components/pango_python/CMakeLists.txt @@ -54,6 +54,11 @@ if(BUILD_PANGOLIN_PYTHON AND Python_FOUND AND pybind11_FOUND) target_link_libraries(${COMPONENT} PUBLIC pango_core pango_display pango_plot pango_video pango_vars ) + + set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} + ) + target_link_libraries(${COMPONENT} PRIVATE pybind11::embed ) target_include_directories(${COMPONENT} PUBLIC $ @@ -73,6 +78,12 @@ if(BUILD_PANGOLIN_PYTHON AND Python_FOUND AND pybind11_FOUND) $ ) + if (NOT APPLE) + set_target_properties( + pypangolin PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} + ) + endif() + # To prevent some visibility warnings. # https://pybind11.readthedocs.io/en/stable/faq.html#someclass-declared-with-greater-visibility-than-the-type-of-its-field-someclass-member-wattributes set_target_properties(pypangolin PROPERTIES CXX_VISIBILITY_PRESET hidden) diff --git a/components/pango_scene/CMakeLists.txt b/components/pango_scene/CMakeLists.txt index 4b585acba..24d998f50 100644 --- a/components/pango_scene/CMakeLists.txt +++ b/components/pango_scene/CMakeLists.txt @@ -5,6 +5,10 @@ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/renderable.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} PUBLIC pango_opengl) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_tools/CMakeLists.txt b/components/pango_tools/CMakeLists.txt index e2f836d9b..455478aa0 100644 --- a/components/pango_tools/CMakeLists.txt +++ b/components/pango_tools/CMakeLists.txt @@ -5,6 +5,10 @@ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/video_viewer.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} PUBLIC pango_display pango_video) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_vars/CMakeLists.txt b/components/pango_vars/CMakeLists.txt index f216c5467..724f8a558 100644 --- a/components/pango_vars/CMakeLists.txt +++ b/components/pango_vars/CMakeLists.txt @@ -6,6 +6,10 @@ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/varstate.cpp ) +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} PUBLIC pango_core) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_video/CMakeLists.txt b/components/pango_video/CMakeLists.txt index b2fc96583..fc7f1af6c 100644 --- a/components/pango_video/CMakeLists.txt +++ b/components/pango_video/CMakeLists.txt @@ -215,6 +215,10 @@ endif() ######################################################### +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + target_link_libraries(${COMPONENT} PUBLIC pango_core pango_image pango_packetstream) target_include_directories(${COMPONENT} PUBLIC $ diff --git a/components/pango_windowing/CMakeLists.txt b/components/pango_windowing/CMakeLists.txt index ffc9ad66f..3fbf69a65 100644 --- a/components/pango_windowing/CMakeLists.txt +++ b/components/pango_windowing/CMakeLists.txt @@ -86,6 +86,9 @@ if(OpenGL_EGL_FOUND) PangolinRegisterFactory(WindowInterface HeadlessWindow) endif() +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) target_sources(${COMPONENT} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/window.cpp) target_link_libraries(${COMPONENT} PUBLIC pango_core pango_opengl ) diff --git a/components/tinyobj/CMakeLists.txt b/components/tinyobj/CMakeLists.txt index 207e00d98..fa66204dc 100644 --- a/components/tinyobj/CMakeLists.txt +++ b/components/tinyobj/CMakeLists.txt @@ -1,6 +1,11 @@ set(COMPONENT tinyobj) target_sources( ${COMPONENT} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/src/tinyobj.cpp") + +set_target_properties( + ${COMPONENT} PROPERTIES VERSION ${PANGOLIN_VERSION} SOVERSION ${PANGOLIN_VERSION_MAJOR} +) + set_property(TARGET ${COMPONENT} PROPERTY CXX_STANDARD 11) target_include_directories(${COMPONENT} PUBLIC $