[med-svn] [Git][med-team/cmaple][master] 2 commits: Create shared libraries
Andreas Tille (@tille)
gitlab at salsa.debian.org
Fri Sep 11 23:51:23 BST 2026
Andreas Tille pushed to branch master at Debian Med / cmaple
Commits:
11dad5d3 by Andreas Tille at 2026-09-11T19:03:41+02:00
Create shared libraries
- - - - -
4d1e2e0d by Andreas Tille at 2026-09-12T00:51:07+02:00
Create a single shared library to provide cmaple API for other packages
- - - - -
5 changed files:
- + debian/cmaple.examples
- debian/control
- debian/patches/series
- + debian/patches/shared_libs_on.patch
- + debian/patches/single_shared_lib.patch
Changes:
=====================================
debian/cmaple.examples
=====================================
@@ -0,0 +1,2 @@
+example/example.maple
+example/tree.nwk
=====================================
debian/control
=====================================
@@ -7,7 +7,6 @@ Section: science
Build-Depends:
debhelper-compat (= 14),
cmake,
- libncl-dev,
libsimde-dev,
zlib1g-dev,
doxygen,
=====================================
debian/patches/series
=====================================
@@ -1 +1,3 @@
debian-packaged-libs.patch
+shared_libs_on.patch
+single_shared_lib.patch
=====================================
debian/patches/shared_libs_on.patch
=====================================
@@ -0,0 +1,40 @@
+Description: Create shared libraries
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2026-09-11
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -93,7 +93,7 @@ set (cmaple_VERSION_MAJOR 2)
+ set (cmaple_VERSION_MINOR 0)
+ set (cmaple_VERSION_PATCH ".0")
+
+-option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
++option(BUILD_SHARED_LIBS "Build Shared Libraries" ON)
+ option(INSTALL_CMAPLE "Enable installation of CMAPLE. (Projects integrating CMAPLE may want to turn this OFF.)" ON)
+
+ ##################################################################
+@@ -269,12 +269,14 @@ endif()
+ if(ZLIB_FOUND)
+ message ("Using system zlib")
+ include_directories(${ZLIB_INCLUDE_DIRS})
++ set(ZLIB_TARGET ${ZLIB_LIBRARIES})
+ else(ZLIB_FOUND)
+ message ("Using own zlib-1.2.7")
+ include_directories("${PROJECT_BINARY_DIR}/libraries/zlib-1.2.7" "${PROJECT_SOURCE_DIR}/libraries/zlib-1.2.7")
+ if (NOT TARGET zlibstatic)
+ add_subdirectory(libraries/zlib-1.2.7)
+ endif()
++ set(ZLIB_TARGET zlibstatic)
+ endif(ZLIB_FOUND)
+
+ ##################################################################
+--- a/utils/CMakeLists.txt
++++ b/utils/CMakeLists.txt
+@@ -6,6 +6,7 @@ gzstream.h gzstream.cpp
+ matrix.h
+ logstream.h logstream.cpp
+ )
++target_link_libraries(cmaple_utils PUBLIC ${ZLIB_LIBRARIES})
+
+ if(CLANG AND WIN32)
+ if (BINARY32)
=====================================
debian/patches/single_shared_lib.patch
=====================================
@@ -0,0 +1,72 @@
+Description: Create a single shared library to provide cmaple API for other packages
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2026-09-11
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -71,8 +71,11 @@ endif()
+
+ project(cmaple)
+ add_definitions(-DCMAPLE)
++add_definitions(-DNUM_STATES=4)
+ set(CMAKE_CXX_STANDARD 20)
+
++set(CMAKE_POSITION_INDEPENDENT_CODE ON)
++
+ # Add policy to avoid warnings
+ cmake_policy(SET CMP0069 NEW)
+ set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
+@@ -316,6 +319,24 @@ add_subdirectory(tree)
+ add_subdirectory(maple)
+ add_subdirectory(unittest)
+
++# --- Build combined single shared library for Debian ---
++add_library(cmaple_shared SHARED
++ $<TARGET_OBJECTS:maple>
++ $<TARGET_OBJECTS:cmaple_tree>
++ $<TARGET_OBJECTS:cmaple_model>
++ $<TARGET_OBJECTS:cmaple_alignment>
++ $<TARGET_OBJECTS:cmaple_utils>
++ $<TARGET_OBJECTS:ncl>
++ $<TARGET_OBJECTS:nclextra>
++)
++
++set_target_properties(cmaple_shared PROPERTIES
++ OUTPUT_NAME "cmaple"
++ VERSION ${cmaple_VERSION_MAJOR}.${cmaple_VERSION_MINOR}${cmaple_VERSION_PATCH}
++ SOVERSION ${cmaple_VERSION_MAJOR}
++)
++
++target_link_libraries(cmaple_shared PUBLIC ${ZLIB_LIBRARIES})
+
+ ##################################################################
+ # the main executable
+@@ -337,9 +358,9 @@ endif(Backtrace_FOUND)
+ # setup linking flags
+ ##################################################################
+
+-target_link_libraries(cmaple PUBLIC maple cmaple_tree cmaple_model ncl nclextra)
++target_link_libraries(cmaple PUBLIC cmaple_shared)
+ if (USE_CMAPLE_AA)
+- target_link_libraries(cmaple-aa PUBLIC maple-aa cmaple_tree-aa cmaple_model-aa ncl nclextra)
++ target_link_libraries(cmaple-aa PUBLIC cmaple_shared)
+ endif()
+
+ ##############################################################
+@@ -347,11 +368,14 @@ endif()
+ ##############################################################
+ if (INSTALL_CMAPLE)
+ install (TARGETS cmaple DESTINATION bin)
++ install (TARGETS cmaple_shared
++ LIBRARY DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}
++ ARCHIVE DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE})
+ if (USE_CMAPLE_AA)
+ install (TARGETS cmaple-aa DESTINATION bin)
+ endif()
+- install (FILES "${PROJECT_SOURCE_DIR}/example/example.maple" DESTINATION .)
+- install (FILES "${PROJECT_SOURCE_DIR}/example/tree.nwk" DESTINATION .)
++# install (FILES "${PROJECT_SOURCE_DIR}/example/example.maple" DESTINATION .)
++# install (FILES "${PROJECT_SOURCE_DIR}/example/tree.nwk" DESTINATION .)
+ #install (FILES "${PROJECT_BINARY_DIR}/cmaple_config.h" DESTINATION "include")
+ #install(DIRECTORY "${PROJECT_SOURCE_DIR}/" # source directory
+ # DESTINATION "include/cmaple" # target directory
View it on GitLab: https://salsa.debian.org/med-team/cmaple/-/compare/8c58df6a8ac41e435d300b1993ca75a598448016...4d1e2e0db16c74f0e73e424ce446faab4212b39b
--
View it on GitLab: https://salsa.debian.org/med-team/cmaple/-/compare/8c58df6a8ac41e435d300b1993ca75a598448016...4d1e2e0db16c74f0e73e424ce446faab4212b39b
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260911/5a8c21f2/attachment-0001.htm>
More information about the debian-med-commit
mailing list