]> git.donarmstrong.com Git - bamtools.git/blob - src/ExportHeader.cmake
Fix: unmapped reads now pushed to end of coordinate-sorted BAM
[bamtools.git] / src / ExportHeader.cmake
1 #
2 # ExportHeader
3 #
4
5 function( ExportHeader MODULE FILE DEST )
6
7     # if haven't defined our custom 'build target'
8     # not exactly a build target, but lets this command get
9     # checked any time build step happens
10     if (NOT TARGET ${MODULE})
11         add_custom_target( ${MODULE} ALL COMMENT "Exporting ${MODULE}" )
12     endif (NOT TARGET ${MODULE} )
13
14     # get the filename (without path)
15     get_filename_component( FILENAME "${FILE}" NAME )
16
17     # copy header to destination
18     add_custom_command( TARGET ${MODULE} COMMAND
19         ${CMAKE_COMMAND} -E copy_if_different
20         "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}"
21         "${CMAKE_SOURCE_DIR}/include/${DEST}/${FILENAME}" )
22
23
24
25     # make sure files are properly 'installed'
26    # set(INSTALL_DEST "bamtools/${DEST}")
27    # install( FILES "${FILE}" DESTINATION "${INSTALL_DEST}")
28     install( FILES "${FILE}" DESTINATION "include/bamtools/${DEST}" )
29
30 endfunction( ExportHeader )
31