cygwin cmake找不到boost库

时间:2015-02-02 10:27:40

标签: c++ boost cmake cygwin

我正在尝试从Windows的Cygwin终端配置Cmake,我的Boost库位于/ usr / src / boost_1_54_0 / libs。我的CMake配置文件包含:

set(Boost_USE_STATIC_LIBS ON) 
set(Boost_USE_MULTITHREADED ON) 
set(Boost_USE_STATIC_RUNTIME OFF) 
find_package(Boost 1.54.0 COMPONENTS date_time filesystem program_options serialization thread REQUIRED) 
include_directories(${Boost_INCLUDE_DIRS})

但是,CMake给了我以下错误:

Boost version: 1.54.0

Boost include path: /usr/src/boost_1_54_0

The following Boost libraries could not be found:

        boost_date_time
        boost_filesystem
        boost_program_options
        boost_serialization
        boost_thread

No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.

然后我尝试在 find_package 方法之前用以下行手动指定Boostlib的目录:

set(BOOST_LIBRARYDIR /usr/src/boost_1_54_0/libs)

但它也不起作用。

任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

要查找Boost库,cmake依赖于环境变量libs。它应该指向包含您的Boost include(而不是setenv BOOST_ROOT "/usr/src/boost_1_54_0" )和public class ValueListManager { private class Ops : Operations { public Ops() { } public void Call() { } } public static Operations myOps { get { return new Ops(); } } }

的目录

在调用cmake之前在Cygwin中定义它,它应该可以工作。

在csh中:

offCanvas: {
position  : "left",
zposition : "front"
},