1、PROJECT_SOURCE_DIR/CMAKE_SOURCE_DIR/_SOURCE_DIR:为包含PROJECT()命令的最近一个CMakeLists.txt文件所在的文件夹路径。 2、PROJECT_BINARY_DIR 运行cmake命令的目录,即工程编译发生的路径 例如: PROJECT_SOURCE_DIR:/opt/c++/ctest/test PROJECT_BINARY_DIR:/opt/c++/ctest/test/build 3、PROJECT_NAME:本CMakeLists.txt的project名称 例:project(TTU) 4、add_subdirectory(子文件夹名称): 编译子文件夹中的CMakeLists.txt,子文件夹中必须有CMakeList.txt 例:add_subdirectory(commiec) 5、EXECUTABLE_OUTPUT_PATH: 指定最终的可执行文件的位置 例:SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) 6、SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) 设置库文件的输出目录 例:SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) 5/6两变量在新版本中已被`CMAKE_RUNTIME_OUTPUT_DIRECTORY`和`CMAKE_ARCHIVE_OUTPUT_DIRECTORY`代替
标签:BINARY,cmake,常见,PROJECT,编译,PATH,OUTPUT,txt,DIR From: https://www.cnblogs.com/y593216/p/17100409.html