1 # ==========================
2 # BamTools CMakeLists.txt
3 # (c) 2010 Derek Barnett
6 # ==========================
9 include_directories( ${BamTools_SOURCE_DIR}/src )
11 # add compiler definitions
12 add_definitions( -DBAMTOOLS_API_LIBRARY ) # (for proper exporting of library symbols)
13 add_definitions( -fPIC ) # (attempt to force PIC compiling on CentOS, not being set on shared libs by CMake)
15 # list of all BamTools API source (.cpp) files
16 set( BamToolsAPISources
25 SamReadGroupDictionary.cpp
27 SamSequenceDictionary.cpp
28 internal/BamDeviceFactory_p.cpp
29 internal/BamException_p.cpp
30 internal/BamFile_p.cpp
32 internal/BamHeader_p.cpp
33 internal/BamHttp_p.cpp
34 internal/BamIndexFactory_p.cpp
35 internal/BamMultiReader_p.cpp
36 internal/BamPipe_p.cpp
37 internal/BamRandomAccessController_p.cpp
38 internal/BamReader_p.cpp
39 internal/BamStandardIndex_p.cpp
40 internal/BamToolsIndex_p.cpp
41 internal/BamWriter_p.cpp
42 internal/BgzfStream_p.cpp
43 internal/ILocalIODevice_p.cpp
44 internal/IRemoteIODevice_p.cpp
45 internal/SamFormatParser_p.cpp
46 internal/SamFormatPrinter_p.cpp
47 internal/SamHeaderValidator_p.cpp
50 # create main BamTools API shared library
51 add_library( BamTools SHARED ${BamToolsAPISources} )
52 set_target_properties( BamTools PROPERTIES SOVERSION "2.0.1" )
53 set_target_properties( BamTools PROPERTIES OUTPUT_NAME "bamtools" )
55 # create main BamTools API static library
56 add_library( BamTools-static STATIC ${BamToolsAPISources} )
57 set_target_properties( BamTools-static PROPERTIES OUTPUT_NAME "bamtools" )
58 set_target_properties( BamTools-static PROPERTIES PREFIX "lib" )
60 # link libraries with zlib automatically
61 target_link_libraries( BamTools z )
62 target_link_libraries( BamTools-static z )
64 # set library install destinations
65 install( TARGETS BamTools LIBRARY DESTINATION "lib/bamtools" RUNTIME DESTINATION "bin")
66 install( TARGETS BamTools-static ARCHIVE DESTINATION "lib/bamtools")
69 include(../ExportHeader.cmake)
70 set(ApiIncludeDir "api")
71 ExportHeader(APIHeaders api_global.h ${ApiIncludeDir})
72 ExportHeader(APIHeaders BamAlgorithms.h ${ApiIncludeDir})
73 ExportHeader(APIHeaders BamAlignment.h ${ApiIncludeDir})
74 ExportHeader(APIHeaders BamAux.h ${ApiIncludeDir})
75 ExportHeader(APIHeaders BamConstants.h ${ApiIncludeDir})
76 ExportHeader(APIHeaders BamIndex.h ${ApiIncludeDir})
77 ExportHeader(APIHeaders BamMultiReader.h ${ApiIncludeDir})
78 ExportHeader(APIHeaders BamReader.h ${ApiIncludeDir})
79 ExportHeader(APIHeaders BamWriter.h ${ApiIncludeDir})
80 ExportHeader(APIHeaders IBamIODevice.h ${ApiIncludeDir})
81 ExportHeader(APIHeaders SamConstants.h ${ApiIncludeDir})
82 ExportHeader(APIHeaders SamHeader.h ${ApiIncludeDir})
83 ExportHeader(APIHeaders SamProgram.h ${ApiIncludeDir})
84 ExportHeader(APIHeaders SamProgramChain.h ${ApiIncludeDir})
85 ExportHeader(APIHeaders SamReadGroup.h ${ApiIncludeDir})
86 ExportHeader(APIHeaders SamReadGroupDictionary.h ${ApiIncludeDir})
87 ExportHeader(APIHeaders SamSequence.h ${ApiIncludeDir})
88 ExportHeader(APIHeaders SamSequenceDictionary.h ${ApiIncludeDir})
90 set(AlgorithmsIncludeDir "api/algorithms")
91 ExportHeader(AlgorithmsHeaders algorithms/Sort.h ${AlgorithmsIncludeDir})