欢迎光临散文网 会员登陆 & 注册

cmake3(end)

2023-03-22 15:34 作者:米诺斯人  | 我要投稿

配置文件:

configure_file(ver.h.in ${PROJECT_BINARY_DIR}/ver.h)

把配置文件里所有 ${cmake_env_variable} 替换为cmake_env_variable的值。比如把const char* path="${PROJECT_BINARY_DIR}" 替换为代码生成的目录的绝对路径/home/jean/xxx/xxx/build

——————————————

子目录sub_dir

脚本语言么,肯定是换个目录继续逐行解释执行。。

唯一需要注意的是变量作用域又更新了;但似乎可以用ALIAS来对外暴露。

——————————————

检测第三方包存在,比如boost


message("finding boost")

# find a boost install with the libraries filesystem and system

find_package(Boost 1.46.1 REQUIRED COMPONENTS filesystem system)


# check if boost was found

if(Boost_FOUND)

    message ("boost found")

else()

    message (FATAL_ERROR "Cannot find Boost")

endif()

不细说了。

————————————————

使用protobuf、ninja、clang等暂时用不到

——————————————————

静态分析:暂时用gcc就完了

(cppcheck、clang等)

————————————————————

单元测试

似乎和包有关,这个也先不急(可以先借鉴cs144的做法)

————————————

包管理

也不急。










cmake3(end)的评论 (共 条)

分享到微博请遵守国家法律