cmake经常用于构建开源软件,配置和编译的一般步骤如下:
$ mkdir build
$ cd build
$ cmake ../
$ make
编译过程一般是这样的:
[ 1%] Building C object CMakeFiles/websockets.dir/lib/core/alloc.c.o
[ 1%] Building C object CMakeFiles/websockets.dir/lib/core/buflist.c.o
[ 2%] Building C object CMakeFiles/websockets.dir/lib/core/context.c.o
[ 3%] Building C object CMakeFiles/websockets.dir/lib/core/lws_dll.c.o
[ 3%] Building C object CMakeFiles/websockets.dir/lib/core/lws_dll2.c.o
[ 4%] Building C object CMakeFiles/websockets.dir/lib/core/libwebsockets.c.o
[ 5%] Building C object CMakeFiles/websockets.dir/lib/core/logs.c.o
[ 5%] Building C object CMakeFiles/websockets.dir/lib/misc/base64-decode.c.o
[ 6%] Building C object CMakeFiles/websockets.dir/lib/core/vfs.c.o
[ 7%] Building C object CMakeFiles/websockets.dir/lib/misc/lws-ring.c.o
[ 8%] Building C object CMakeFiles/websockets.dir/lib/core-net/dummy-callback.c.o
[ 8%] Building C object CMakeFiles/websockets.dir/lib/core-net/output.c.o
[ 9%] Building C object CMakeFiles/websockets.dir/lib/core-net/close.c.o
[ 10%] Building C object CMakeFiles/websockets.dir/lib/core-net/network.c.o
[ 10%] Building C object CMakeFiles/websockets.dir/lib/core-net/vhost.c.o
[ 11%] Building C object CMakeFiles/websockets.dir/lib/core-net/pollfd.c.o
[ 12%] Building C object CMakeFiles/websockets.dir/lib/core-net/sequencer.c.o
[ 12%] Building C object CMakeFiles/websockets.dir/lib/core-net/service.c.o
[ 13%] Building C object CMakeFiles/websockets.dir/lib/core-net/stats.c.o
[ 14%] Building C object CMakeFiles/websockets.dir/lib/core-net/wsi.c.o
[ 14%] Building C object CMakeFiles/websockets.dir/lib/core-net/wsi-timeout.c.o
[ 15%] Building C object CMakeFiles/websockets.dir/lib/core-net/adopt.c.o
这个编译过程的的打印信息很简洁,看不到编译参数(预定义的宏,指定的头文件搜索路径等)
如果需要查看详细的编译参数,需要这样编译:
make VERBOSE=on