mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
cgal.org (#3746)
* new file: projects/cgal.org/package.yml new file: projects/cgal.org/surprise.cpp * -DCMAKE_BUILD_RPATH= * fixture & ldflags * case sensitive linux --------- Co-authored-by: Jacob Heider <jacob@pkgx.dev>
This commit is contained in:
parent
4ef7d15085
commit
d033a15877
62
projects/cgal.org/package.yml
Normal file
62
projects/cgal.org/package.yml
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/CGAL/cgal/releases/download/v{{version.marketing}}/CGAL-{{version.marketing}}.tar.xz
|
||||||
|
strip-components: 1
|
||||||
|
versions:
|
||||||
|
github: CGAL/cgal
|
||||||
|
dependencies:
|
||||||
|
boost.org: '*'
|
||||||
|
eigen.tuxfamily.org: '*'
|
||||||
|
gnu.org/gmp: '*'
|
||||||
|
gnu.org/mpfr: '*'
|
||||||
|
openssl.org: '*'
|
||||||
|
build:
|
||||||
|
dependencies:
|
||||||
|
cmake.org: '*'
|
||||||
|
qt.io: ~5
|
||||||
|
linux:
|
||||||
|
gnu.org/gcc: '*'
|
||||||
|
gnu.org/make: '*'
|
||||||
|
script:
|
||||||
|
- cmake . $CMAKE_ARGS
|
||||||
|
- make install
|
||||||
|
env:
|
||||||
|
CMAKE_ARGS:
|
||||||
|
- -DCMAKE_INSTALL_PREFIX="{{prefix}}
|
||||||
|
- -DCMAKE_INSTALL_LIBDIR=lib
|
||||||
|
- -DCMAKE_BUILD_TYPE=Release
|
||||||
|
- -DCMAKE_FIND_FRAMEWORK=LAST
|
||||||
|
- -DCMAKE_VERBOSE_MAKEFILE=ON
|
||||||
|
- -Wno-dev
|
||||||
|
- -DBUILD_TESTING=OFF
|
||||||
|
- -DCMAKE_CXX_FLAGS='-std=c++14'
|
||||||
|
- -DWITH_CGAL_Qt5=ON
|
||||||
|
provides:
|
||||||
|
- bin/cgal_create_CMakeLists
|
||||||
|
- bin/cgal_create_cmake_script
|
||||||
|
- bin/cgal_make_macosx_app
|
||||||
|
test:
|
||||||
|
dependencies:
|
||||||
|
cmake.org: '*'
|
||||||
|
qt.io: ~5
|
||||||
|
linux:
|
||||||
|
gnu.org/gcc: '*'
|
||||||
|
gnu.org/make: '*'
|
||||||
|
script:
|
||||||
|
- mv $FIXTURE CMakeLists.txt
|
||||||
|
- cmake -L $ARGS .
|
||||||
|
- cmake --build . -v
|
||||||
|
- ./surprise | grep 15
|
||||||
|
fixture: |
|
||||||
|
cmake_minimum_required(VERSION 3.1...3.15)
|
||||||
|
find_package(CGAL COMPONENTS Qt5)
|
||||||
|
add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS)
|
||||||
|
include_directories(surprise BEFORE SYSTEM {{deps.qt.io.prefix}}/include)
|
||||||
|
add_executable(surprise surprise.cpp)
|
||||||
|
target_include_directories(surprise BEFORE PUBLIC {{deps.qt.io.prefix}}/include})
|
||||||
|
target_link_libraries(surprise PUBLIC CGAL::CGAL_Qt5)
|
||||||
|
env:
|
||||||
|
ARGS:
|
||||||
|
- -DQt5_DIR={{deps.qt.io.prefix}}/cmake/Qt5
|
||||||
|
- -DCMAKE_PREFIX_PATH={{prefix}}
|
||||||
|
darwin:
|
||||||
|
LDFLAGS: -Wl,-rpath,{{pkgx.prefix}}
|
34
projects/cgal.org/surprise.cpp
Normal file
34
projects/cgal.org/surprise.cpp
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
|
#include <CGAL/Triangulation_2.h>
|
||||||
|
#include <CGAL/draw_triangulation_2.h>
|
||||||
|
#include <CGAL/basic.h>
|
||||||
|
#include <CGAL/Coercion_traits.h>
|
||||||
|
#include <CGAL/IO/io.h>
|
||||||
|
#include <fstream>
|
||||||
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||||
|
typedef CGAL::Triangulation_2<K> Triangulation;
|
||||||
|
typedef Triangulation::Point Point;
|
||||||
|
|
||||||
|
template <typename A, typename B>
|
||||||
|
typename CGAL::Coercion_traits<A, B>::Type
|
||||||
|
binary_func(const A &a, const B &b)
|
||||||
|
{
|
||||||
|
typedef CGAL::Coercion_traits<A, B> CT;
|
||||||
|
CGAL_static_assertion((CT::Are_explicit_interoperable::value));
|
||||||
|
typename CT::Cast cast;
|
||||||
|
return cast(a) * cast(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **)
|
||||||
|
{
|
||||||
|
std::cout << binary_func(double(3), int(5)) << std::endl;
|
||||||
|
std::cout << binary_func(int(3), double(5)) << std::endl;
|
||||||
|
std::ifstream in("data/triangulation_prog1.cin");
|
||||||
|
std::istream_iterator<Point> begin(in);
|
||||||
|
std::istream_iterator<Point> end;
|
||||||
|
Triangulation t;
|
||||||
|
t.insert(begin, end);
|
||||||
|
if (argc == 3) // do not test Qt5 at runtime
|
||||||
|
CGAL::draw(t);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
Loading…
Reference in a new issue