1find_program(GZIP gzip) 2file(GLOB FILES *.8) 3set(GZFILES "") 4foreach(FIL ${FILES}) 5 get_filename_component(NAME ${FIL} NAME) 6 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz 7 COMMAND ${GZIP} -c ${FIL} > ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz 8 DEPENDS ${FIL}) 9 list(APPEND GZFILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz") 10endforeach() 11add_custom_target(man ALL DEPENDS ${GZFILES}) 12install(FILES ${GZFILES} DESTINATION share/bcc/man/man8) 13