cmake链接boost

  • Post author:
  • Post category:build
  • Post comments:0评论
# boost
if(MSVC)
# vs会自动链接
else()
  link_directories("/usr/locate/boost") # BOOST 安装位置
  find_package(Boost COMPONENTS json system filesystem program_options locale json REQUIRED)
  if(Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})
    MESSAGE( STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}.")
    MESSAGE( STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}.")
    MESSAGE( STATUS "Boost_LIB_VERSION = ${Boost_LIB_VERSION}.")
    target_link_libraries (${PROJECT_NAME} PRIVATE ${Boost_LIBRARIES})
  endif()
endif()
文章作者: 张拓
文章链接: http://www.xssl.online/cmake%e9%93%be%e6%8e%a5boost/
版权声明: 本博客所有文章除特别声明外,均采用CC BY-NC-SA 4.0 许可协议。转载请注明来自 张拓的博客
浏览次数: 452

张拓

陕西西安蓝田张拓QQ1070410059。一生所求不过“心安”二字。 然,尘世多纷扰。

发表回复