]> git.donarmstrong.com Git - bamtools.git/blob - src/api/CMakeLists.txt
Cleaned up intra-API includes & moved version numbers to 2.0.0
[bamtools.git] / src / api / CMakeLists.txt
1 # ==========================
2 # BamTools CMakeLists.txt
3 # (c) 2010 Derek Barnett
4 #
5 # src/api/
6 # ==========================
7
8 # list include paths
9 include_directories( ${BamTools_SOURCE_DIR}/src )
10
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)
14
15 # list of all BamTools API source (.cpp) files
16 set( BamToolsAPISources
17         BamAlignment.cpp
18         BamMultiReader.cpp
19         BamReader.cpp
20         BamWriter.cpp
21         SamHeader.cpp
22         SamProgram.cpp
23         SamProgramChain.cpp
24         SamReadGroup.cpp
25         SamReadGroupDictionary.cpp
26         SamSequence.cpp
27         SamSequenceDictionary.cpp
28         internal/BamDeviceFactory_p.cpp
29         internal/BamException_p.cpp
30         internal/BamFile_p.cpp
31         internal/BamFtp_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
48 )
49
50 # create main BamTools API shared library
51 add_library( BamTools SHARED ${BamToolsAPISources} )
52 set_target_properties( BamTools PROPERTIES SOVERSION "2.0.0" )
53 set_target_properties( BamTools PROPERTIES OUTPUT_NAME "bamtools" )
54
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" )
59
60 # link libraries with zlib automatically
61 target_link_libraries( BamTools z )
62 target_link_libraries( BamTools-static z )
63
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")
67
68 # export API headers
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})
89
90 set(AlgorithmsIncludeDir "api/algorithms")
91 ExportHeader(AlgorithmsHeaders algorithms/Sort.h ${AlgorithmsIncludeDir})