CGAL编译制定boost目录

来源:互联网 发布:淘宝购物几天能到货 编辑:程序博客网 时间:2024/05/18 00:53

在编译CGAL的过程中,指定自己编译的boost库的路径时遇到问题:CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: Boost_INCLUDE_DIR (ADVANCED)

解决方案如下: 修改CMakeList.txt文件, “External libraries” 模块 添加如下内容:


SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "boost include path")SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "boost static library path")

FIND_PACKAGE(Boost)IF (Boost_FOUND)    INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})    ADD_DEFINITIONS( "-DHAS_BOOST" )ENDIF()

执行命令: cmake -DWITH_examples=OFF -DWITH_demos=OFF -DCMAKE_BUILD_TYPE=Release  -DBUILD_SHARED_LIBS=FALSE  CGAL_Boost_USE_STATIC_LIBS=ON .即可


参考:

1. http://doc.cgal.org/latest/Manual/installation.html

2. http://stackoverflow.com/questions/3808775/cmake-doesnt-find-boost


0 0