mcstructs使用CMake生成Makefile文件
CMakeLists.txt
project(MCSTRUCTS)
set(SRC_LIST src/main.c src/mcslist.c src/mcsringbuf.c)
add_executable(mcstructs ${SRC_LIST})
执行过程:
merlin@tfAnalysis:~/projects/mcstructs$ cmake .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/merlin/projects/mcstructs
merlin@tfAnalysis:~/projects/mcstructs$ ls
CMakeLists.txt README.md src
merlin@tfAnalysis:~/projects/mcstructs$ cmake .
-- The C compiler identification is GNU 4.8.
-- The CXX compiler identification is GNU 4.8.
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/merlin/projects/mcstructs
merlin@tfAnalysis:~/projects/mcstructs$ ls
CMakeCache.txt cmake_install.cmake Makefile src
CMakeFiles CMakeLists.txt README.md
merlin@tfAnalysis:~/projects/mcstructs$ make
Scanning dependencies of target mcstructs
[ %] Building C object CMakeFiles/mcstructs.dir/src/main.c.o
[ %] Building C object CMakeFiles/mcstructs.dir/src/mcslist.c.o
[%] Building C object CMakeFiles/mcstructs.dir/src/mcsringbuf.c.o
Linking C executable mcstructs
[%] Built target mcstructs
merlin@tfAnalysis:~/projects/mcstructs$ ./mcstructs
++++Micro C Structs(mcstructs) Test utils++++
merlin<tfa2012@foxmail.com> TEST: Micro C Structs list add/delete/find functions:
add list header 'header'(0x0804c040)
mcs_list_add_item 'n1'(0xbfed9d78) => 'header'(0x0804c040)
mcs_list_add_item 'n2'(0xbfed9d90) => 'header'(0x0804c040)
mcs_list_add_item 'n3'(0xbfed9da8) => 'header'(0x0804c040)
mcs_list_add_item_by_key 'n4'(KEY:, 0xbfed9dc0) => 'header'(0x0804c040)
mcs_list_add_item_by_key 'n5'(KEY:, 0xbfed9dd8) => 'header'(0x0804c040)
mcs_list_delete_item 'n2'(0xbfed9d90) => 'header'(0x0804c040)
mcs_list_delete_item 'n1'(0xbfed9d78) => 'header'(0x0804c040)
mcs_list_find_item_by_key KEY:(0xbfed9d6c) => 'header'(0x0804c040)
mcs_list_delete_item ERROR:-
TEST: Micro C Structs list end.
merlin@tfAnalysis:~/projects/mcstructs$
mcstructs使用CMake生成Makefile文件的更多相关文章
- cmake利用toolchain.cmake生成makefile之后,make生成静态库失败问题
问题描述 利用toolchian.cmake设置好编译器后,利用make指令生成静态库,出现以下问题 Error running link command: No such file or direc ...
- 利用 autoconf 和 automake 生成 Makefile 文件
一.相关概念的介绍 什么是 Makefile?怎么书写 Makefile?竟然有工具可以自动生成 Makefile?怎么生成啊?开始的时候,我有这么多疑问,所以,必须得先把基本的概念搞个清楚. 1.M ...
- linux下使用automake工具自动生成makefile文件
linux环境下,当项目工程很大的时候,编译的过程很复杂,所以需要使用make工具,自动进行编译安装,但是手写makefile文件比较复杂,所幸在GNU的计划中,设计出了一种叫做Autoconf/Au ...
- 使用automake等命令自动生成Makefile文件 (转载)
使用automake等命令自动生成Makefile文件 Linux下编程时,为了方便编译,往往使用Makefile文件自动完成编译,但是Makefile文件本身的书写十分复杂,规则很多.好在Lin ...
- 利用qmake生成Makefile文件
在linux下写程序,免不了要写Makefile文件,用automake,总感觉比较麻烦,linux人喜欢做麻烦的事,以显得风格迥异. 其实用qmake生成Makefile文件相当简单. 1 装好qm ...
- 例解 autoconf 和 automake 生成 Makefile 文件
本文介绍了在 linux 系统中,通过 Gnu autoconf 和 automake 生成 Makefile 的方法.主要探讨了生成 Makefile 的来龙去脉及其机理,接着详细介绍了配置 Con ...
- 使用autoconf和automake生成Makefile文件(转)
Makefile好难写 曾经也总结了一篇关于Makefile的文章<make和makefile的简单学习>.但是,总结完以后,发现写Makefile真的是一件非常痛苦的事情,的确非常痛苦. ...
- 自动生成Makefile文件
主要的工具有autoscan, aclocal, autoheader, autoconfig,automake 1 .创建c源文件hello.c #include <stdio.h> i ...
- 生成makefile文件编译源文件
1.利用CodeBlock的cbp文件生成makefile文件 reverse@ubuntu:~/Desktop/CreateMakeFile$ ls cbp2make.linux-x86 freeg ...
随机推荐
- 设计模式之空对象(Null Object)模式
通过引用Null Object,用于取消业务逻辑中对对象的为空推断 类图: Nullable: package com.demo.user; public interface Nullable { b ...
- Web API之消息处理管道
Web API之消息处理管道 前言 MVC有一套请求处理的机制,当然Web API也有自己的一套消息处理管道,该消息处理管道贯穿始终都是通过HttpMessageHandler来完成.我们知道请求信息 ...
- zoj-3792-Romantic Value-最小割+数值转化
假设不须要求边的个数的话,就是一个裸的最小割问题. 求边的个数就用边的权值记录一下. #include <stdio.h> #include <iostream> #inclu ...
- CSV文件格式分析器执行:从字符串Split至FSM
本文乃Siliphen原创,转载请注明出处:http://blog.csdn.net/stevenkylelee/article/details/38309147 本文分为5小节,基本上就是我刚接触C ...
- iOS 生成随机颜色(UIColor)
#import <UIKit/UIKit.h> @interface UIColor (RandomColor) +(UIColor *) randomColor; @end #impor ...
- 新秀系列C/C++经典问题(四)
一个主题:查找最小的k个元素 输入n个整数.输出当中最小的k个. . 分析:这道题最简单的思路莫过于把输入的n个整数排序,这样排在最前面的k个数就是最小的k个数. 仅仅是这样的思路的时间复杂度为O(n ...
- SyntaxHighlighter代码高亮插件
SyntaxHighlighter它是Google Code在一个开源项目,主要用于对代码着色页, 使用十分方便,效果也不错,并且差点儿支持常见的全部语言. 使用步骤: 一.下载并解压缩SyntaxH ...
- [DB][mybatis]MyBatis mapper文件引用变量#{}与${}差异
MyBatis mapper文件引用变量#{}与${}差异 默认,使用#{}语法,MyBatis会产生PreparedStatement中.而且安全的设置PreparedStatement參数,这个过 ...
- OJ提交题目中的语言选项里G++与C++的区别(转载)
原文链接:http://blog.polossk.com/201405/c-plus-plus-g-plus-plus G++? 首先更正一个概念,C++是一门计算机编程语言,G++不是语言,是一款编 ...
- Ajax.BeginForm的异步提交数据 简介
Html.BeginForm与Ajax.BeginForm都是MVC架构中的表单元素,它们从字面上可以看到区别,即Html.BeginForm是普通的表单提交,而Ajax.BeginForm是支持异步 ...