Installing Files — Mastering CMake
cmake.org › mastering-cmake › chapterinstall(DIRECTORY data/icons DESTINATION share/myproject REGEX "/.git$" EXCLUDE REGEX "/[^/]*.txt$" EXCLUDE) which uses ‘/’ and ‘$’ to constrain the match in the same way as the patterns. Consider a similar case in which the input directory contains shell scripts and text files that we wish to install with different permissions than the other files.
cmake应用:安装和打包 - 知乎
https://zhuanlan.zhihu.com/p/377131996cmake --build . --target install # 或者针对make构建工具 make install 更加优雅的方法是在 cmake 3.15版本往后,使用 cmake --install 命令: cmake --install . --prefix "../output" --install 指定构建目录; --prefix 指定安装路径,覆盖安装路径变量 CMAKE_INSTALL_PREFIX 。 二 打包 1 CPack 要使用打包功能,需要执行 include (CPack) 启用相关的功能。
string — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpThis means that the regular expression ^ab+d$ matches abbd but not ababd, and the regular expression ^(ab|cd)$ matches ab but not abd. CMake language Escape Sequences such as \t , \r , , and \\ may be used to construct literal tabs, carriage returns, newlines, and backslashes (respectively) to pass in a regex.
install_files — CMake 3.23.0-rc4 Documentation
cmake.org › cmake › helpIt is provided for compatibility with older CMake code. The FILES form is directly replaced by the FILES form of the install () command. The regexp form can be expressed more clearly using the GLOB form of the file () command. install_files (<dir> extension file file ...) Create rules to install the listed files with the given extension into the given directory.