zoukankan      html  css  js  c++  java
  • ubuntu 16.04上源码编译和安装cgal并编写CMakeLists.txt | compile and install cgal on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/39ab7ed9/,欢迎阅读最新内容!

    compile and install cgal on ubuntu 16.04

    Guide

    • version: 4.13.1

    install

    wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.13.1/CGAL-4.13.1.zip
    cd CGAL-4.13.1
    mkdir build && cd build && cmake-gui ..
    

    with options

    QT5_DIR            /opt/qt/5.7/gcc_64/lib/cmake/Qt5
    

    git clone https://github.com/CGAL/cgal.git

    compile and install

    make -j8
    sudo make install 
    

    output

    Scanning dependencies of target CGAL
    [ 16%] Building CXX object src/CGAL/CMakeFiles/CGAL.dir/all_files.cpp.o
    [ 33%] Linking CXX shared library ../../lib/libCGAL.so
    [ 33%] Built target CGAL
    Scanning dependencies of target CGAL_ImageIO
    Scanning dependencies of target CGAL_Core
    [ 50%] Building CXX object src/CGAL_Core/CMakeFiles/CGAL_Core.dir/all_files.cpp.o
    [ 66%] Building CXX object src/CGAL_ImageIO/CMakeFiles/CGAL_ImageIO.dir/all_files.cpp.o
    [ 83%] Linking CXX shared library ../../lib/libCGAL_ImageIO.so
    [ 83%] Built target CGAL_ImageIO
    [100%] Linking CXX shared library ../../lib/libCGAL_Core.so
    [100%] Built target CGAL_Core
    

    CMakeLists.txt

    find_package(CGAL REQUIRED)
    include(${CGAL_USE_FILE})
    MESSAGE( [Main] " CGAL_INCLUDE_DIRS = ${CGAL_INCLUDE_DIRS}") 
    MESSAGE( [Main] " CGAL_LIBRARIES = ${CGAL_LIBRARIES}")  
    #[Main] CGAL_INCLUDE_DIRS = /usr/local/include
    #[Main] CGAL_LIBRARIES = CGAL::CGAL 
    
    add_executable(my_executable my_source_file.cpp)
    target_link_libraries(my_executable ${CGAL_LIBRARIES})
    

    CGAL_USE_FILE
    CGAL_DIR /usr/local/lib/cmake/CGAL

    Reference

    History

    • 20190902: created.

    Copyright

  • 相关阅读:
    Windows UI自动化测试的XPATH实现
    Laravel修炼:服务容器绑定与解析
    swoole之memoryGlobal内存池分析
    Go语言的前景分析
    thinkphp5 编辑时 唯一验证 解决办法
    GIT配置多用户
    PHP 数组
    PHP 变量作用域
    PHP 使用 Swoole
    欢迎使用CSDN-markdown编辑器
  • 原文地址:https://www.cnblogs.com/kezunlin/p/11957588.html
Copyright © 2011-2022 走看看