1file(GLOB C_FILES *.c) 2file(GLOB PY_FILES *.py) 3file(GLOB SH_FILES *.sh) 4file(GLOB TXT_FILES *.txt) 5list(REMOVE_ITEM TXT_FILES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) 6foreach(FIL ${PY_FILES}) 7 get_filename_component(FIL_WE ${FIL} NAME_WE) 8 install(PROGRAMS ${FIL} DESTINATION share/bcc/tools RENAME ${FIL_WE}) 9endforeach() 10foreach(FIL ${SH_FILES}) 11 if(${FIL} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/reset-trace.sh) 12 get_filename_component(FIL_WE ${FIL} NAME_WE) 13 install(PROGRAMS ${FIL} DESTINATION share/bcc/tools RENAME ${FIL_WE}) 14 else() 15 file(READ ${FIL} CONTENT) 16 string(REPLACE ".py -l" " -l" CONTENT_WE ${CONTENT}) 17 string(REPLACE "\"" "\\\"" CONTENT_WE ${CONTENT_WE}) 18 get_filename_component(FIL_WE ${FIL} NAME_WE) 19 install(PROGRAMS ${FIL} DESTINATION share/bcc/tools RENAME ${FIL_WE}) 20 install(CODE "file(WRITE \"\$ENV{DESTDIR}/\${CMAKE_INSTALL_PREFIX}/share/bcc/tools/${FIL_WE}\" \"${CONTENT_WE}\")") 21 endif() 22endforeach() 23install(FILES ${C_FILES} DESTINATION share/bcc/tools) 24install(FILES ${TXT_FILES} DESTINATION share/bcc/tools/doc) 25add_subdirectory(lib) 26add_subdirectory(old) 27