CMake 在 Debian Wheezy 上使用 Boost 1.58

CMake trouble with Boost 1.58 on Debian Wheezy

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

我在 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})