CMake(跨平台编程工具)使用方法 单个源文件工程 1、源文件编写
假设项目test中只有一个main.cpp源文件,程序用途是计算一个数的指数幂。
#include
#include
/**
* power - Calculate the power of number.
* @param base: Base value.
* @param exponent: Exponent value.
*
* @return base raised to the power exponent.
*/
double power(double base, int exponent)
{
int result = base;
int i;
if (exponent == 0)
{
return 1;
}
for(i = 1; i < exponent; ++i)
{
result = result * base;
}
CMake(跨平台编程工具)常见问题 什么是组态档?
组态档是用一种建构软件专用的特殊编程语言写的CMake脚本。内建C语言、C++、Fortran、Java的自动相依性分析功能。经由CMake脚本语言支持SWIG、Qt、FLTK。内建对微软Visual Studio .NET和过去的Visual Studio版本的支持,可以产生后缀为.dsp、.sln和.vcproj的文档。用传统的时间标签侦测档案内容的改变。支持平行建构(在多台电脑上同时建构)在许多操作系统上进行跨平台编译,包括Linux、POSIX相容的系统(AIX、*BSD、HP-UX、IRIX、MinGW/MSYS、Solaris系统)、Mac OS X和微软Windows 95/98/NT/2000/XP等。产生可以给Graphviz用的全局相依图。已经和Dart、CTest和CPack等软件测试和释出的工具整合。