summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Tille <tille@debian.org>2021-11-06 19:31:45 +0100
committerÉtienne Mollier <emollier@debian.org>2021-11-06 19:31:45 +0100
commit813f597987feb280773fd82d6f3fa004962fcf52 (patch)
treee8136da762dd362c80c3c291ee001af6a68a4f2b
parent3163d9c563067feb60afe9cda7bd8c5e75f6b4aa (diff)
Build additional static lib
Last-Update: Wed, 27 May 2020 09:59:29 +0200 Gbp-Pq: Name shared_and_static.patch
-rw-r--r--src/api/CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
index 0c71cb6..4cfacb2 100644
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -38,18 +38,24 @@ if( WIN32 )
endif()
# create main BamTools API library
-add_library( BamTools ${BamToolsAPISources} )
+add_library( BamTools SHARED ${BamToolsAPISources} )
+add_library( BamTools_static STATIC ${BamToolsAPISources} )
# The SONAME is bumped on every version increment
# as Bamtools does not yet guarantee a stable ABI
set_target_properties( BamTools PROPERTIES
SOVERSION "${BamTools_VERSION}"
OUTPUT_NAME "bamtools" )
+set_target_properties( BamTools_static PROPERTIES
+ OUTPUT_NAME "bamtools" )
target_include_directories( BamTools PRIVATE "${ZLIB_INCLUDE_DIRS}" )
target_link_libraries( BamTools PRIVATE "${ZLIB_LIBRARIES}" "${WIN32_LIBRARIES}" )
install( TARGETS BamTools
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" )
+install( TARGETS BamTools_static
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" )
install( FILES api_global.h DESTINATION "include/bamtools/api" COMPONENT Development )
install( FILES BamAlgorithms.h DESTINATION "include/bamtools/api" COMPONENT Development )