[CMake] Not able to find boost with cmake

钟元鑫 cmpute at qq.com
Fri Aug 4 20:14:29 EDT 2017


Actually I have built boost from source with the version I downloaded, and I've run the install script given by boost. However, I just cannot let CMake find it.


[ D:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1450 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = D:/Program Files/PCL 1.8.0/3rdParty/Boost/include/boost-1_61/lib; ...(many other directories)
[ D:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1595 ] Searching for THREAD_LIBRARY_RELEASE: libboost_thread-vc141-mt-1_61;libboost_thread-vc141-mt;libboost_thread-vc140-mt-1_61;libboost_thread-vc140-mt;libboost_thread-mt-1_61;libboost_thread-mt;libboost_thread 



These are two lines in the output message, and I'm sure there is a file named "libboost_thread-vc141-mt-1_61.lib" in the lib directory listed in the first line where CMake will search for in.


However, the error message told me:


Could not find the following static Boost libraries: boost_thread


I don't know how this happened since it seems that CMake had already found the lib files. The attached log file shows the detail.


(PS: really sorry to reply again, I'm new to mailing list service)


Thanks,
Jacob Zhong


------------------ 原始邮件 ------------------
发件人: "Bo Zhou";<bo.schwarzstein at gmail.com>;
发送时间: 2017年8月4日(星期五) 中午12:19
收件人: "钟元鑫"<cmpute at qq.com>; 
抄送: "cmake"<cmake at cmake.org>; 
主题: Re: [CMake] Not able to find boost with cmake



It's better not to use downloaded pre-built libraries, always build by yourself locally.



Before using Boost with CMake, please check https://cmake.org/cmake/help/v3.0/module/FindBoost.html


If you're trying to use static boost libraries build by MSVC with shared runtime, please make sure the following statements exist in the PCL.

set(Boost_USE_STATIC_LIBS ON)

set(Boost_USE_MULTITHREADED ON)

set(Boost_USE_STATIC_RUNTIME OFF)




Then if you properly set the Boost_INCLUDE_DIR, all the libraries should be ready then.


On Fri, Aug 4, 2017 at 1:05 PM, 钟元鑫 <cmpute at qq.com> wrote:
I'm trying to build PCL which has boost as dependency. However, when I download boost and build it, cmake cannot find it through any way.


I tried two version of boost, one is pre-build boost which was built by other person online and version is 1.61, another is one I downloaded whose version is 1.64. File structures of the two versions are the same:
[XXX]/include/boost-1_64/boost is the include dir and [XXX]/lib is the bin dir




I try to specify the Boost_INCLUDE_DIR to [XXX]/include/boost-1_64/boost, the messages in output window is attached (I turned Boost_DEBUG on).


I'm on Window 10 and VS2017


Thanks,
Jacob Zhong



------------------
顺颂时祺


钟元鑫  Yuanxin Zhong
清华大学汽车工程系  Dept. of Automotive Engineering, Tsinghua Univ.
Ad:Haidian District, Beijing, P.R.China    100084
Tel:+86 17888833119
E-mail:cmpute at foxmail.com / zhongyx14 at mails.tsinghua.edu.cn



 

--
 
 Powered by www.kitware.com
 
 Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
 
 Kitware offers various services to support the CMake community. For more information on each offering, please visit:
 
 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html
 
 Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
 
 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/mailman/listinfo/cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170805/18f4cb66/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A56076E6 at D317FD5B.E50D8559.jpg
Type: image/jpeg
Size: 13551 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170805/18f4cb66/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7DFA70E3 at D4E6C253.E50D8559.jpg
Type: image/jpeg
Size: 11484 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170805/18f4cb66/attachment-0003.jpg>


More information about the CMake mailing list