cmake

来源:互联网 发布:编写网站的软件 编辑:程序博客网 时间:2024/05/09 17:01
1
2
3
cmake_minimum_required(VERSION 2.8.9)
project (hello)
add_executable(hello helloworld.cpp)


The CMakeLists.txt file in Listing 2 consists of only three lines:

  • The first line sets the minimum version of CMake for this project, which is major version 2, minor version 8, and patch version 9 in this example. This version is somewhat arbitrary in this example, but providing a version number allows for future support for your build environment. Therefore, you should use the current version of CMake on your system, which for this example is determined just below.
  • The second line is the project() command that sets the project name.
  • The third line is the add_executable() command, which requests that an executable is to be built using the helloworld.cpp source file. The first argument to the add_executable() function is the name of the executable to be built, and the second argument is the source file from which to build the executable.
http://derekmolloy.ie/hello-world-introductions-to-cmake/


http://hahack.com/codes/cmake/


Are CMAKE_SOURCE_DIR and PROJECT_SOURCE_DIR the same in CMake?

http://stackoverflow.com/questions/32028667/are-cmake-source-dir-and-project-source-dir-the-same-in-cmake


PROJECT_SOURCE_DIR 
contains the full path to the root of your project source directory, i.e. to the nearest directory where CMakeLists.txt contains the PROJECT() command

CMAKE_SOURCE_DIR 
this is the directory which contains the top-level CMakeLists.txt, i.e. the top level source directory

http://stackoverflow.com/questions/7091385/how-to-organise-my-files-using-cmake

http://blog.csdn.net/cheng_tian/article/details/7271647

https://cmake.org/cmake-tutorial/

http://blog.sina.com.cn/s/blog_62715e790100grnk.html


0 0