Commits

Brad Pitcher committed b7b4b89

libcgal.mk

Comments (0)

Files changed (1)

+# This file is part of mingw-cross-env.
+# See doc/index.html for further information.
+
+# libcgal
+PKG                          := libcgal
+$(PKG)_IGNORE       :=
+$(PKG)_VERSION     := 3.8
+$(PKG)_CHECKSUM := 23748df1e60d62da166d2e395732ae2fe274317d
+$(PKG)_SUBDIR       := CGAL-$($(PKG)_VERSION)
+$(PKG)_FILE             := CGAL-$($(PKG)_VERSION).tar.gz
+$(PKG)_WEBSITE     := http://www.cgal.org/
+$(PKG)_URL             := https://gforge.inria.fr/frs/download.php/28500/$($(PKG)_FILE)
+$(PKG)_DEPS           := gcc boost gmp libmpfr
+
+define $(PKG)_UPDATE
+    wget -q -O- 'https://gforge.inria.fr/frs/?group_id=52' | \
+    grep 'CGAL-' | \
+    $(SED) -n 's,.*CGAL-\([0-9][^>a-z]*\)\.tar.*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    sed -i 's/\(.*\) _boost_\(..\)UPPERCOMPONENT\(.\)_LIBRARY_RELEASE_NAMES/\1 _boost_COMPILER "_win32")\n&\n      \2Boost_LIB_PREFIX\3boost_\2COMPONENT\3\2_boost_COMPILER\3\2_boost_MULTITHREADED\3/g' '$(1)/cmake/modules/FindBoost.cmake'
+    sed -i 's/include( CGAL_VersionUtils )/include( CGAL_VersionUtils )\nset(Boost_USE_STATIC_LIBS   ON)/g' '$(1)/cmake/modules/FindBoost.cmake'
+    sed -i 's/get_dependency_version/#get_dependency_version/g' '$(1)/cmake/modules/CGAL_SetupGMP.cmake'
+    sed -i 's/get_dependency_version/#get_dependency_version/g' '$(1)/src/CGALQt4/CMakeLists.txt'
+    sed -i 's/get_dependency_version/#get_dependency_version/g' '$(1)/src/CGALimageIO/CMakeLists.txt'
+    sed -i 's/get_dependency_version/#get_dependency_version/g' '$(1)/CMakeLists.txt'
+    sed -i 's/\(if( MSVC )\)/uniquely_add_flags( CXXFLAGS "\-DBOOST_THREAD_USE_LIB;\-DBoost_USE_STATIC_LIBS" )\nSET(CMAKE_CXX_FLAGS_RELEASE "\-DBOOST_THREAD_USE_LIB \-DBoost_USE_STATIC_LIBS \-O3 \-DNDEBUG" CACHE STRING blah FORCE)\n\1/g' '$(1)/CMakeLists.txt'
+    sed -i 's/side_of_oriented_circle(/this\->side_of_oriented_circle(/g' '$(1)/include/CGAL/Constrained_Delaunay_triangulation_2.h'
+    echo -e "SET( CGAL_CFG_ARRAY_MEMBER_INITIALIZATION_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_DENORMALS_COMPILE_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_IEEE_754_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_ISTREAM_INT_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_LONGNAME_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_MATCHING_BUG_5\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_MATCHING_BUG_6\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_ARRAY\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_AUTO\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_DECLTYPE\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_DELEGATING_CONSTRUCTORS\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_INITIALIZER_LISTS\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_ISFINITE\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_LAMBDAS\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_LONG_LONG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_TUPLE\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_LIMITS\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_LOGICAL_OPERATORS_ALTERNATIVES\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_MESSAGE_PRAGMA_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_NEXTAFTER\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_STATEMENT_EXPRESSIONS \n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_STL\n     0\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_TMPL_IN_TMPL_PARAM\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_TR1_ARRAY\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_TR1_TUPLE\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NO_WARNING_CPP_DIRECTIVE_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_NUMERIC_LIMITS_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( CGAL_CFG_USING_BASE_MEMBER_BUG_2\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( GCC_RUN_RES\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( GMP_RUN_RES\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( MPFR_RUN_RES\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( QT4_RUN_RES \n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( ZLIB_RUN_RES \n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( GCC_RUN_RES__TRYRUN_OUTPUT\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( GMP_RUN_RES__TRYRUN_OUTPUT\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( MPFR_RUN_RES__TRYRUN_OUTPUT\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( QT4_RUN_RES__TRYRUN_OUTPUT\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\nSET( ZLIB_RUN_RES__TRYRUN_OUTPUT\n     FAILED_TO_RUN\n     CACHE STRING \"Result from TRY_RUN\" FORCE)\n" > '$(1)/TryRunResults.cgal.cmake'
+    cd '$(1)' && cmake -DCGAL_INSTALL_CMAKE_DIR:STRING="lib/CGAL" -DCMAKE_BUILD_TYPE:STRING="Release" -DCGAL_INSTALL_INC_DIR:STRING="include" -DCGAL_INSTALL_DOC_DIR:STRING="share/doc/CGAL-3.8" -DQT_QMAKE_EXECUTABLE:FILEPATH="$(PREFIX)/bin/$(TARGET)-qmake" -DCGAL_INSTALL_BIN_DIR:STRING="bin" -DBoost_LIB_DIAGNOSTIC_DEFINITIONS:STRING="-DBOOST_LIB_DIAGNOSTIC" -DWITH_CGAL_Qt3:BOOL="0" -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/$(TARGET)/share/cmake/mingw-cross-env-conf.cmake -DBOOST_COMPILER=_win32 -DBOOST_THREAD_USE_LIB=1 -DBoost_USE_STATIC_LIBS=1 -C TryRunResults.cgal.cmake .
+    $(MAKE) -C '$(1)' -j $(JOBS)
+    cd '$(1)/examples/AABB_tree' && cmake -DQT_QMAKE_EXECUTABLE:FILEPATH="$(PREFIX)/bin/$(TARGET)-qmake" -DBoost_LIB_DIAGNOSTIC_DEFINITIONS:STRING="-DBOOST_LIB_DIAGNOSTIC" -DWITH_CGAL_Qt3:BOOL="0" -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/$(TARGET)/share/cmake/mingw-cross-env-conf.cmake -DBOOST_COMPILER=_win32 -DBOOST_THREAD_USE_LIB=1 -DBoost_USE_STATIC_LIBS=1 -DCGAL_DIR:STRING="../.." .
+    $(MAKE) -C '$(1)/examples/AABB_tree' -j $(JOBS)
+    $(MAKE) -C '$(1)' -j $(JOBS) install
+    $(INSTALL) '$(1)/examples/AABB_tree/AABB_polyhedron_edge_example.exe' '$(PREFIX)/$(TARGET)/bin/test-libcgal.exe'
+endef