安装

安装自定义的目标对象

install(TARGETS Foo
    LIBRARY DESTINATION lib
    ARCHIVE DESTINATION lib
    RUNTIME DESTINATION bin
    INCLUDES DESTINATION include
    )

安装文件和目录

install(FILES data/foo.png
    DESTINATION /usr/share/icons/hicolor/256x256/apps/
    )
install(DIRECTORY docs
    DESTINATION /usr/share/doc/${PROJECT_NAME}
    FILES_MATCHING PATTERN "*.html"
    )