在Debian Wheezy上使用Boost 1.58来解决问题

时间:2015-07-23 12:11:43

标签: boost cmake debian

Debian Wheezy带有提升1.49,但我需要使用更新的版本(> = 1.50)。 标准方式是什么? 我已经将boost 1.58安装到/ usr / local,将BOOST_ROOT设置为/ usr / local,但是cmake找不到它,只有/ usr中的旧的1.49。 我该怎么办?

1 个答案:

答案 0 :(得分:0)

我在Ubuntu 14.04上有类似的情况 - 安装了默认的boost 1.54和我自己构建的boost 1.56。

我的CMakeLists.txt配置方式如下:

LIST (APPEND CMAKE_LIBRARY_PATH "/usr/local/lib") # make sure there are boost library files
LIST (APPEND CMAKE_INCLUDE_PATH "/usr/local/include") # make sure there is a boost directory

FIND_PACKAGE (Boost 1.56 COMPONENTS "system" "filesystem" REQUIRED)

INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})

TARGET_LINK_LIBRARIES(${your_app} ${Boost_LIBRARY_DIRS})
相关问题