cmake3(end)
配置文件:
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
腳本語言么,肯定是換個目錄繼續(xù)逐行解釋執(zhí)行。。
唯一需要注意的是變量作用域又更新了;但似乎可以用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等暫時用不到
——————————————————
靜態(tài)分析:暫時用gcc就完了
(cppcheck、clang等)
————————————————————
單元測試
似乎和包有關(guān),這個也先不急(可以先借鑒cs144的做法)
————————————
包管理
也不急。