码迷,mamicode.com
首页 > Windows程序 > 详细

Cygwin + CMake 测试

时间:2016-05-05 02:06:48      阅读:670      评论:0      收藏:0      [点我收藏+]

标签:

https://www.cygwin.com/

apt-get for cygwin?
wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin
Now that apt-cyg is installed. Here are few examples of installing some packages:
apt-cyg install nano
apt-cyg install git
apt-cyg install ca-certificates

Open Cygwin at a specific folder:
chere -i -t mintty

 


 


https://zh.wikibooks.org/wiki/CMake_%E5%85%A5%E9%96%80/%E7%B0%A1%E5%96%AE%E7%9A%84%E7%AF%84%E4%BE%8B

main.c:
#include <stdio.h>
int main()
{
printf("hello world. \n");
}

CMakeLists.txt:
cmake_minimum_required (VERSION 2.6)
project(ex1)
add_executable(ex1 main.c)

1. 转到目标生成目录:
cd ex1_build_cygwin
2. 生成Makefile:
$ cmake -G "Unix Makefiles" path_of_src
3. make
4. 执行
./ex1.exe

$ cmake -G "MSYS Makefiles"
cmake -G "Visual Studio 9 2008"

 

Cygwin + CMake 测试

标签:

原文地址:http://www.cnblogs.com/wucg/p/5460393.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!