【问题标题】:Compiling a basic CGAL program in C++ on Mac OS X 10.7.2在 Mac OS X 10.7.2 上用 C++ 编译一个基本的 CGAL 程序
【发布时间】:2011-12-06 18:35:41
【问题描述】:

当我尝试编译 Voronoi_Diagram_2 示例时,我得到了以下输出:

singhg@~/Programming/examples/Voronoi_diagram_2 $ cmake -DCGAL_DIR=/opt/local/lib/cmake/
CMake Error at CMakeLists.txt:20 (include):
  include could not find load file:

    /opt/local//opt/local/lib/cmake/UseCGAL.cmake


CMake Error at CMakeLists.txt:22 (include):
  include could not find load file:

    CGAL_CreateSingleSourceCGALProgram


CMake Error at CMakeLists.txt:26 (create_single_source_cgal_program):
  Unknown CMake command "create_single_source_cgal_program".


-- Configuring incomplete, errors occurred!

请帮忙!

【问题讨论】:

  • 在第 20 行的 CmakeLists.txt 中,可能存在错误的包含路径。你能把那条线贴出来吗?好吧,似乎还有更多不好的事情发生……但是让我们看看。
  • 这看起来很可疑:/opt/local//opt/local/lib/...
  • 这是第 20 行 include( ${CGAL_USE_FILE} ) 这是第 22 行:include( CGAL_CreateSingleSourceCGALProgram ) 这是第 26 行:`create_single_source_cgal_program("vd_2_point_location.cpp")`
  • 我的 CmakeFile 的主要部分看起来像这样:if ( CGAL_FOUND ) include( ${CGAL_USE_FILE} ) include( CGAL_CreateSingleSourceCGALProgram ) include_directories (BEFORE ../../include) create_single_source_cgal_program( "vd_2_point_location.cpp" ) else() message(STATUS "This program requires the CGAL library, and will not be compiled.")

标签: c++ macos cgal


【解决方案1】:

使 CGAL3.9 在 Mac OS X 10.7.2 上运行以仅运行 CGAL 示例(此过程不会运行演示)

  • 从网站下载src代码
    • 将其解压到您的主目录中
    • 打开终端并转到文件夹 CGAL3.9
    • 运行 cmake-gui 。 (不要忘记此命令中空格后的点)
    • 配置:上面的窗口看起来是红色的
    • 在 camke-gui 上部窗口中取消标记 CGAL-QT3 和 CGAL-QT4
    • 重新配置
    • 制作
    • 进行安装
    • 完成!

运行演示:

  • 安装 QT4 然后在 CGAL src 代码(CGAL src 代码)中打开 Cmake-gui
    • 在 cmake-gui 上层窗口中标记 CGAL_QT4
    • 重新配置
    • 制作
    • 进行安装
    • 完成!

点击此链接了解更多详情和疑问: http://cgal-discuss.949826.n4.nabble.com/Compiling-a-basic-CGAL-program-in-C-on-Mac-OS-X-10-7-2-td4166413.html

编译命令 Cmake CGAL 代码: cmake -DCGAL_DIR=/opt/local/lib/cmake

【讨论】:

  • 或者只看3.1 Introduction部分的CGAL手册
  • 你能解释一下如何直接从命令行执行相同的技巧(至少是第一部分)吗?特别是,你怎么告诉cmake不要编译Qtx?
猜你喜欢
  • 2012-01-13
  • 2011-07-08
  • 1970-01-01
  • 1970-01-01
  • 2012-02-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多