1
在我的代碼,我想要的boost::hash<pair<int, int>>
使用,爲此,我需要:我應該用cmake搜索哪些Boost包以包含來自Boost Functional的代碼?
#include <boost/functional/hash.hpp>
我用cmake
建立我的項目。我應該要求什麼包find_package
in CMakeLists.txt
?現在我有:find_package(Boost COMPONENTS program_options regex REQUIRED)
。我沒有任何錯誤,但我懷疑是因爲我安裝了所有boost庫。
所以我只需要使用'find_package'和需要構建的庫? 如果這個標題是我從Boost使用的唯一東西,該怎麼辦?我不應該配置'cmake'來尋找項目的需求嗎? (我對cmake實際上有些困惑,因爲我最近從'autotools'切換到了它)。 – 2013-05-09 20:41:34
這是一個比cmake更能提升的問題,但你只需要find_package和build libs。僅標題庫不會被鏈接,因此不需要添加它們:http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#header-only-libraries – mistapink 2013-05-09 20:48:35