Compiling a basic CGAL program in C++ on Mac OS X 10.7.2
Asked Answered
K

1

3

When I tried to compile Voronoi_Diagram_2 example I am getting this output:

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!

Please help!

Kial answered 6/12, 2011 at 18:35 Comment(4)
In CmakeLists.txt on Line 20, there is probably a wrong include path. Could you post that line? Well, it seems that there are more bad things going on… But let's see.Quiles
This looks suspicious: /opt/local//opt/local/lib/...Hungnam
Here is the 20th line include( ${CGAL_USE_FILE} ) And Here is the 22nd line: include( CGAL_CreateSingleSourceCGALProgram ) And Here is the 26th line: ` create_single_source_cgal_program( "vd_2_point_location.cpp" )`Kial
My major part of CmakeFile looks likes this: 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.")Kial
K
3

Make CGAL3.9 work on Mac OS X 10.7.2 to run only CGAL examples(Demos will not run with this procedure)

  • Download src code from the website
    • Extract it in your home directory
    • Open Terminal and go to the folder CGAL3.9
    • run cmake-gui . (don’t forget the dot after a space in this command)
    • Configure : upper window will look red
    • un-mark CGAL-QT3 and CGAL-QT4 in the camke-gui upper window
    • Configure again
    • make
    • make install
    • Done!

To run demos:

  • Install QT4 then open Cmake-gui in CGAL src code (of CGAL src code)
    • Mark CGAL_QT4 in the cmake-gui upper window
    • Configure again
    • make
    • make install
    • Done!

Follow this link for further details and doubts: http://cgal-discuss.949826.n4.nabble.com/Compiling-a-basic-CGAL-program-in-C-on-Mac-OS-X-10-7-2-td4166413.html

Compilation Command To Cmake CGAL Code: cmake -DCGAL_DIR=/opt/local/lib/cmake

Kial answered 28/2, 2012 at 9:35 Comment(2)
Or just look at the CGAL-manual in the section 3.1 IntroductionKial
can you explain how to do the same trick (at least the first part) directly from the command line? In particular, how do you tell cmake not to compile Qtx?Diabolo

© 2022 - 2024 — McMap. All rights reserved.