X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2FCMakeLists.txt;h=5b66ec024b072c50cd2941ca241e2df23f27aa4d;hb=bafc03f4ed7ed9ff1b3fb24874dc8a4a6d58e605;hp=3e2ddd5b022ac309a3f5e0dce80f8d36754485be;hpb=af6a3d8491e485969d2df306e41cb9439dec4039;p=bamtools.git diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt index 3e2ddd5..5b66ec0 100644 --- a/src/api/CMakeLists.txt +++ b/src/api/CMakeLists.txt @@ -12,7 +12,10 @@ include_directories( ${BamTools_SOURCE_DIR}/src ) add_definitions( -DBAMTOOLS_API_LIBRARY ) # (for proper exporting of library symbols) add_definitions( -fPIC ) # (attempt to force PIC compiling on CentOS, not being set on shared libs by CMake) -# list of all BamTools API source (.cpp) files +# fetch all internal source files +add_subdirectory ( internal ) + +# make list of all API source files set( BamToolsAPISources BamAlignment.cpp BamMultiReader.cpp @@ -25,41 +28,30 @@ set( BamToolsAPISources SamReadGroupDictionary.cpp SamSequence.cpp SamSequenceDictionary.cpp - internal/BamDeviceFactory_p.cpp - internal/BamException_p.cpp - internal/BamFile_p.cpp - internal/BamFtp_p.cpp - internal/BamHeader_p.cpp - internal/BamHttp_p.cpp - internal/BamIndexFactory_p.cpp - internal/BamMultiReader_p.cpp - internal/BamPipe_p.cpp - internal/BamRandomAccessController_p.cpp - internal/BamReader_p.cpp - internal/BamStandardIndex_p.cpp - internal/BamToolsIndex_p.cpp - internal/BamWriter_p.cpp - internal/BgzfStream_p.cpp - internal/ILocalIODevice_p.cpp - internal/IRemoteIODevice_p.cpp - internal/SamFormatParser_p.cpp - internal/SamFormatPrinter_p.cpp - internal/SamHeaderValidator_p.cpp + ${InternalSources} ) # create main BamTools API shared library add_library( BamTools SHARED ${BamToolsAPISources} ) -set_target_properties( BamTools PROPERTIES SOVERSION "2.0.3" ) -set_target_properties( BamTools PROPERTIES OUTPUT_NAME "bamtools" ) +set_target_properties( BamTools PROPERTIES + SOVERSION "2.2.0" + OUTPUT_NAME "bamtools" ) # create main BamTools API static library add_library( BamTools-static STATIC ${BamToolsAPISources} ) -set_target_properties( BamTools-static PROPERTIES OUTPUT_NAME "bamtools" ) -set_target_properties( BamTools-static PROPERTIES PREFIX "lib" ) +set_target_properties( BamTools-static PROPERTIES + OUTPUT_NAME "bamtools" + PREFIX "lib" ) + +# link libraries automatically with zlib (and Winsock2, if applicable) +if( _WIN32 ) + set( APILibs z ws2_32 ) +else( _WIN32 ) + set( APILibs z ) +endif( _WIN32 ) -# link libraries with zlib automatically -target_link_libraries( BamTools z ) -target_link_libraries( BamTools-static z ) +target_link_libraries( BamTools ${APILibs} ) +target_link_libraries( BamTools-static ${APILibs} ) # set library install destinations install( TARGETS BamTools LIBRARY DESTINATION "lib/bamtools" RUNTIME DESTINATION "bin") @@ -69,7 +61,7 @@ install( TARGETS BamTools-static ARCHIVE DESTINATION "lib/bamtools") include(../ExportHeader.cmake) set(ApiIncludeDir "api") ExportHeader(APIHeaders api_global.h ${ApiIncludeDir}) -ExportHeader(APIHeaders BamAlgorithms.h ${ApiIncludeDir}) +ExportHeader(APIHeaders BamAlgorithms.h ${ApiIncludeDir}) ExportHeader(APIHeaders BamAlignment.h ${ApiIncludeDir}) ExportHeader(APIHeaders BamAux.h ${ApiIncludeDir}) ExportHeader(APIHeaders BamConstants.h ${ApiIncludeDir}) @@ -87,5 +79,5 @@ ExportHeader(APIHeaders SamReadGroupDictionary.h ${ApiIncludeDir}) ExportHeader(APIHeaders SamSequence.h ${ApiIncludeDir}) ExportHeader(APIHeaders SamSequenceDictionary.h ${ApiIncludeDir}) -set(AlgorithmsIncludeDir "api/algorithms") -ExportHeader(AlgorithmsHeaders algorithms/Sort.h ${AlgorithmsIncludeDir}) +set( AlgorithmsIncludeDir "api/algorithms" ) +ExportHeader( AlgorithmsHeaders algorithms/Sort.h ${AlgorithmsIncludeDir} )