cmake编译pgAgent,提示Boost library not found

最近在尝试编译pgAgent-4.0.0,boost库静态编译,并设置了BOOST_ROOT:set(BOOST_ROOT "F:/pgagent/boost_1_59_0")

但在cmake的时候仍然提示找不到boost库,这让人很蛋疼,明明boost库已经存在,而且路径也设置的没问题,但就是找不到。。。


  Could not find the following Boost libraries:

          boost_filesystem
          boost_regex
          boost_date_time
          boost_thread
          boost_system

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.

折腾了好久都没好,最后用cmake-gui试了下,发现entry cach里有个BOOST_STATIC_BUILD,因为是编译的静态库,所以感觉这个值有问题,默认是没有选中的

于是将value点击为选中状态,再次Configure、Generate果然奇迹般的通过了,那个激动啊。。。

上边是使用cmake-gui的方法来解决找不到boost库的问题,如果不想使用cmake-gui也可以,继续往下看

最后在执行cmake的目录下的CMakeCache.txt文件中找到了BOOST_STATIC_BUILD这个变量,发现值为ON,想着应该没有问题呀,于是看了下其他BOOL型的变量,值有ON的,也有YES的,于是抱着试试看的心态把值改为YES,再次执行cmake,通过

哎呀,我勒个去,终于是告一段落了,虽然msbuild还有点问题,但那是VS的事儿了。

猜你喜欢

转载自blog.csdn.net/u013992330/article/details/82855723