CGAL-5.5.2简单编译通过的例子的pro配置

 CGAL自带的例子是通过CMAKE组织的编译,先通过cmake-gui生成vs的sln,在进行编译。本文介绍通过Qt的pro组织的代码工程配置。

重点参考版本和环境搭配:

1、VS2015 update 3

2、CGAL-5.5.2 + boost 1.71(看cmake最少要求1.66,太新了1.82也能可能遇到编译不过问题)

     D:\Program Files\CMake\share\cmake-3.23\Modules\FindBoost.cmake

3、以及通过CGAL官网下载的编译好的X64-VC14的库,包括CGAL-5.5.2-win64-auxiliary-libraries-gmp-mpfr.zip。

4、cmake-3.23

提示:如果版本不一定一致,通过编译错误,尝试替换boost版本;如果遇到enable_if_t编译错误,那可能是没有开启C++ 14,或者编译器支持不够(VS2015需要选用update 3的版本)。

QT -= gui

CONFIG += c++14 console
CONFIG -= app_bundle

DEFINES += QT_DEPRECATED_WARNINGS


SOURCES += \
        main.cpp


#QMAKE_CXXFLAGS += -std=c++14



INCLUDEPATH += D:/CGAL/CGAL-5.5.2/include
DEPENDPATH  += D:/CGAL/CGAL-5.5.2/include

INCLUDEPATH += D:/boost/boost_1_71_0
DEPENDPATH  += D:/boost/boost_1_71_0

win32: LIBS += -LD:/CGAL/CGAL-5.5.2/auxiliary/gmp/lib/ -llibgmp-10
INCLUDEPATH += D:/CGAL/CGAL-5.5.2/auxiliary/gmp/include
DEPENDPATH += D:/CGAL/CGAL-5.5.2/auxiliary/gmp/include

#include <QCoreApplication>
#include <iostream>
#include <CGAL/Exact_integer.h>
#include <CGAL/Homogeneous.h>
#include <CGAL/Nef_polyhedron_S2.h>
#include <CGAL/Nef_S2/Sphere_circle.h>
#include <QDebug>

typedef CGAL::Exact_integer RT;
typedef CGAL::Homogeneous<RT> Kernel;
typedef CGAL::Nef_polyhedron_S2<Kernel> Nef_polyhedron;
typedef Nef_polyhedron::Sphere_circle Sphere_circle;


int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

//    std::cout << "__cplusplus:" << __cplusplus << std::endl;

    Nef_polyhedron N1(Sphere_circle(1,0,0));
    Nef_polyhedron N2(Sphere_circle(0,1,0), Nef_polyhedron::EXCLUDED);
    const Nef_polyhedron N3 = N1 * N2;

    const Nef_polyhedron::Sphere_map &m = N3.sphere_map();
    Nef_polyhedron::Const_decorator D(&m);

    qDebug() << D.number_of_svertices();
    qDebug() << D.number_of_sedges();
    qDebug() << D.number_of_sloops();
    qDebug() << D.number_of_sfaces();


    return a.exec();
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

piaopiaolanghua

感谢鼓励,再接再厉!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值