6.5 从文件中记录项目版本
准备工作
2.0.1-rc-2#pragma once
#include <string>
const std::string PROGRAM_VERSION = "@PROGRAM_VERSION@";// provides PROGRAM_VERSION
#include "version.hpp"
#include <iostream>
int main() {
std::cout << "This is output from code v" << PROGRAM_VERSION
<< std::endl;
std::cout << "Hello CMake world!" << std::endl;
}具体实施
工作原理
Last updated