cmake添加第三方库

  • Post author:
  • Post category:其他




主要方法

#将包含目录添加到构建中
include_directories(D:/Download/boost/boost_1_77_0)
include_directories(D:/Download/libxlsxwriter/fast_excel-master/libxlsxwriter/include)
include_directories(D:/Download/libxlsxwriter/fast_excel-master/libxlsxwriter/src)

#此命令用于查找库
find_library(boost NAMES pthread PATHS D:/Download/boost/boost_1_77_0)
find_library(excel NAMES excel PATHS D:/Download/libxlsxwriter/fast_excel-master/libxlsxwriter/include)
find_library(excel NAMES excel PATHS D:/Download/libxlsxwriter/fast_excel-master/libxlsxwriter/src)



#添加链接器将在其中查找库的目录
link_directories (D:/Download/boost/boost_1_77_0/libs)
link_directories (D:/Download/libxlsxwriter/fast_excel-master/libxlsxwriter/lib)



版权声明:本文为a15322910600原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。