共 6 篇文章 |
|
In-source:编译过程文件和源码文件在同一目录下面(在工程目录下cmake)Out-of-sourc:将编译目录和源码目录分割开(在非工程目录下cmake)。CMake变量。CMAKE_BINARY_DIR、CMAKE_SOURCE_DIR.2CMAKE_CURRENT_BINARY_DIR.CMAKE_CURRENT_SOURCE_DIR.7CMAKE_INSTALL_PREFIX目标文件安装目录,默认目录为。8CMAKE_MODULE_PATH定义自己的CMake模块所在路... 阅1265 转3 评0 公众公开 14-03-09 21:13 |
构建多目录工程在tmp目录下创建文件CMakeLists.txt,内容如下: PROJECT (TMP) ADD_DEFINITIONS(-DPOSIX) AUX_SOURCE_DIRECTORY(source/a DIR_SRC_A) AUX_SOURCE_DIRECTORY(source/b DIR_SRC_B) SET(TMP_SRCS main.c ${DIR_SRC_A} ${DIR_SRC_B}) ADD_EXECUTABLE(main ${TMP_SRCS}) 阅2379 转3 评0 公众公开 14-03-09 16:43 |
c)ADD_LIBRARY(hello SHARED STATIC ${LIBHELLO_SRC})#ADD_LIBRARY(hello STATIC ${LIBHELLO_SRC})#INSTALL(TARGETS hello# ARCHIVE DESTINATION lib)#INSTALL(FILES hello.-- Configuring done-- Generating done-- Build files have been written to: /home/onezeroone/work/cmake/ex-5/build[onezeroone@ build]$ makeScanning dependencies... 阅390 转2 评0 公众公开 14-03-09 11:20 |
-- Configuring done-- Generating done-- Build files have been written to: /home/onezeroone/work/cmake/ex-4/build[onezeroone@ build]$ make[100%] Built target hello[onezeroone@ build]$ sudo make install[100%] Built target helloInstall the project.[onezeroone@ build]$ cmake .oLinking C executable main[100%] Built target ... 阅198 转1 评0 公众公开 14-03-09 11:19 |
cmake 0/usr/bin/cmake -E cmake_progress_start /home/onezeroone/work/backup/cmake/ex-3/build/CMakeFiles /home/onezeroone/work/backup/cmake/ex-3/build/CMakeFiles/progress.dir/buildmake[2]: Entering directory `/home/onezeroone/work/backup/cmake/ex-3/build''/usr/bin/cmake -E cmake_progress_report /home/onezeroone/... 阅261 转1 评0 公众公开 14-03-09 11:19 |
阅166 转1 评0 公众公开 14-03-09 11:18 |