我想测试biicode如何让我快速创建一个使用boost的项目。我(我想)已经遵循了bii文档中概述的程序。
修改CMakeLists.txt后,配置步骤不成功。 boost库似乎没有构建。我知道有时配置步骤需要完成两次(根据http://forum.biicode.com/t/error-could-not-find-the-following-static-boost-libraries-boost-thread/374),但这没有帮助。
我已经粘贴了下面的确切步骤。如果有人能告诉我出错的地方,我将非常感激。
1。环境:Windows 7 x64,Visual Studio 10 SP 1
PS G:\> bii --version
3.2
PS G:\> cmake --version
cmake version 3.2.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
PS G:\>
2。从干净的文件夹开始(G:\ biitests)
第3。启动bii项目
PS G:\biitests> bii init boostUsageTest -L
Successfully initialized biicode project boostUsageTest
4。使用以下内容创建G:\ biitests \ boostUsageTest \ main.cpp文件:
#include <boost/lexical_cast.hpp>
#include <boost/thread/mutex.hpp>
#include <iostream>
#include <exception>
int main (int argc, char *argv[])
{
boost::mutex uselessMutex;
auto value = boost::lexical_cast<int>(argv[0]);
std::cout << "value = " << value << std::endl;
return 0;
}
5。 bii find
PS G:\biitests\boostUsageTest> bii find
INFO: Processing changes...
WARN: There are local unresolved dependencies
They will not be searched in the server
Unresolved: boost/lexical_cast.hpp
INFO: Finding missing dependencies in server
INFO: Looking for boost/thread...
WARN: Can't find block candidate for: boost/thread
INFO: No block candidates found
6。 bii configure
PS G:\biitests\boostUsageTest> bii cpp:configure -G "Visual Studio 10"
INFO: Processing changes...
Running: "cmake" -G "Visual Studio 10" -Wno-dev ..\cmake
-- The C compiler identification is MSVC 16.0.40219.1
-- The CXX compiler identification is MSVC 16.0.40219.1
-- Check for working C compiler using: Visual Studio 10 2010
-- Check for working C compiler using: Visual Studio 10 2010 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10 2010
-- Check for working CXX compiler using: Visual Studio 10 2010 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
BLOCK: user/boostUsageTest
-----------------------------------------------------------
+ LIB: user_boostUsageTest
+ EXE: user_boostUsageTest_main
-- Configuring done
-- Generating done
-- Build files have been written to: G:/biitests/boostUsageTest/bii/build
PS G:\biitests\boostUsageTest>
7。按以下方式编辑CMakeLists.txt
(在我的更改之前,唯一未注释的行是ADD_BII_TARGETS())
include(biicode/boost/setup)
INIT_BIICODE_BLOCK()
# Create Targets
ADD_BII_TARGETS()
bii_find_boost(COMPONENTS thread REQUIRED)
8。再次运行bii
PS G:\biitests\boostUsageTest> bii find --update
INFO: Processing changes...
WARN: There are local unresolved dependencies
They will not be searched in the server
Unresolved: boost/lexical_cast.hpp
INFO: Finding missing dependencies in server
INFO: Looking for biicode/boost...
INFO: Block candidate: biicode/biicode/boost/master
INFO: Version biicode/boost: 9 (DEV) discarded
INFO: Version biicode/boost: 8 (STABLE) valid
INFO: Version biicode/boost: 7 (STABLE) valid
INFO: Version biicode/boost: 6 (STABLE) valid
INFO: Version biicode/boost: 5 (STABLE) valid
INFO: Version biicode/boost: 4 (STABLE) valid
INFO: Version biicode/boost: 3 (STABLE) valid
INFO: Version biicode/boost: 2 (STABLE) valid
INFO: Version biicode/boost: 1 (STABLE) valid
INFO: Version biicode/boost: 0 (STABLE) valid
INFO: Looking for boost/thread...
WARN: Can't find block candidate for: boost/thread
INFO: Analyzing compatibility for found dependencies...
Find resolved new dependencies:
biicode/boost: 8
ERROR: Find could not resolve:
boost/thread/mutex.hpp
INFO: Saving files from: toeb/cmakepp
INFO: Saving files from: biicode/boost
INFO: Saving files from: boost/install
9。再次运行bii configure
PS G:\biitests\boostUsageTest> bii cpp:configure -G "Visual Studio 10"
INFO: Processing changes...
Running: "cmake" -G "Visual Studio 10" -Wno-dev ..\cmake
BLOCK: user/boostUsageTest
-----------------------------------------------------------
CALLING INIT_BIICODE_BLOCK IS NO LONGER NECESSARY
+ LIB: user_boostUsageTest
+ EXE: user_boostUsageTest_main
-- No linking type specified. Assuming static linking
-- Setting up biicode Boost configuration...
-- Building Boost 1.57.0 components with toolset msvc-10.0...
Starting thread library build job...
Building Boost components, please wait [ ]
Finished building thread library
-- Boost version: 1.57.0
CMake Error at ../deps/toeb/cmakepp/cmake/core/message.cmake:94 (_message):
Unable to find the requested Boost libraries.
Boost version: 1.57.0
Boost include path: G:/Users/bgo/.biicode/boost/1.57.0
Could not find the following static Boost libraries:
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.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindBoost.cmake:1182 (message)
../deps/toeb/cmakepp/cmake/targets/find_package.cmake:17 (_find_package)
../deps/boost/install/install.cmake:351 (find_package)
../../CMakeLists.txt:9 (bii_find_boost)
-- Configuring incomplete, errors occurred!
See also "G:/biitests/boostUsageTest/bii/build/CMakeFiles/CMakeOutput.log".
ERROR: CMake failed
然后运行bii cpp:configure之后总是给出完全相同的输出。
提前多多感谢!
本杰明