5 function( ExportHeader MODULE FILE DEST )
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} )
14 # get the filename (without path)
15 get_filename_component( FILENAME "${FILE}" NAME )
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}" )
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}" )
30 endfunction( ExportHeader )