Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/133.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ CMake:a";查找“U程序包(增强)”;很好,但另一个不行_C++_Boost_Cmake - Fatal编程技术网

C++ CMake:a";查找“U程序包(增强)”;很好,但另一个不行

C++ CMake:a";查找“U程序包(增强)”;很好,但另一个不行,c++,boost,cmake,C++,Boost,Cmake,我正在为跨平台构建Boost Asio。所以我使用CMake来自动构建系统 文件结构: - timer - build (Just empty) - dep - boost - boost - doc - libs - ... - CMakeLists.txt (Important) - ... - CMakeLists.txt - src - CMakeLists.txt - t

我正在为跨平台构建Boost Asio。所以我使用CMake来自动构建系统

文件结构:

- timer
  - build (Just empty)
  - dep
    - boost
      - boost
      - doc
      - libs
      - ...
      - CMakeLists.txt (Important)
      - ...
    - CMakeLists.txt
  - src
    - CMakeLists.txt
    - timer.cpp
  - CMakeLists.txt
# Boost settings
set(BOOST_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(Boost_USE_STATIC_LIBS     ON)
set(Boost_USE_MULTITHREADED   ON)
set(Boost_USE_STATIC_RUNTIME  ON)

# Specify Boost libraries that will use.
set(boost_components system date_time regex)
set(boost_components_option --with-system --with-date_time --with-regex)

# Find compiled Boost
find_package(Boost COMPONENTS ${boost_components}) <-- STMT1
# If couldn't find it, compile Boost before process.
if(NOT ${Boost_FOUND})
  if(WIN32)
    set(bootstrap_name bootstrap.bat)
    set(bootstrap_command bootstrap.bat)
    set(b2_name b2.exe)
    set(b2_command b2.exe)
    set(b2_variant debug,release)
  else()
    set(bootstrap_name bootstrap.sh)
    set(bootstrap_command ./bootstrap.sh)
    set(b2_name b2)
    set(b2_command ./b2)
    set(b2_variant release)
  endif()
  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${bootstrap_name})
    if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/${b2_name})
      if(UNIX)
        execute_process(COMMAND chmod +x
        ${bootstrap_name} tools/build/src/engine/build.sh
        WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
      endif()
      execute_process(COMMAND ${bootstrap_command}
                      WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
    endif()
  else()
    message(FATAL_ERROR "Could NOT find ${bootstrap_name}")
  endif()
  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${b2_name})
    execute_process(COMMAND ${b2_command} ${boost_components_option}
                    variant=${b2_variant} link=static threading=multi
                    runtime-link=static
                    WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
  else()
    message(FATAL_ERROR "Could NOT find ${b2_name}")
  endif()
  # After compile Boost, re-find it.
  find_package(Boost REQUIRED COMPONENTS ${boost_components}) <-- STMT2
endif()
user@user-pc:~/desktop/timer/build$ cmake ..
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could NOT find Boost
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Detecting Python version... 2.7
Detecting Python root... /usr
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

    ./b2

To adjust configuration, edit 'project-config.jam'.
Further information:

   - Command line help:
     ./b2 --help

   - Getting started guide: 
     http://www.boost.org/more/getting_started/unix-variants.html

   - Boost.Build documentation:
     http://www.boost.org/build/doc/html/index.html

Performing configuration checks

    - 32-bit                   : no
    - 64-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes

Building the Boost C++ Libraries.


    - has_icu builds           : no

Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - coroutine                : not building
    - date_time                : building
    - exception                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : building
    - serialization            : not building
    - signals                  : not building
    - system                   : building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - wave                     : not building

...patience...
...found 1092 targets...
...updating 51 targets...
common.mkdir stage
common.mkdir stage/lib
common.mkdir bin.v2/libs/date_time
common.mkdir bin.v2/libs/date_time/build
common.mkdir bin.v2/libs/date_time/build/gcc-4.8
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/greg_month.o
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/greg_weekday.o
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/date_generators.o
gcc.archive bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_date_time.a
common.copy stage/lib/libboost_date_time.a
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/c_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/cpp_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/cregex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/fileiter.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/icu.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/instances.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/posix_api.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_debug.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_raw_buffer.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_traits_defaults.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/static_mutex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/w32_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/wc_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/wide_posix_api.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/winstances.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/usinstances.o
gcc.archive bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_regex.a
common.copy stage/lib/libboost_regex.a
common.mkdir bin.v2/libs/system
common.mkdir bin.v2/libs/system/build
common.mkdir bin.v2/libs/system/build/gcc-4.8
common.mkdir bin.v2/libs/system/build/gcc-4.8/release
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
gcc.compile.c++ bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/error_code.o
gcc.archive bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_system.a
common.copy stage/lib/libboost_system.a
...updated 51 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /home/user/desktop/timer/dep/boost

The following directory should be added to linker library paths:

    /home/user/desktop/timer/dep/boost/stage/lib

CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.58.0

  Boost include path: /home/user/desktop/timer/dep/boost

  Could not find the following static Boost libraries:

          boost_system
          boost_date_time
          boost_regex

  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.
Call Stack (most recent call first):
  dep/boost/CMakeLists.txt:50 (find_package)
  dep/CMakeLists.txt:2 (include)
  CMakeLists.txt:6 (include)


-- Configuring incomplete, errors occurred!
See also "/home/user/desktop/timer/build/CMakeFiles/CMakeOutput.log".
user@user-pc:~/desktop/timer/build$ cmake ..
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   date_time
--   regex
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/desktop/timer/build
除了
dep/boost/CMakeLists.txt
之外的其他CMake脚本只是在子目录中包含一些脚本或配置项目,仅此而已

dep/boost/CMakeLists.txt:

- timer
  - build (Just empty)
  - dep
    - boost
      - boost
      - doc
      - libs
      - ...
      - CMakeLists.txt (Important)
      - ...
    - CMakeLists.txt
  - src
    - CMakeLists.txt
    - timer.cpp
  - CMakeLists.txt
# Boost settings
set(BOOST_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(Boost_USE_STATIC_LIBS     ON)
set(Boost_USE_MULTITHREADED   ON)
set(Boost_USE_STATIC_RUNTIME  ON)

# Specify Boost libraries that will use.
set(boost_components system date_time regex)
set(boost_components_option --with-system --with-date_time --with-regex)

# Find compiled Boost
find_package(Boost COMPONENTS ${boost_components}) <-- STMT1
# If couldn't find it, compile Boost before process.
if(NOT ${Boost_FOUND})
  if(WIN32)
    set(bootstrap_name bootstrap.bat)
    set(bootstrap_command bootstrap.bat)
    set(b2_name b2.exe)
    set(b2_command b2.exe)
    set(b2_variant debug,release)
  else()
    set(bootstrap_name bootstrap.sh)
    set(bootstrap_command ./bootstrap.sh)
    set(b2_name b2)
    set(b2_command ./b2)
    set(b2_variant release)
  endif()
  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${bootstrap_name})
    if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/${b2_name})
      if(UNIX)
        execute_process(COMMAND chmod +x
        ${bootstrap_name} tools/build/src/engine/build.sh
        WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
      endif()
      execute_process(COMMAND ${bootstrap_command}
                      WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
    endif()
  else()
    message(FATAL_ERROR "Could NOT find ${bootstrap_name}")
  endif()
  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${b2_name})
    execute_process(COMMAND ${b2_command} ${boost_components_option}
                    variant=${b2_variant} link=static threading=multi
                    runtime-link=static
                    WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
  else()
    message(FATAL_ERROR "Could NOT find ${b2_name}")
  endif()
  # After compile Boost, re-find it.
  find_package(Boost REQUIRED COMPONENTS ${boost_components}) <-- STMT2
endif()
user@user-pc:~/desktop/timer/build$ cmake ..
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could NOT find Boost
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Detecting Python version... 2.7
Detecting Python root... /usr
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

    ./b2

To adjust configuration, edit 'project-config.jam'.
Further information:

   - Command line help:
     ./b2 --help

   - Getting started guide: 
     http://www.boost.org/more/getting_started/unix-variants.html

   - Boost.Build documentation:
     http://www.boost.org/build/doc/html/index.html

Performing configuration checks

    - 32-bit                   : no
    - 64-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes

Building the Boost C++ Libraries.


    - has_icu builds           : no

Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - coroutine                : not building
    - date_time                : building
    - exception                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : building
    - serialization            : not building
    - signals                  : not building
    - system                   : building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - wave                     : not building

...patience...
...found 1092 targets...
...updating 51 targets...
common.mkdir stage
common.mkdir stage/lib
common.mkdir bin.v2/libs/date_time
common.mkdir bin.v2/libs/date_time/build
common.mkdir bin.v2/libs/date_time/build/gcc-4.8
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/greg_month.o
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/greg_weekday.o
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/date_generators.o
gcc.archive bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_date_time.a
common.copy stage/lib/libboost_date_time.a
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/c_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/cpp_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/cregex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/fileiter.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/icu.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/instances.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/posix_api.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_debug.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_raw_buffer.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_traits_defaults.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/static_mutex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/w32_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/wc_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/wide_posix_api.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/winstances.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/usinstances.o
gcc.archive bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_regex.a
common.copy stage/lib/libboost_regex.a
common.mkdir bin.v2/libs/system
common.mkdir bin.v2/libs/system/build
common.mkdir bin.v2/libs/system/build/gcc-4.8
common.mkdir bin.v2/libs/system/build/gcc-4.8/release
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
gcc.compile.c++ bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/error_code.o
gcc.archive bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_system.a
common.copy stage/lib/libboost_system.a
...updated 51 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /home/user/desktop/timer/dep/boost

The following directory should be added to linker library paths:

    /home/user/desktop/timer/dep/boost/stage/lib

CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.58.0

  Boost include path: /home/user/desktop/timer/dep/boost

  Could not find the following static Boost libraries:

          boost_system
          boost_date_time
          boost_regex

  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.
Call Stack (most recent call first):
  dep/boost/CMakeLists.txt:50 (find_package)
  dep/CMakeLists.txt:2 (include)
  CMakeLists.txt:6 (include)


-- Configuring incomplete, errors occurred!
See also "/home/user/desktop/timer/build/CMakeFiles/CMakeOutput.log".
user@user-pc:~/desktop/timer/build$ cmake ..
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   date_time
--   regex
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/desktop/timer/build
第二个命令控制台输出:

- timer
  - build (Just empty)
  - dep
    - boost
      - boost
      - doc
      - libs
      - ...
      - CMakeLists.txt (Important)
      - ...
    - CMakeLists.txt
  - src
    - CMakeLists.txt
    - timer.cpp
  - CMakeLists.txt
# Boost settings
set(BOOST_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(Boost_USE_STATIC_LIBS     ON)
set(Boost_USE_MULTITHREADED   ON)
set(Boost_USE_STATIC_RUNTIME  ON)

# Specify Boost libraries that will use.
set(boost_components system date_time regex)
set(boost_components_option --with-system --with-date_time --with-regex)

# Find compiled Boost
find_package(Boost COMPONENTS ${boost_components}) <-- STMT1
# If couldn't find it, compile Boost before process.
if(NOT ${Boost_FOUND})
  if(WIN32)
    set(bootstrap_name bootstrap.bat)
    set(bootstrap_command bootstrap.bat)
    set(b2_name b2.exe)
    set(b2_command b2.exe)
    set(b2_variant debug,release)
  else()
    set(bootstrap_name bootstrap.sh)
    set(bootstrap_command ./bootstrap.sh)
    set(b2_name b2)
    set(b2_command ./b2)
    set(b2_variant release)
  endif()
  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${bootstrap_name})
    if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/${b2_name})
      if(UNIX)
        execute_process(COMMAND chmod +x
        ${bootstrap_name} tools/build/src/engine/build.sh
        WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
      endif()
      execute_process(COMMAND ${bootstrap_command}
                      WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
    endif()
  else()
    message(FATAL_ERROR "Could NOT find ${bootstrap_name}")
  endif()
  if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${b2_name})
    execute_process(COMMAND ${b2_command} ${boost_components_option}
                    variant=${b2_variant} link=static threading=multi
                    runtime-link=static
                    WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
  else()
    message(FATAL_ERROR "Could NOT find ${b2_name}")
  endif()
  # After compile Boost, re-find it.
  find_package(Boost REQUIRED COMPONENTS ${boost_components}) <-- STMT2
endif()
user@user-pc:~/desktop/timer/build$ cmake ..
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could NOT find Boost
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Detecting Python version... 2.7
Detecting Python root... /usr
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

    ./b2

To adjust configuration, edit 'project-config.jam'.
Further information:

   - Command line help:
     ./b2 --help

   - Getting started guide: 
     http://www.boost.org/more/getting_started/unix-variants.html

   - Boost.Build documentation:
     http://www.boost.org/build/doc/html/index.html

Performing configuration checks

    - 32-bit                   : no
    - 64-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes

Building the Boost C++ Libraries.


    - has_icu builds           : no

Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - container                : not building
    - context                  : not building
    - coroutine                : not building
    - date_time                : building
    - exception                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : building
    - serialization            : not building
    - signals                  : not building
    - system                   : building
    - test                     : not building
    - thread                   : not building
    - timer                    : not building
    - wave                     : not building

...patience...
...found 1092 targets...
...updating 51 targets...
common.mkdir stage
common.mkdir stage/lib
common.mkdir bin.v2/libs/date_time
common.mkdir bin.v2/libs/date_time/build
common.mkdir bin.v2/libs/date_time/build/gcc-4.8
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
common.mkdir bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/greg_month.o
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/greg_weekday.o
gcc.compile.c++ bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/gregorian/date_generators.o
gcc.archive bin.v2/libs/date_time/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_date_time.a
common.copy stage/lib/libboost_date_time.a
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/c_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/cpp_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/cregex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/fileiter.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/icu.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/instances.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/posix_api.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_debug.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_raw_buffer.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/regex_traits_defaults.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/static_mutex.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/w32_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/wc_regex_traits.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/wide_posix_api.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/winstances.o
gcc.compile.c++ bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/usinstances.o
gcc.archive bin.v2/libs/regex/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_regex.a
common.copy stage/lib/libboost_regex.a
common.mkdir bin.v2/libs/system
common.mkdir bin.v2/libs/system/build
common.mkdir bin.v2/libs/system/build/gcc-4.8
common.mkdir bin.v2/libs/system/build/gcc-4.8/release
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static
common.mkdir bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi
gcc.compile.c++ bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/error_code.o
gcc.archive bin.v2/libs/system/build/gcc-4.8/release/link-static/runtime-link-static/threading-multi/libboost_system.a
common.copy stage/lib/libboost_system.a
...updated 51 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /home/user/desktop/timer/dep/boost

The following directory should be added to linker library paths:

    /home/user/desktop/timer/dep/boost/stage/lib

CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.58.0

  Boost include path: /home/user/desktop/timer/dep/boost

  Could not find the following static Boost libraries:

          boost_system
          boost_date_time
          boost_regex

  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.
Call Stack (most recent call first):
  dep/boost/CMakeLists.txt:50 (find_package)
  dep/CMakeLists.txt:2 (include)
  CMakeLists.txt:6 (include)


-- Configuring incomplete, errors occurred!
See also "/home/user/desktop/timer/build/CMakeFiles/CMakeOutput.log".
user@user-pc:~/desktop/timer/build$ cmake ..
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   date_time
--   regex
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/desktop/timer/build
到底发生了什么事?如何解决呢?谢谢