cmakelists.txt文件

  • project 指定工程名称
  • set 设置变量
  • add_executable 添加工程的源文件。
  • aux_source_directory(. XXX) 指定当前目录为资源目录,命名为XXX
  • add_library(MathFunctions ${DIR_LIB_SRCS}) 用指定源文件产生库,命名为MathFunctions。
  • add_subdirectory(math) 添加子目录math
  • target_link_libraries(Demo MathFunctions) 向工程Demo中添加链接库MathFunctions
  • link_directories 指定链接库目录