Merge pull request #4356 from sgiraudot/Documentation-Update_cmake_variables-GF

Third party libs: improve documentation + introduce new CMake functions
This commit is contained in:
Sébastien Loriot 2020-03-17 18:19:40 +01:00
commit cc1bd20c7c
83 changed files with 826 additions and 586 deletions

View File

@ -8,15 +8,16 @@ if ( CGAL_FOUND )
# Use Eigen
find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
if(NOT (${cppfile} STREQUAL "ellipsoid.cpp") OR EIGEN3_FOUND)
create_single_source_cgal_program( "${cppfile}" )
if (EIGEN3_FOUND)
get_filename_component(target ${cppfile} NAME_WE)
CGAL_target_use_Eigen(${target})
endif()
endif()
endforeach()

View File

@ -14,15 +14,16 @@ if ( CGAL_FOUND )
# Use Eigen
find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
if(NOT (${cppfile} STREQUAL "Approximate_min_ellipsoid_d.cpp") OR EIGEN3_FOUND)
create_single_source_cgal_program( "${cppfile}" )
if (EIGEN3_FOUND)
get_filename_component(target ${cppfile} NAME_WE)
CGAL_target_use_Eigen(${target})
endif()
endif()
endforeach()

View File

@ -27,9 +27,7 @@ if ( CGAL_FOUND )
include(${CGAL_USE_FILE})
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
else()
if (NOT EIGEN3_FOUND)
message(STATUS "NOTICE: This project requires the Eigen library, and will not be compiled.")
return()
endif()
@ -143,6 +141,7 @@ if ( CGAL_FOUND )
add_library(CGAL_${IPELET} MODULE ${IPELET}.cpp)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_${IPELET})
target_link_libraries(CGAL_${IPELET} PRIVATE CGAL::CGAL ${IPE_LIBRARIES})
CGAL_target_use_Eigen(CGAL_${IPELET})
if ( IPELET_INSTALL_DIR )
install(TARGETS CGAL_${IPELET} DESTINATION ${IPELET_INSTALL_DIR})
if (WITH_IPE_7)
@ -153,12 +152,13 @@ if ( CGAL_FOUND )
endforeach(IPELET)
if(CGAL_Core_FOUND)
target_link_libraries(CGAL_cone_spanners PRIVATE CGAL::CGAL_Core)
CGAL_target_use_Eigen(CGAL_cone_spanners)
endif()
#example in doc not installed
add_library(simple_triangulation MODULE simple_triangulation.cpp)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS simple_triangulation)
target_link_libraries(simple_triangulation ${IPE_LIBRARIES})
CGAL_target_use_Eigen(simple_triangulation)
cgal_add_compilation_test(simple_triangulation)
else()

View File

@ -5,7 +5,6 @@ cmake_minimum_required(VERSION 3.1...3.15)
project( Classification_Examples )
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )
@ -22,127 +21,73 @@ if ( NOT Boost_FOUND )
return()
endif()
find_package( Boost OPTIONAL_COMPONENTS serialization iostreams )
set(Classification_dependencies_met TRUE)
if( WIN32 )
# to avoid a warning with old cmake
set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
find_package( Boost OPTIONAL_COMPONENTS bzip2 zlib)
else()
find_package(ZLIB QUIET)
find_package( Boost OPTIONAL_COMPONENTS serialization iostreams )
if (NOT Boost_SERIALIZATION_FOUND)
message(STATUS "NOTICE: This project requires Boost Serialization, and will not be compiled.")
set(Classification_dependencies_met FALSE)
endif()
if (NOT Boost_IOSTREAMS_FOUND)
message(STATUS "NOTICE: This project requires Boost IO Streams, and will not be compiled.")
set(Classification_dependencies_met FALSE)
endif()
find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning
if (NOT OpenCV_FOUND)
message(STATUS "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.")
endif()
find_package(TensorFlow QUIET)
if (NOT TensorFlow_FOUND)
message(STATUS "NOTICE: TensorFlow was not found. TensorFlow neural network predicate for classification won't be available.")
endif()
find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
set(Classification_dependencies_met FALSE)
endif()
find_package(TBB QUIET)
find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning
# Use Eigen
find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
return()
else()
include( ${EIGEN3_USE_FILE} )
endif()
# Creating entries for all C++ files with "main" routine
# ##########################################################
# Classification examples
set(targets
example_classification
example_ethz_random_forest
example_feature
example_generation_and_training
example_mesh_classification
example_cluster_classification)
# Classification requires some C++11 features
set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
# Libraries and flags
set(classification_linked_libraries)
set(classification_compile_definitions)
if (Boost_SERIALIZATION_FOUND AND Boost_IOSTREAMS_FOUND)
if(TARGET Boost::serialization AND TARGET Boost::iostreams)
set(classification_linked_libraries Boost::serialization Boost::iostreams)
else()
set(classification_linked_libraries ${classification_linked_libraries}
${Boost_SERIALIZATION_LIBRARY}
${Boost_IOSTREAMS_LIBRARY})
endif()
else()
if (NOT Boost_SERIALIZATION_FOUND)
message(STATUS "NOTICE: This project requires Boost Serialization, and will not be compiled.")
endif()
if (NOT Boost_IOSTREAMS_FOUND)
message(STATUS "NOTICE: This project requires Boost IO Streams, and will not be compiled.")
endif()
if (NOT Classification_dependencies_met)
return()
endif()
if( WIN32 )
if (Boost_ZLIB_FOUND AND Boost_BZIP2_FOUND)
set(classification_linked_libraries ${classification_linked_libraries}
${Boost_ZLIB_LIBRARY} ${Boost_BZIP2_LIBRARY})
else()
message(STATUS "NOTICE: This project requires Boost ZLIB and Boost BZIP2, and will not be compiled.")
return()
endif()
else()
if(ZLIB_FOUND)
set(classification_linked_libraries ${classification_linked_libraries} ZLIB::ZLIB)
else()
message(STATUS "NOTICE: This project requires ZLIB, and will not be compiled.")
return()
endif()
endif()
create_single_source_cgal_program( "example_classification.cpp" )
create_single_source_cgal_program( "example_ethz_random_forest.cpp" )
create_single_source_cgal_program( "example_feature.cpp" )
create_single_source_cgal_program( "example_generation_and_training.cpp" )
create_single_source_cgal_program( "example_mesh_classification.cpp" )
create_single_source_cgal_program( "example_cluster_classification.cpp" )
if (OpenCV_FOUND)
message(STATUS "Found OpenCV ${OpenCV_VERSION}")
include_directories(${OpenCV_INCLUDE_DIRS})
set(classification_linked_libraries ${classification_linked_libraries}
${OpenCV_LIBS})
set(classification_compile_definitions ${classification_compile_definitions}
"-DCGAL_LINKED_WITH_OPENCV")
set(targets ${targets} example_opencv_random_forest)
else()
message(STATUS "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.")
create_single_source_cgal_program( "example_opencv_random_forest.cpp" )
CGAL_target_use_OpenCV(example_opencv_random_forest)
endif()
find_package(TensorFlow QUIET)
if (TensorFlow_FOUND)
message(STATUS "Found TensorFlow")
include_directories( ${TensorFlow_INCLUDE_DIR} )
set(classification_linked_libraries ${classification_linked_libraries}
${TensorFlow_LIBRARY})
set(classification_compile_definitions ${classification_compile_definitions}
"-DCGAL_LINKED_WITH_TENSORFLOW")
set(targets ${targets} example_tensorflow_neural_network)
else()
message(STATUS "NOTICE: TensorFlow not found, Neural Network predicate for classification won't be available.")
create_single_source_cgal_program( "example_tensorflow_neural_network.cpp" )
CGAL_target_use_TensorFlow(example_tensorflow_neural_network)
endif()
# Creating targets with correct libraries and flags
foreach(target ${targets})
create_single_source_cgal_program( "${target}.cpp" CXX_FEATURES ${needed_cxx_features} )
foreach(target
example_classification
example_ethz_random_forest
example_feature
example_generation_and_training
example_mesh_classification
example_cluster_classification
example_opencv_random_forest
example_tensorflow_neural_network)
if(TARGET ${target})
target_link_libraries(${target} PUBLIC ${classification_linked_libraries})
target_compile_definitions(${target} PUBLIC ${classification_compile_definitions})
CGAL_target_use_Eigen(${target})
CGAL_target_use_Boost_IOStreams(${target})
CGAL_target_use_Boost_Serialization(${target})
if(TBB_FOUND)
CGAL_target_use_TBB(${target})
endif()
endif()
endforeach()

View File

@ -5,7 +5,6 @@ cmake_minimum_required(VERSION 3.1...3.15)
project( Classification_Tests )
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )
@ -22,88 +21,39 @@ if ( NOT Boost_FOUND )
return()
endif()
set(Classification_dependencies_met TRUE)
find_package( Boost OPTIONAL_COMPONENTS serialization iostreams )
if( WIN32 )
# to avoid a warning with old cmake
set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
find_package( Boost OPTIONAL_COMPONENTS bzip2 zlib)
else()
find_package(ZLIB QUIET)
if (NOT Boost_SERIALIZATION_FOUND)
message(STATUS "NOTICE: This project requires Boost Serialization, and will not be compiled.")
set(Classification_dependencies_met FALSE)
endif()
if (NOT Boost_IOSTREAMS_FOUND)
message(STATUS "NOTICE: This project requires Boost IO Streams, and will not be compiled.")
set(Classification_dependencies_met FALSE)
endif()
# Use Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
set(Classification_dependencies_met FALSE)
endif()
find_package( TBB )
find_package(TBB QUIET)
# include for local directory
include_directories( BEFORE include )
# include for local package
# Creating entries for all C++ files with "main" routine
# ##########################################################
#add_definitions("-DCGAL_DO_NOT_USE_BOYKOV_KOLMOGOROV_MAXFLOW_SOFTWARE")
# Classification requires some C++11 features
set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
# Libraries and flags
set(classification_linked_libraries)
if (Boost_SERIALIZATION_FOUND AND Boost_IOSTREAMS_FOUND)
if(TARGET Boost::serialization AND TARGET Boost::iostreams)
set(classification_linked_libraries Boost::serialization Boost::iostreams)
else()
set(classification_linked_libraries ${classification_linked_libraries}
${Boost_SERIALIZATION_LIBRARY}
${Boost_IOSTREAMS_LIBRARY})
endif()
else()
if (NOT Boost_SERIALIZATION_FOUND)
message(STATUS "NOTICE: This project requires Boost Serialization, and will not be compiled.")
endif()
if (NOT Boost_IOSTREAMS_FOUND)
message(STATUS "NOTICE: This project requires Boost IO Streams, and will not be compiled.")
endif()
if (NOT Classification_dependencies_met)
return()
endif()
if( WIN32 )
if (Boost_ZLIB_FOUND AND Boost_BZIP2_FOUND)
set(classification_linked_libraries ${classification_linked_libraries}
${Boost_ZLIB_LIBRARY} ${Boost_BZIP2_LIBRARY})
else()
message(STATUS "NOTICE: This project requires Boost ZLIB and Boost BZIP2, and will not be compiled.")
return()
endif()
else()
if(ZLIB_FOUND)
set(classification_linked_libraries ${classification_linked_libraries} ZLIB::ZLIB)
else()
message(STATUS "NOTICE: This project requires ZLIB, and will not be compiled.")
return()
endif()
endif()
create_single_source_cgal_program( "test_classification_point_set.cpp" )
create_single_source_cgal_program( "test_classification_io.cpp" )
create_single_source_cgal_program( "test_classification_point_set.cpp" CXX_FEATURES ${needed_cxx_features} )
if(TARGET test_classification_point_set)
target_link_libraries(test_classification_point_set PUBLIC ${classification_linked_libraries})
if (TBB_FOUND)
CGAL_target_use_TBB( test_classification_point_set )
foreach(target test_classification_point_set test_classification_io)
CGAL_target_use_Eigen(${target})
CGAL_target_use_Boost_IOStreams(${target})
CGAL_target_use_Boost_Serialization(${target})
if(TBB_FOUND)
CGAL_target_use_TBB(${target})
endif()
endif()
endforeach()
create_single_source_cgal_program( "test_classification_io.cpp" CXX_FEATURES ${needed_cxx_features} )
if(TARGET test_classification_io)
target_link_libraries(test_classification_io PUBLIC ${classification_linked_libraries})
if (TBB_FOUND)
CGAL_target_use_TBB( test_classification_io )
endif()
endif()

View File

@ -126,10 +126,14 @@ The exhaustive list of \sc{Qt}5 components used in demos is:
\sc{Eigen} is a `C++` template library for linear algebra. \sc{Eigen} supports all
matrix sizes, various matrix decomposition methods and sparse linear solvers.
In \cgal, \sc{Eigen} is used in many packages such as \ref PkgPoissonSurfaceReconstruction3
or \ref PkgJetFitting3, providing sparse linear solvers and singular value decompositions.
A package dependency over \sc{Eigen} is marked on the
<a href="https://doc.cgal.org/latest/Manual/packages.html">Package Overview</a> page.
In \cgal, \sc{Eigen} is used in many packages such as \ref
PkgPoissonSurfaceReconstruction3 or \ref PkgJetFitting3, providing
sparse linear solvers and singular value decompositions. A package
dependency over \sc{Eigen} is marked on the <a
href="https://doc.cgal.org/latest/Manual/packages.html">Package
Overview</a> page. In order to use Eigen in \cgal programs, the
provided CMake function `CGAL_target_use_Eigen(<target>)` should be
used.
The \sc{Eigen} web site is <A HREF="http://eigen.tuxfamily.org/index.php?title=Main_Page">`http://eigen.tuxfamily.org`</A>.
@ -194,7 +198,9 @@ It can be downloaded from <A HREF="http://esbtl.sourceforge.net/">`http://esbtl.
\sc{Tbb} (Threading Building Blocks) is a library developed by Intel Corporation for writing software
programs that take advantage of multi-core processors.
In \cgal, \sc{Tbb} is used by the packages that offer parallel code.
In \cgal, \sc{Tbb} is used by the packages that offer parallel
code. In order to use \sc{Tbb} in \cgal programs, the provided CMake
function `CGAL_target_use_TBB(<target>)` should be used.
The \sc{Tbb} web site is <A HREF="https://www.threadingbuildingblocks.org">`https://www.threadingbuildingblocks.org`</A>.
@ -204,7 +210,9 @@ The \sc{Tbb} web site is <A HREF="https://www.threadingbuildingblocks.org">`http
the LAS format (or the compressed LAZ format).
In \cgal, \sc{LASlib} is used to provide input and output functions in
the \ref PkgPointSetProcessing3 package.
the \ref PkgPointSetProcessing3 package. In order to use \sc{LASlib} in
\cgal programs, the provided CMake function
`CGAL_target_use_LASLIB(<target>)` should be used.
The \sc{LASlib} web site is <a
href="https://rapidlasso.com/lastools/">`https://rapidlasso.com/lastools/`</a>. \sc{LASlib}
@ -217,7 +225,9 @@ CMake based install procedure</a>.
\sc{OpenCV} (Open Computer Vision) is a library designed for computer
vision, computer graphics and machine learning.
In \cgal, \sc{OpenCV} is used by the \ref PkgClassification package.
In \cgal, \sc{OpenCV} is used by the \ref PkgClassification
package. In order to use \sc{OpenCV} in \cgal programs, the provided
CMake function `CGAL_target_use_OpenCV(<target>)` should be used.
The \sc{OpenCV} web site is <A HREF="https://opencv.org/">`https://opencv.org/`</A>.
@ -235,6 +245,9 @@ enable and compile the following targets:
- `tensorflow_BUILD_PYTHON_BINDINGS`
- `tensorflow_BUILD_SHARED_LIB`.
In order to use \sc{TensorFlow} in \cgal programs, the provided CMake
function `CGAL_target_use_TensorFlow(<target>)` should be used.
The \sc{TensorFlow} web site is <A HREF="https://www.tensorflow.org/">`https://www.tensorflow.org/`</A>.
\subsection thirdpartyMETIS METIS
@ -274,7 +287,10 @@ for more information.
\sc{GLPK} (GNU Linear Programming Kit) is a library for solving linear programming (LP), mixed integer programming (MIP), and other related problems.
In \cgal, \sc{GLPK} provides an optional linear integer program solver in the \ref PkgPolygonalSurfaceReconstruction package.
In \cgal, \sc{GLPK} provides an optional linear integer program solver
in the \ref PkgPolygonalSurfaceReconstruction package. In order to use
\sc{GLPK} in \cgal programs, the provided CMake function
`CGAL_target_use_GLPK(<target>)` should be used.
The \sc{GLPK} web site is <A HREF="https://www.gnu.org/software/glpk/">`https://www.gnu.org/software/glpk/`</A>.
@ -282,7 +298,10 @@ The \sc{GLPK} web site is <A HREF="https://www.gnu.org/software/glpk/">`https://
\sc{SCIP} (Solving Constraint Integer Programs) is currently one of the fastest open source solvers for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP).
In \cgal, \sc{SCIP} provides an optional linear integer program solver in the \ref PkgPolygonalSurfaceReconstruction package.
In \cgal, \sc{SCIP} provides an optional linear integer program solver
in the \ref PkgPolygonalSurfaceReconstruction package. In order to use
\sc{SCIP} in \cgal programs, the provided CMake function
`CGAL_target_use_SCIP(<target>)` should be used.
The \sc{SCIP} web site is <A HREF="http://scip.zib.de/">`http://scip.zib.de/`</A>.

View File

@ -339,6 +339,44 @@ Note that the variables in the table below are being used.
| `TBB_MALLOCPROXY_DEBUG_LIBRARY` | Full pathname of the compiled TBB debug malloc_proxy library (optional) | CMake |
| `TBB_MALLOCPROXY_RELEASE_LIBRARY` | Full pathname of the compiled TBB release malloc_proxy library (optional) | CMake |
\subsection installation_laslib LASlib library
If LASLIB is not automatically found, the following variables must be set:
| Variable | Description | Type |
| :- | :- | :- |
| `LASLIB_INCLUDE_DIR` | Directory containing the file `lasreader.hpp` | CMake |
| `LASZIP_INCLUDE_DIR` | Directory containing the file `mydefs.hpp` | CMake |
| `LASLIB_LIBRARIES` | Full pathname of the compiled LASLIB library | CMake |
\subsection installation_OpenCV OpenCV library
The environment variable `OPENCV_DIR` should be set to the directory
containing the file `OpenCVConfig.cmake` provided by OpenCV.
\subsection installation_TensorFlow TensorFlow library
If TensorFlow is not automatically found, the following variables must be set:
| Variable | Description | Type |
| :- | :- | :- |
| `TensorFlow_INCLUDE_DIR` | Directory containing the directories `tensorflow/core`, `tensorflow/cc`, etc. | CMake |
| `TensorFlow_LIBRARY` | Full pathname of the compiled TensorFlow C++ library | CMake |
\subsection installation_SCIP SCIP library
The environment variable `SCIP_DIR` should be set to the directory
containing the file `scip-config.cmake` provided by SCIP.
\subsection installation_GLPK GLPK library
If GLPK is not automatically found, the following variables must be set:
| Variable | Description | Type |
| :- | :- | :- |
| `GLPK_INCLUDE_DIR` | Directory containing the file `glpk.h` | CMake |
| `GLPK_LIBRARIES` | Full pathname of the compiled GLPK library | CMake |
\section installation_compiler_workarounds Compiler Workarounds
A number of boolean flags are used to workaround compiler bugs and

View File

@ -12,9 +12,6 @@ if ( CGAL_FOUND )
# Use Eigen
find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
@ -23,6 +20,10 @@ if ( CGAL_FOUND )
OR NOT (${cppfile} STREQUAL "random_points_on_tetrahedral_mesh_3.cpp")
OR EIGEN3_FOUND)
create_single_source_cgal_program( "${cppfile}" )
if (EIGEN3_FOUND)
get_filename_component(target ${cppfile} NAME_WE)
CGAL_target_use_Eigen(${target})
endif()
endif()
endforeach()

View File

@ -12,15 +12,16 @@ if ( CGAL_FOUND )
# Use Eigen
find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
if(NOT (${cppfile} STREQUAL "generic_random_test.cpp") OR EIGEN3_FOUND)
create_single_source_cgal_program( "${cppfile}" )
if (EIGEN3_FOUND)
get_filename_component(target ${cppfile} NAME_WE)
CGAL_target_use_Eigen(${target})
endif()
endif()
endforeach()

View File

@ -16,9 +16,7 @@ endif()
find_package(CGAL COMPONENTS Qt5 Core)
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
else()
if (NOT EIGEN3_FOUND)
message(STATUS "NOTICE: This project requires the Eigen library, and will not be compiled.")
return()
endif()
@ -48,6 +46,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND )
# The executable itself.
add_executable ( Polygon_2 Polygon_2.cpp ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} )
CGAL_target_use_Eigen(Polygon_2)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polygon_2 )

View File

@ -34,11 +34,8 @@ endif()
find_package(Eigen3 3.3.0)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
else()
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library (3.3 or greater), and will not be compiled.")
return()
endif()
@ -54,6 +51,10 @@ include_directories( BEFORE include )
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program( "heat_method.cpp" )
CGAL_target_use_Eigen(heat_method)
create_single_source_cgal_program( "heat_method_polyhedron.cpp" )
CGAL_target_use_Eigen(heat_method_polyhedron)
create_single_source_cgal_program( "heat_method_surface_mesh.cpp" )
CGAL_target_use_Eigen(heat_method_surface_mesh)
create_single_source_cgal_program( "heat_method_surface_mesh_direct.cpp" )
CGAL_target_use_Eigen(heat_method_surface_mesh_direct)

View File

@ -34,11 +34,8 @@ endif()
find_package(Eigen3 3.3.0)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
else()
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library (3.3 or greater), and will not be compiled.")
return()
endif()
@ -52,5 +49,8 @@ include_directories( BEFORE include )
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program( "heat_method_concept.cpp" )
CGAL_target_use_Eigen(heat_method_concept)
create_single_source_cgal_program( "heat_method_surface_mesh_test.cpp" )
CGAL_target_use_Eigen(heat_method_surface_mesh_test)
create_single_source_cgal_program( "heat_method_surface_mesh_direct_test.cpp" )
CGAL_target_use_Eigen(heat_method_surface_mesh_direct_test)

View File

@ -56,10 +56,13 @@ if( NOT CGAL_COMMON_FILE_INCLUDED )
endif()
endif()
# set minimal version of some optional libraries:
set( Eigen3_FIND_VERSION "3.1.0")
# set use-file for Eigen3 (needed to have default solvers)
set(EIGEN3_USE_FILE "UseEigen3")
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_Boost_IOStreams.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_Boost_Serialization.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_Eigen.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_GLPK.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_LASLIB.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_OpenCV.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_SCIP.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TensorFlow.cmake)
endif()

View File

@ -0,0 +1,39 @@
if (CGAL_target_use_Boost_IOStreams_included)
return()
endif()
set(CGAL_target_use_Boost_IOStreams_included TRUE)
function(CGAL_target_use_Boost_IOStreams target)
if( WIN32 )
# to avoid a warning with old cmake
set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
find_package( Boost OPTIONAL_COMPONENTS bzip2 zlib)
else()
find_package(ZLIB QUIET)
endif()
if(TARGET Boost::iostreams)
target_link_libraries(${target} PUBLIC Boost::iostreams)
else()
target_link_libraries(${target} PUBLIC ${Boost_IOSTREAMS_LIBRARY})
endif()
if( WIN32 )
if (Boost_ZLIB_FOUND AND Boost_BZIP2_FOUND)
target_link_libraries(${target} PUBLIC ${Boost_ZLIB_LIBRARY} ${Boost_BZIP2_LIBRARY})
else()
message(STATUS "NOTICE: This project requires Boost ZLIB and Boost BZIP2, and will not be compiled.")
return()
endif()
else()
if(ZLIB_FOUND)
target_link_libraries(${target} PUBLIC ZLIB::ZLIB)
else()
message(STATUS "NOTICE: This project requires ZLIB, and will not be compiled.")
return()
endif()
endif()
endfunction()

View File

@ -0,0 +1,14 @@
if (CGAL_target_use_Boost_Serialization_included)
return()
endif()
set(CGAL_target_use_Boost_Serialization_included TRUE)
function(CGAL_target_use_Boost_Serialization target)
if(TARGET Boost::serialization)
target_link_libraries(${target} PUBLIC Boost::serialization)
else()
target_link_libraries(${target} PUBLIC ${Boost_SERIALIZATION_LIBRARY})
endif()
endfunction()

View File

@ -0,0 +1,13 @@
if (CGAL_target_use_Eigen_included)
return()
endif()
set(CGAL_target_use_Eigen_included TRUE)
set( Eigen3_FIND_VERSION "3.1.0")
set(EIGEN3_USE_FILE "UseEigen3")
function(CGAL_target_use_Eigen target)
target_include_directories(${target} PUBLIC ${EIGEN3_INCLUDE_DIR})
target_compile_options( ${target} PUBLIC -DCGAL_EIGEN3_ENABLED)
endfunction()

View File

@ -0,0 +1,11 @@
if (CGAL_target_use_GLPK_included)
return()
endif()
set(CGAL_target_use_GLPK_included TRUE)
function(CGAL_target_use_GLPK target)
target_include_directories(${target} PUBLIC ${GLPK_INCLUDE_DIR})
target_compile_options(${target} PUBLIC -DCGAL_USE_GLPK)
target_link_libraries(${target} PUBLIC ${GLPK_LIBRARIES})
endfunction()

View File

@ -0,0 +1,11 @@
if (CGAL_target_use_LASLIB_included)
return()
endif()
set(CGAL_target_use_LASLIB_included TRUE)
function(CGAL_target_use_LASLIB target)
target_include_directories(${target} PUBLIC ${LASLIB_INCLUDE_DIR})
target_include_directories(${target} PUBLIC ${LASZIP_INCLUDE_DIR})
target_compile_options( ${target} PUBLIC -DCGAL_LINKED_WITH_LASLIB)
target_link_libraries(${target} PUBLIC ${LASLIB_LIBRARIES})
endfunction()

View File

@ -0,0 +1,10 @@
if (CGAL_target_use_OpenCV_included)
return()
endif()
set(CGAL_target_use_OpenCV_included TRUE)
function(CGAL_target_use_OpenCV target)
target_include_directories(${target} PUBLIC ${OpenCV_INCLUDE_DIRS})
target_compile_options( ${target} PUBLIC -DCGAL_LINKED_WITH_OPENCV)
target_link_libraries(${target} PUBLIC ${OpenCV_LIBS})
endfunction()

View File

@ -0,0 +1,11 @@
if (CGAL_target_use_SCIP_included)
return()
endif()
set(CGAL_target_use_SCIP_included TRUE)
function(CGAL_target_use_SCIP target)
target_include_directories(${target} PUBLIC ${SCIP_INCLUDE_DIRS})
target_compile_options(${target} PUBLIC -DCGAL_USE_SCIP)
target_link_libraries(${target} PUBLIC ${SCIP_LIBRARIES})
endfunction()

View File

@ -0,0 +1,10 @@
if (CGAL_target_use_TensorFlow_included)
return()
endif()
set(CGAL_target_use_TensorFlow_included TRUE)
function(CGAL_target_use_TensorFlow target)
target_include_directories(${target} PUBLIC ${TensorFlow_INCLUDE_DIR})
target_compile_options( ${target} PUBLIC -DCGAL_LINKED_WITH_TENSORFLOW)
target_link_libraries(${target} PUBLIC ${TensorFlow_LIBRARU})
endfunction()

View File

@ -7,3 +7,5 @@ include_directories( SYSTEM ${EIGEN3_INCLUDE_DIR} )
add_definitions(-DCGAL_EIGEN3_ENABLED)
set (EIGEN3_SETUP TRUE)
message(DEPRECATION "This file UseEigen.cmake is deprecated, and the function `CGAL_target_use_Eigen` from CGAL_target_use_Eigen.cmake should be used instead.")

View File

@ -2,3 +2,6 @@
# It assumes that find_package(LASLIB) was already called.
add_definitions(-DCGAL_LINKED_WITH_LASLIB)
message(DEPRECATION "This file UseLASLIB.cmake is deprecated, and the function `CGAL_target_use_LASLIB` from CGAL_target_use_LASLIB.cmake should be used instead.")

View File

@ -14,7 +14,6 @@ if ( CGAL_FOUND )
# use Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
# Link with Boost.ProgramOptions (optional)
find_package(Boost QUIET COMPONENTS program_options)
if(Boost_PROGRAM_OPTIONS_FOUND)
@ -30,9 +29,11 @@ if ( CGAL_FOUND )
list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY})
endif()
create_single_source_cgal_program( "Mesh_estimation.cpp" )
create_single_source_cgal_program( "Single_estimation.cpp" )
create_single_source_cgal_program( "Mesh_estimation.cpp" )
CGAL_target_use_Eigen(Mesh_estimation)
create_single_source_cgal_program( "Single_estimation.cpp" )
CGAL_target_use_Eigen(Single_estimation)
else()
message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.")
endif()

View File

@ -14,8 +14,8 @@ if ( CGAL_FOUND )
# use Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "blind_1pt.cpp" )
CGAL_target_use_Eigen(blind_1pt)
else()
message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.")
endif()

View File

@ -48,8 +48,6 @@ if ( CGAL_FOUND )
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
return()
else()
include( ${EIGEN3_USE_FILE} )
endif()
find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE)
@ -72,49 +70,99 @@ if ( CGAL_FOUND )
# Compilable examples
create_single_source_cgal_program( "mesh_hybrid_mesh_domain.cpp" )
CGAL_target_use_Eigen(mesh_hybrid_mesh_domain)
create_single_source_cgal_program( "mesh_implicit_sphere.cpp" )
CGAL_target_use_Eigen(mesh_implicit_sphere)
create_single_source_cgal_program( "mesh_implicit_sphere_variable_size.cpp" )
CGAL_target_use_Eigen(mesh_implicit_sphere_variable_size)
create_single_source_cgal_program( "mesh_two_implicit_spheres_with_balls.cpp" )
CGAL_target_use_Eigen(mesh_two_implicit_spheres_with_balls)
create_single_source_cgal_program( "mesh_implicit_domains_2.cpp" "implicit_functions.cpp" )
CGAL_target_use_Eigen(mesh_implicit_domains_2)
create_single_source_cgal_program( "mesh_cubes_intersection.cpp" )
CGAL_target_use_Eigen(mesh_cubes_intersection)
create_single_source_cgal_program( "mesh_cubes_intersection_with_features.cpp" )
CGAL_target_use_Eigen(mesh_cubes_intersection_with_features)
create_single_source_cgal_program( "mesh_implicit_domains.cpp" "implicit_functions.cpp" )
CGAL_target_use_Eigen(mesh_implicit_domains)
create_single_source_cgal_program( "mesh_polyhedral_domain.cpp" )
CGAL_target_use_Eigen(mesh_polyhedral_domain)
create_single_source_cgal_program( "mesh_polyhedral_domain_sm.cpp" )
CGAL_target_use_Eigen(mesh_polyhedral_domain_sm)
create_single_source_cgal_program( "mesh_polyhedral_domain_with_surface_inside.cpp" )
CGAL_target_use_Eigen(mesh_polyhedral_domain_with_surface_inside)
create_single_source_cgal_program( "remesh_polyhedral_surface.cpp" )
CGAL_target_use_Eigen(remesh_polyhedral_surface)
create_single_source_cgal_program( "remesh_polyhedral_surface_sm.cpp" )
CGAL_target_use_Eigen(remesh_polyhedral_surface_sm)
create_single_source_cgal_program( "mesh_polyhedral_domain_with_features.cpp" )
CGAL_target_use_Eigen(mesh_polyhedral_domain_with_features)
create_single_source_cgal_program( "mesh_polyhedral_domain_with_features_sm.cpp" )
CGAL_target_use_Eigen(mesh_polyhedral_domain_with_features_sm)
create_single_source_cgal_program( "mesh_polyhedral_domain_with_lipschitz_sizing.cpp" )
CGAL_target_use_Eigen(mesh_polyhedral_domain_with_lipschitz_sizing)
create_single_source_cgal_program( "mesh_polyhedral_complex.cpp" )
CGAL_target_use_Eigen(mesh_polyhedral_complex)
create_single_source_cgal_program( "mesh_polyhedral_complex_sm.cpp" )
CGAL_target_use_Eigen(mesh_polyhedral_complex_sm)
if( WITH_CGAL_ImageIO )
if( VTK_FOUND AND ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) )
add_executable ( mesh_3D_gray_vtk_image mesh_3D_gray_vtk_image.cpp )
CGAL_target_use_Eigen(mesh_3D_gray_vtk_image)
target_link_libraries( mesh_3D_gray_vtk_image ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${VTK_LIBRARIES})
cgal_add_test( mesh_3D_gray_vtk_image )
add_to_cached_list( CGAL_EXECUTABLE_TARGETS mesh_3D_gray_vtk_image )
endif()
create_single_source_cgal_program( "mesh_3D_gray_image.cpp" )
CGAL_target_use_Eigen(mesh_3D_gray_image)
create_single_source_cgal_program( "mesh_3D_gray_image_multiple_values.cpp" )
CGAL_target_use_Eigen(mesh_3D_gray_image_multiple_values)
create_single_source_cgal_program( "mesh_3D_image_with_features.cpp" )
CGAL_target_use_Eigen(mesh_3D_image_with_features)
if( CGAL_ImageIO_USE_ZLIB )
create_single_source_cgal_program( "mesh_optimization_example.cpp" )
CGAL_target_use_Eigen(mesh_optimization_example)
create_single_source_cgal_program( "mesh_optimization_lloyd_example.cpp" )
CGAL_target_use_Eigen(mesh_optimization_lloyd_example)
create_single_source_cgal_program( "mesh_3D_image.cpp" )
CGAL_target_use_Eigen(mesh_3D_image)
create_single_source_cgal_program( "mesh_3D_image_with_custom_initialization.cpp" )
CGAL_target_use_Eigen(mesh_3D_image_with_custom_initialization)
create_single_source_cgal_program( "mesh_3D_image_variable_size.cpp" )
CGAL_target_use_Eigen(mesh_3D_image_variable_size)
else()
message( STATUS "NOTICE: The examples mesh_3D_image.cpp, mesh_3D_image_variable_size.cpp, mesh_optimization_example.cpp and mesh_optimization_lloyd_example.cpp need CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." )
endif()
else()
message( STATUS "NOTICE: Some examples need the CGAL_ImageIO library, and will not be compiled." )
endif()
# create_single_source_cgal_program( "mesh_polyhedral_implicit_function.cpp" )
# create_single_source_cgal_program( "mesh_polyhedral_surface_tolerance_region.cpp" )
# create_single_source_cgal_program( "mesh_polyhedral_edge_tolerance_region.cpp" )

View File

@ -22,8 +22,6 @@ if ( CGAL_FOUND )
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
return()
else()
include( ${EIGEN3_USE_FILE} )
endif()
create_single_source_cgal_program( "test_boost_has_xxx.cpp" )
@ -61,6 +59,42 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "test_mesh_polyhedral_domain_with_features_deprecated.cpp" )
create_single_source_cgal_program( "test_meshing_with_one_step.cpp" )
foreach(target
test_boost_has_xxx
test_c3t3
test_mesh_capsule_var_distance_bound
test_implicit_multi_domain_to_labeling_function_wrapper
test_c3t3_io
test_c3t3_with_features
test_criteria
test_domain_with_polyline_features
test_labeled_mesh_domain_3
test_mesh_criteria_creation
test_c3t3_into_facegraph
test_without_detect_features
test_meshing_3D_image
test_meshing_3D_image_deprecated
test_meshing_3D_gray_image
test_meshing_3D_gray_image_deprecated
test_meshing_implicit_function
test_meshing_implicit_function_deprecated
test_meshing_polyhedral_complex
test_meshing_polyhedron
test_meshing_polylines_only
test_meshing_polyhedron_with_features
test_meshing_verbose
test_meshing_unit_tetrahedron
test_meshing_with_default_edge_size
test_meshing_determinism
test_c3t3_extract_subdomains_boundaries
test_mesh_3_issue_1554
test_mesh_polyhedral_domain_with_features_deprecated
test_meshing_with_one_step.cpp)
if(TARGET ${target})
CGAL_target_use_Eigen(${target})
endif()
endforeach()
foreach(target
test_meshing_verbose
test_meshing_polyhedron_with_features

View File

@ -18,10 +18,8 @@ if ( CGAL_FOUND )
find_package(Eigen3)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "Epick_d.cpp" )
CGAL_target_use_Eigen(Epick_d)
else()
message(STATUS "NOTICE: This program requires the Eigen3 library, and will not be compiled.")

View File

@ -19,13 +19,6 @@ namespace Eigen {
template <class NT,class ROOT, class ACDE_TAG, class FP_TAG>
struct NumTraits<CGAL::Sqrt_extension<NT, ROOT, ACDE_TAG, FP_TAG> >
{
typedef CGAL::Sqrt_extension<NT, ROOT, ACDE_TAG, FP_TAG> Real;
typedef Real NonInteger;
typedef Real Nested;
typedef Real Literal;
static inline Real epsilon() { return NumTraits<NT>::epsilon(); }
enum {
IsInteger = 0,
IsSigned = 1,
@ -35,6 +28,19 @@ namespace Eigen {
AddCost = 2*NumTraits<NT>::AddCost+NumTraits<ROOT>::ReadCost,
MulCost = 5*NumTraits<NT>::MulCost+2*NumTraits<NT>::AddCost
};
typedef CGAL::Sqrt_extension<NT, ROOT, ACDE_TAG, FP_TAG> Real;
typedef Real NonInteger;
typedef Real Nested;
typedef Real Literal;
static inline Real epsilon() { return NumTraits<NT>::epsilon(); }
static inline int digits10() { return NumTraits<NT>::digits10(); }
static inline Real dummy_precision() { return NumTraits<NT>::dummy_precision(); }
static inline Real highest() { return NumTraits<NT>::highest(); }
static inline Real lowest() { return NumTraits<NT>::lowest(); }
static inline Real infinity() { return NumTraits<NT>::infinity(); }
static inline Real quiet_NaN() { return NumTraits<NT>::quiet_NaN(); }
};
}

View File

@ -26,7 +26,6 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "Counted_number.cpp" )
create_single_source_cgal_program( "double.cpp" )
create_single_source_cgal_program( "doubletst.cpp" )
create_single_source_cgal_program( "eigen.cpp" )
create_single_source_cgal_program( "float.cpp" )
create_single_source_cgal_program( "floattst.cpp" )
create_single_source_cgal_program( "Gmpfr.cpp" )
@ -80,7 +79,13 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "Gmpfr_bug.cpp" )
create_single_source_cgal_program( "Quotient_new.cpp" )
create_single_source_cgal_program( "test_nt_Coercion_traits.cpp" )
create_single_source_cgal_program( "eigen.cpp" )
find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater)
if (EIGEN3_FOUND)
cgal_target_use_Eigen(eigen)
endif()
else( CGAL_FOUND )
message(STATUS

View File

@ -34,7 +34,7 @@ void check_(){
v << 1, 2, 3;
NT t=v.dot(v);
v+=d*m*(t*v);
int si=v.size();
std::ptrdiff_t si=v.size();
CGAL_USE(si);
}
template <class NT>
@ -59,7 +59,7 @@ int main(){
//check<CGAL::Lazy_exact_nt<CGAL::Quotient<CGAL::MP_Float> > >();
check<CGAL::Sqrt_extension<double,double> >();
#ifdef CGAL_USE_GMP
check<CGAL::Gmpz>();
// check<CGAL::Gmpz>();
check<CGAL::Gmpq>();
check<CGAL::Gmpfr>();
check<CGAL::Quotient<CGAL::Gmpz> >();
@ -69,7 +69,7 @@ int main(){
check<CGAL::Gmpfi>();
#endif
#ifdef CGAL_USE_CORE
check<CORE::BigInt>();
// check<CORE::BigInt>();
check<CORE::BigRat>();
check<CORE::BigFloat>();
check<CORE::Expr>();

View File

@ -26,8 +26,6 @@ find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
return()
else()
include( ${EIGEN3_USE_FILE} )
endif()
# Boost and its components
@ -46,3 +44,13 @@ create_single_source_cgal_program( "mesh_implicit_multi_domain.cpp" )
create_single_source_cgal_program( "mesh_implicit_shape_with_subdomains.cpp" )
create_single_source_cgal_program( "mesh_implicit_shape_with_optimizers.cpp" )
create_single_source_cgal_program( "mesh_implicit_shape_with_features.cpp" )
foreach(target
mesh_implicit_shape
mesh_implicit_multi_domain
mesh_implicit_shape_with_subdomains
mesh_implicit_shape_with_optimizers
mesh_implicit_shape_with_features)
CGAL_target_use_Eigen(${target})
endforeach()

View File

@ -19,14 +19,15 @@ if ( CGAL_FOUND )
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
return()
else()
include( ${EIGEN3_USE_FILE} )
endif()
create_single_source_cgal_program( "test_implicit_shapes_bunch.cpp" )
CGAL_target_use_Eigen(test_implicit_shapes_bunch)
create_single_source_cgal_program( "test_implicit_shapes_with_features.cpp" )
CGAL_target_use_Eigen(test_implicit_shapes_with_features)
create_single_source_cgal_program( "test_triply_periodic_minimal_surfaces.cpp" )
CGAL_target_use_Eigen(test_triply_periodic_minimal_surfaces)
else()
message(STATUS "This program requires the CGAL library, and will not be compiled.")

View File

@ -44,14 +44,9 @@ set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
create_single_source_cgal_program( "point_set_read_ply.cpp" CXX_FEATURES ${needed_cxx_features} )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (NOT EIGEN3_FOUND)
find_package(LAPACK)
if(LAPACK_FOUND)
include( ${LAPACK_USE_FILE} )
endif(LAPACK_FOUND)
else()
include( ${EIGEN3_USE_FILE} )
if (EIGEN3_FOUND)
create_single_source_cgal_program( "point_set_algo.cpp" )
CGAL_target_use_Eigen(point_set_algo)
endif()
create_single_source_cgal_program("draw_point_set_3.cpp" )

View File

@ -3,8 +3,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Point_set_processing_3_Examples )
# Find CGAL
find_package(CGAL QUIET)
@ -42,30 +40,21 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "bilateral_smooth_point_set_example.cpp" )
create_single_source_cgal_program( "grid_simplification_example.cpp" )
create_single_source_cgal_program( "grid_simplify_indices.cpp" )
create_single_source_cgal_program( "hierarchy_simplification_example.cpp" )
create_single_source_cgal_program( "normals_example.cpp" )
create_single_source_cgal_program( "property_map.cpp" )
create_single_source_cgal_program( "random_simplification_example.cpp" )
create_single_source_cgal_program( "read_write_xyz_point_set_example.cpp" )
create_single_source_cgal_program( "remove_outliers_example.cpp" )
create_single_source_cgal_program( "scale_estimation_example.cpp" )
create_single_source_cgal_program( "scale_estimation_2d_example.cpp" )
create_single_source_cgal_program( "wlop_simplify_and_regularize_point_set_example.cpp" )
create_single_source_cgal_program( "edge_aware_upsample_point_set_example.cpp" )
create_single_source_cgal_program( "structuring_example.cpp" )
create_single_source_cgal_program( "callback_example.cpp" )
set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
create_single_source_cgal_program( "read_ply_points_with_colors_example.cpp" CXX_FEATURES ${needed_cxx_features} )
create_single_source_cgal_program( "write_ply_points_example.cpp" CXX_FEATURES ${needed_cxx_features} )
create_single_source_cgal_program( "read_ply_points_with_colors_example.cpp" )
create_single_source_cgal_program( "write_ply_points_example.cpp" )
find_package(LASLIB)
if (LASLIB_FOUND)
include(${LASLIB_USE_FILE})
include_directories(${LASLIB_INCLUDE_DIR})
include_directories(${LASZIP_INCLUDE_DIR})
create_single_source_cgal_program( "read_las_example.cpp" CXX_FEATURES ${needed_cxx_features} )
target_link_libraries(read_las_example PRIVATE ${LASLIB_LIBRARIES})
create_single_source_cgal_program( "read_las_example.cpp" )
CGAL_target_use_LASLIB(read_las_example)
else()
message(STATUS "NOTICE : the LAS reader test requires LASlib and will not be compiled.")
endif()
@ -73,30 +62,51 @@ if ( CGAL_FOUND )
# Use Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
# Executables that require Eigen
create_single_source_cgal_program( "jet_smoothing_example.cpp" )
CGAL_target_use_Eigen(jet_smoothing_example)
create_single_source_cgal_program( "normal_estimation.cpp" )
CGAL_target_use_Eigen(normal_estimation)
create_single_source_cgal_program( "edges_example.cpp" )
else()
CGAL_target_use_Eigen(edges_example)
create_single_source_cgal_program( "callback_example.cpp" )
CGAL_target_use_Eigen(callback_example)
create_single_source_cgal_program( "scale_estimation_example.cpp" )
CGAL_target_use_Eigen(scale_estimation_example)
create_single_source_cgal_program( "scale_estimation_2d_example.cpp" )
CGAL_target_use_Eigen(scale_estimation_2d_example)
create_single_source_cgal_program( "hierarchy_simplification_example.cpp" )
CGAL_target_use_Eigen(hierarchy_simplification_example)
create_single_source_cgal_program( "normals_example.cpp" )
CGAL_target_use_Eigen(normals_example)
else()
message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.")
endif()
foreach(target
scale_estimation_example
wlop_simplify_and_regularize_point_set_example
bilateral_smooth_point_set_example
edge_aware_upsample_point_set_example
average_spacing_example
normals_example
jet_smoothing_example
normal_estimation
callback_example)
if(TBB_FOUND AND TARGET ${target})
CGAL_target_use_TBB(${target})
endif()
endforeach()
if (TBB_FOUND)
foreach(target
scale_estimation_example
wlop_simplify_and_regularize_point_set_example
bilateral_smooth_point_set_example
edge_aware_upsample_point_set_example
average_spacing_example
normals_example
jet_smoothing_example
normal_estimation
callback_example)
if(TARGET ${target})
CGAL_target_use_TBB(${target})
endif()
endforeach()
endif()
else()
message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.")

View File

@ -41,29 +41,41 @@ if ( CGAL_FOUND )
# Use Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
# Executables that require Eigen
create_single_source_cgal_program( "normal_estimation_test.cpp" )
CGAL_target_use_Eigen(normal_estimation_test)
create_single_source_cgal_program( "hierarchy_simplification_test.cpp" )
CGAL_target_use_Eigen(hierarchy_simplification_test)
create_single_source_cgal_program( "smoothing_test.cpp" )
CGAL_target_use_Eigen(smoothing_test)
create_single_source_cgal_program( "vcm_plane_test.cpp" )
CGAL_target_use_Eigen(vcm_plane_test)
create_single_source_cgal_program( "vcm_all_test.cpp" )
CGAL_target_use_Eigen(vcm_all_test)
create_single_source_cgal_program( "jet_pointer_as_property_map.cpp" )
CGAL_target_use_Eigen(jet_pointer_as_property_map)
else()
message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.")
endif()
foreach(target
analysis_test
smoothing_test
bilateral_smoothing_test
wlop_simplify_and_regularize_test
edge_aware_upsample_test
normal_estimation_test)
if(TBB_FOUND AND TARGET ${target})
CGAL_target_use_TBB(${target})
endif()
endforeach()
if (TBB_FOUND)
foreach(target
analysis_test
smoothing_test
bilateral_smoothing_test
wlop_simplify_and_regularize_test
edge_aware_upsample_test
normal_estimation_test)
if(TARGET ${target})
CGAL_target_use_TBB(${target})
endif()
endforeach()
endif()
else()

View File

@ -23,15 +23,14 @@ if ( CGAL_FOUND )
# Find Eigen3 (requires 3.1.0 or greater)
find_package(Eigen3 3.1.0)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
if (EIGEN3_FOUND)
# Executables that require Eigen 3
create_single_source_cgal_program( "poisson_reconstruction_example.cpp" )
CGAL_target_use_Eigen(poisson_reconstruction_example)
create_single_source_cgal_program( "poisson_reconstruction.cpp" )
CGAL_target_use_Eigen(poisson_reconstruction)
create_single_source_cgal_program( "poisson_reconstruction_function.cpp" )
CGAL_target_use_Eigen(poisson_reconstruction_function)
else()
message(STATUS "NOTICE: The examples need Eigen 3.1 (or greater) will not be compiled.")
endif()

View File

@ -25,11 +25,9 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if(EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
# Executables that require Eigen 3.1
create_single_source_cgal_program( "poisson_reconstruction_test.cpp" )
CGAL_target_use_Eigen(poisson_reconstruction_test)
else()
message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.")

View File

@ -29,10 +29,6 @@ endif()
# include for local package
find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater)
if (EIGEN3_FOUND)
# Executables that require Eigen 3.2
include( ${EIGEN3_USE_FILE} )
endif(EIGEN3_FOUND)
# Creating entries for all .cpp/.C files with "main" routine
# ##########################################################
@ -41,4 +37,8 @@ create_single_source_cgal_program( "polygon_mesh_slicer.cpp" )
create_single_source_cgal_program( "hole_filling.cpp" )
if (EIGEN3_FOUND)
CGAL_target_use_Eigen(polygon_mesh_slicer)
CGAL_target_use_Eigen(hole_filling)
endif()

View File

@ -46,14 +46,16 @@ find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater)
create_single_source_cgal_program( "hausdorff_distance_remeshing_example.cpp")
if (EIGEN3_FOUND)
# Executables that require Eigen 3.2
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "hole_filling_example.cpp" )
CGAL_target_use_Eigen(hole_filling_example)
create_single_source_cgal_program( "hole_filling_example_SM.cpp" )
CGAL_target_use_Eigen(hole_filling_example_SM)
create_single_source_cgal_program( "refine_fair_example.cpp")
CGAL_target_use_Eigen(refine_fair_example)
create_single_source_cgal_program( "shape_smoothing_example.cpp")
CGAL_target_use_Eigen(shape_smoothing_example)
create_single_source_cgal_program( "hole_filling_example_LCC.cpp" )
CGAL_target_use_Eigen(hole_filling_example_LCC)
endif(EIGEN3_FOUND)
create_single_source_cgal_program( "self_intersections_example.cpp" )
@ -80,7 +82,6 @@ create_single_source_cgal_program( "corefinement_mesh_union_with_attributes.cpp"
create_single_source_cgal_program( "corefinement_polyhedron_union.cpp" )
create_single_source_cgal_program( "random_perturbation_SM_example.cpp" )
create_single_source_cgal_program( "corefinement_LCC.cpp")
create_single_source_cgal_program( "hole_filling_example_LCC.cpp" )
create_single_source_cgal_program( "detect_features_example.cpp" )
create_single_source_cgal_program( "manifoldness_repair_example.cpp" )
create_single_source_cgal_program( "repair_polygon_soup_example.cpp" )
@ -90,11 +91,15 @@ create_single_source_cgal_program( "locate_example.cpp")
#create_single_source_cgal_program( "snapping_example.cpp")
if(OpenMesh_FOUND)
create_single_source_cgal_program( "compute_normals_example_OM.cpp" )
target_link_libraries( compute_normals_example_OM PRIVATE ${OPENMESH_LIBRARIES} )
create_single_source_cgal_program( "hole_filling_example_OM.cpp" )
target_link_libraries( hole_filling_example_OM PRIVATE ${OPENMESH_LIBRARIES} )
if (EIGEN3_FOUND)
create_single_source_cgal_program( "hole_filling_example_OM.cpp" )
target_link_libraries( hole_filling_example_OM PRIVATE ${OPENMESH_LIBRARIES} )
CGAL_target_use_Eigen( hole_filling_example_OM )
endif()
create_single_source_cgal_program( "point_inside_example_OM.cpp")
target_link_libraries( point_inside_example_OM PRIVATE ${OPENMESH_LIBRARIES} )

View File

@ -35,14 +35,16 @@ find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater)
find_package( TBB )
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
# Creating entries for all .cpp/.C files with "main" routine
# ##########################################################
create_single_source_cgal_program("fairing_test.cpp")
CGAL_target_use_Eigen(fairing_test)
create_single_source_cgal_program("triangulate_hole_Polyhedron_3_no_delaunay_test.cpp" )
CGAL_target_use_Eigen(triangulate_hole_Polyhedron_3_no_delaunay_test)
create_single_source_cgal_program("triangulate_hole_Polyhedron_3_test.cpp")
CGAL_target_use_Eigen(triangulate_hole_Polyhedron_3_test)
create_single_source_cgal_program("test_shape_smoothing.cpp")
CGAL_target_use_Eigen(test_shape_smoothing)
endif(EIGEN3_FOUND)

View File

@ -36,58 +36,35 @@ endif()
include( CGAL_CreateSingleSourceCGALProgram )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if(NOT EIGEN3_FOUND)
message(STATUS "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled.")
return()
endif()
find_package(SCIP QUIET)
if (NOT SCIP_FOUND )
find_package( GLPK QUIET)
if ( NOT GLPK_FOUND )
message( STATUS "NOTICE: This project requires either SCIP or GLPK, and will not be compiled.")
return()
endif()
endif()
create_single_source_cgal_program( "polyfit_example_without_input_planes.cpp" )
create_single_source_cgal_program( "polyfit_example_user_provided_planes.cpp" )
create_single_source_cgal_program( "polyfit_example_model_complexty_control.cpp" )
create_single_source_cgal_program( "polyfit_example_with_region_growing.cpp" )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if(EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
find_package( SCIP QUIET)
if ( NOT SCIP_FOUND )
find_package( GLPK QUIET)
if ( NOT GLPK_FOUND )
message( STATUS "NOTICE: This project requires either SCIP or GLPK, and will not be compiled. "
"Please provide either 'SCIP_DIR' or 'GLPK_INCLUDE_DIR' and 'GLPK_LIBRARIES'")
else()
include_directories( BEFORE ${GLPK_INCLUDE_DIR} )
target_link_libraries( polyfit_example_without_input_planes PRIVATE ${GLPK_LIBRARIES} )
target_compile_definitions(polyfit_example_without_input_planes PRIVATE -DCGAL_USE_GLPK)
target_link_libraries( polyfit_example_user_provided_planes PRIVATE ${GLPK_LIBRARIES} )
target_compile_definitions(polyfit_example_user_provided_planes PRIVATE -DCGAL_USE_GLPK)
target_link_libraries( polyfit_example_model_complexty_control PRIVATE ${GLPK_LIBRARIES} )
target_compile_definitions(polyfit_example_model_complexty_control PRIVATE -DCGAL_USE_GLPK)
target_link_libraries( polyfit_example_with_region_growing PRIVATE ${GLPK_LIBRARIES} )
target_compile_definitions(polyfit_example_with_region_growing PRIVATE -DCGAL_USE_GLPK)
message("GLPK found and used")
endif()
foreach(target
polyfit_example_without_input_planes
polyfit_example_user_provided_planes
polyfit_example_model_complexty_control
polyfit_example_with_region_growing)
CGAL_target_use_Eigen(${target})
if (SCIP_FOUND)
CGAL_target_use_SCIP(${target})
else()
include_directories( BEFORE ${SCIP_INCLUDE_DIRS} )
target_link_libraries( polyfit_example_without_input_planes PRIVATE ${SCIP_LIBRARIES} )
target_compile_definitions(polyfit_example_without_input_planes PRIVATE -DCGAL_USE_SCIP)
target_link_libraries( polyfit_example_user_provided_planes PRIVATE ${SCIP_LIBRARIES} )
target_compile_definitions(polyfit_example_user_provided_planes PRIVATE -DCGAL_USE_SCIP)
target_link_libraries( polyfit_example_model_complexty_control PRIVATE ${SCIP_LIBRARIES} )
target_compile_definitions(polyfit_example_model_complexty_control PRIVATE -DCGAL_USE_SCIP)
target_link_libraries( polyfit_example_with_region_growing PRIVATE ${SCIP_LIBRARIES} )
target_compile_definitions(polyfit_example_with_region_growing PRIVATE -DCGAL_USE_SCIP)
message("SCIP found and used")
CGAL_target_use_GLPK(${target})
endif()
else()
message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.")
endif()
endforeach()

View File

@ -5,10 +5,10 @@
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polygonal_surface_reconstruction.h>
#ifdef CGAL_USE_SCIP
#ifdef CGAL_USE_SCIP // defined (or not) by CMake scripts, do not define by hand
#include <CGAL/SCIP_mixed_integer_program_traits.h>
typedef CGAL::SCIP_mixed_integer_program_traits<double> MIP_Solver;
#elif defined(CGAL_USE_GLPK)
#elif defined(CGAL_USE_GLPK) // defined (or not) by CMake scripts, do not define by hand
#include <CGAL/GLPK_mixed_integer_program_traits.h>
typedef CGAL::GLPK_mixed_integer_program_traits<double> MIP_Solver;
#endif

View File

@ -5,10 +5,10 @@
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polygonal_surface_reconstruction.h>
#ifdef CGAL_USE_SCIP
#ifdef CGAL_USE_SCIP // defined (or not) by CMake scripts, do not define by hand
#include <CGAL/SCIP_mixed_integer_program_traits.h>
typedef CGAL::SCIP_mixed_integer_program_traits<double> MIP_Solver;
#elif defined(CGAL_USE_GLPK)
#elif defined(CGAL_USE_GLPK) // defined (or not) by CMake scripts, do not define by hand
#include <CGAL/GLPK_mixed_integer_program_traits.h>
typedef CGAL::GLPK_mixed_integer_program_traits<double> MIP_Solver;
#endif

View File

@ -7,12 +7,12 @@
#include <CGAL/Shape_detection/Region_growing/Region_growing_on_point_set.h>
#include <CGAL/Polygonal_surface_reconstruction.h>
#ifdef CGAL_USE_SCIP
#ifdef CGAL_USE_SCIP // defined (or not) by CMake scripts, do not define by hand
#include <CGAL/SCIP_mixed_integer_program_traits.h>
typedef CGAL::SCIP_mixed_integer_program_traits<double> MIP_Solver;
#elif defined(CGAL_USE_GLPK)
#elif defined(CGAL_USE_GLPK) // defined (or not) by CMake scripts, do not define by hand
#include <CGAL/GLPK_mixed_integer_program_traits.h>
typedef CGAL::GLPK_mixed_integer_program_traits<double> MIP_Solver;
@ -196,4 +196,4 @@ int main(int, char**)
return EXIT_SUCCESS;
}
#endif // defined(CGAL_USE_GLPK) || defined(CGAL_USE_SCIP)
#endif // defined(CGAL_USE_GLPK) || defined(CGAL_USE_SCIP)

View File

@ -6,12 +6,12 @@
#include <CGAL/Shape_detection/Efficient_RANSAC.h>
#include <CGAL/Polygonal_surface_reconstruction.h>
#ifdef CGAL_USE_SCIP
#ifdef CGAL_USE_SCIP // defined (or not) by CMake scripts, do not define by hand
#include <CGAL/SCIP_mixed_integer_program_traits.h>
typedef CGAL::SCIP_mixed_integer_program_traits<double> MIP_Solver;
#elif defined(CGAL_USE_GLPK)
#elif defined(CGAL_USE_GLPK) // defined (or not) by CMake scripts, do not define by hand
#include <CGAL/GLPK_mixed_integer_program_traits.h>
typedef CGAL::GLPK_mixed_integer_program_traits<double> MIP_Solver;

View File

@ -11,7 +11,7 @@ find_package( CGAL QUIET COMPONENTS )
if ( NOT CGAL_FOUND )
message(STATUS "This project requires the CGAL library, and will not be compiled.")
message(STATUS "NOTICE: This project requires the CGAL library, and will not be compiled.")
return()
endif()
@ -24,8 +24,11 @@ include( ${CGAL_USE_FILE} )
find_package( Boost REQUIRED )
if ( NOT Boost_FOUND )
message(STATUS "This project requires the Boost library, and will not be compiled.")
message(STATUS "NOTICE: This project requires the Boost library, and will not be compiled.")
return()
endif()
# Creating entries for all C++ files with "main" routine
@ -33,49 +36,26 @@ endif()
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program( "polygonal_surface_reconstruction_test.cpp" )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if(EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
# Executables that require Eigen 3.1
find_package( SCIP QUIET)
if (SCIP_FOUND)
include_directories( BEFORE ${SCIP_INCLUDE_DIRS} )
target_link_libraries( polygonal_surface_reconstruction_test PRIVATE ${SCIP_LIBRARIES} )
target_compile_definitions(polygonal_surface_reconstruction_test PRIVATE -DCGAL_USE_SCIP)
message("SCIP found and used")
endif()
find_package( GLPK QUIET)
if (GLPK_FOUND)
include_directories( BEFORE ${GLPK_INCLUDE_DIR} )
target_link_libraries( polygonal_surface_reconstruction_test PRIVATE ${GLPK_LIBRARIES} )
target_compile_definitions(polygonal_surface_reconstruction_test PRIVATE -DCGAL_USE_GLPK)
message("GLPK found and used")
endif()
if (NOT SCIP_FOUND AND NOT GLPK_FOUND)
message(STATUS "NOTICE: This project requires either SCIP or GLPK, some functions will not be tested. "
"Please provide either 'SCIP_DIR' or 'GLPK_INCLUDE_DIR' and 'GLPK_LIBRARIES'")
endif()
else()
message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.")
if(NOT EIGEN3_FOUND)
message(STATUS "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled.")
return()
endif()
find_package(SCIP QUIET)
if (NOT SCIP_FOUND )
find_package( GLPK QUIET)
if ( NOT GLPK_FOUND )
message( STATUS "NOTICE : This project requires either SCIP or GLPK, and will not be compiled.")
return()
endif()
endif()
create_single_source_cgal_program( "polygonal_surface_reconstruction_test.cpp")
CGAL_target_use_Eigen(polygonal_surface_reconstruction_test)
if (SCIP_FOUND)
CGAL_target_use_SCIP(polygonal_surface_reconstruction_test)
else()
CGAL_target_use_GLPK(polygonal_surface_reconstruction_test)
endif()

View File

@ -73,9 +73,6 @@ if(Qt5_FOUND)
endif(Qt5_FOUND)
find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif(EIGEN3_FOUND)
find_package( METIS )
@ -286,12 +283,15 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(EIGEN3_FOUND )
add_item(scene_textured_item Scene_textured_surface_mesh_item.cpp texture.cpp)
CGAL_target_use_Eigen(scene_textured_item)
qt5_wrap_ui( editionUI_FILES Plugins/Surface_mesh_deformation/Deform_mesh.ui )
add_item(scene_edit_item Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp
${editionUI_FILES})
CGAL_target_use_Eigen(scene_edit_item)
target_link_libraries(scene_edit_item PUBLIC scene_surface_mesh_item scene_k_ring_selection
scene_basic_objects)
add_item(scene_mcf_item Plugins/PMP/Scene_mcf_item.cpp)
CGAL_target_use_Eigen(scene_mcf_item)
endif()
add_item(scene_implicit_function_item Scene_implicit_function_item.cpp )
@ -303,19 +303,19 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
add_item(scene_nef_polyhedron_item Scene_nef_polyhedron_item.cpp)
target_link_libraries(scene_nef_polyhedron_item PUBLIC scene_surface_mesh_item)
add_item(scene_points_with_normal_item Scene_points_with_normal_item.cpp)
if (EIGEN3_FOUND)
CGAL_target_use_Eigen(scene_points_with_normal_item)
endif()
find_package(LASLIB)
if (LASLIB_FOUND)
include(${LASLIB_USE_FILE})
include_directories(${LASLIB_INCLUDE_DIR})
include_directories(${LASZIP_INCLUDE_DIR})
add_item(scene_points_with_normal_item Scene_points_with_normal_item.cpp)
CGAL_target_use_LASLIB(scene_points_with_normal_item)
if (MSVC)
target_compile_definitions( scene_points_with_normal_item PUBLIC "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS")
endif()
target_link_libraries( scene_points_with_normal_item PUBLIC ${LASLIB_LIBRARIES})
else()
add_item(scene_points_with_normal_item Scene_points_with_normal_item.cpp)
endif()
if(TBB_FOUND)
CGAL_target_use_TBB(scene_points_with_normal_item)
endif()

View File

@ -2,73 +2,51 @@ include( polyhedron_demo_macros )
if(EIGEN3_FOUND)
set(classification_linked_libraries)
set(classification_compile_definitions)
find_package(Boost OPTIONAL_COMPONENTS serialization iostreams)
set(Classification_dependencies_met TRUE)
if( WIN32 )
# to avoid a warning with old cmake
set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
find_package( Boost OPTIONAL_COMPONENTS serialization iostreams bzip2 zlib)
if( Boost_ZLIB_FOUND AND Boost_BZIP2_FOUND)
if(TARGET Boost::bzip2 AND TARGET Boost::zlib)
set(classification_linked_libraries ${classification_linked_libraries}
Boost::bzip2 Boost::zlib)
else()
set(classification_linked_libraries ${classification_linked_libraries}
${Boost_ZLIB_LIBRARY} ${Boost_BZIP2_LIBRARY})
endif()
endif()
find_package( Boost OPTIONAL_COMPONENTS serialization iostreams )
if (NOT Boost_SERIALIZATION_FOUND)
message(STATUS "NOTICE: Boost Serialization not found. Classification plugin won't be available.")
set(Classification_dependencies_met FALSE)
endif()
if (NOT Boost_IOSTREAMS_FOUND)
message(STATUS "NOTICE: Boost IOStreams not found. Classification plugin won't be available.")
set(Classification_dependencies_met FALSE)
endif()
if (Boost_SERIALIZATION_FOUND AND Boost_IOSTREAMS_FOUND AND (NOT WIN32 OR Boost_ZLIB_FOUND))
find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning
if (NOT OpenCV_FOUND)
message(STATUS "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.")
endif()
find_package(TensorFlow QUIET)
if (NOT TensorFlow_FOUND)
message(STATUS "NOTICE: TensorFlow not found, Neural Network predicate for classification won't be available.")
endif()
if (Classification_dependencies_met)
qt5_wrap_ui( classificationUI_FILES Classification_widget.ui Classification_advanced_widget.ui )
polyhedron_demo_plugin(classification_plugin Classification_plugin Point_set_item_classification Cluster_classification Surface_mesh_item_classification ${classificationUI_FILES} KEYWORDS Classification)
if(TARGET Boost::serialization AND TARGET Boost::iostreams)
set(classification_linked_libraries ${classification_linked_libraries}
Boost::serialization Boost::iostreams)
else()
set(classification_linked_libraries ${classification_linked_libraries}
${Boost_SERIALIZATION_LIBRARY}
${Boost_IOSTREAMS_LIBRARY})
target_link_libraries(classification_plugin PUBLIC scene_points_with_normal_item
scene_polylines_item scene_polygon_soup_item scene_surface_mesh_item scene_selection_item scene_color_ramp)
CGAL_target_use_Eigen(classification_plugin)
CGAL_target_use_Boost_IOStreams(classification_plugin)
CGAL_target_use_Boost_Serialization(classification_plugin)
if(OpenCV_FOUND)
CGAL_target_use_OpenCV(classification_plugin)
endif()
find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning
if (OpenCV_FOUND)
message(STATUS "Found OpenCV ${OpenCV_VERSION}")
include_directories(${OpenCV_INCLUDE_DIRS})
set(classification_linked_libraries ${classification_linked_libraries}
${OpenCV_LIBS})
set(classification_compile_definitions ${classification_compile_definitions}
"-DCGAL_LINKED_WITH_OPENCV")
else()
message(STATUS "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.")
if(TensorFlow_FOUND)
CGAL_target_use_TensorFlow(classification_plugin)
endif()
find_package(TensorFlow QUIET)
if (TensorFlow_FOUND)
message(STATUS "Found TensorFlow")
set(classification_linked_libraries ${classification_linked_libraries}
${TensorFlow_LIBRARY})
set(classification_compile_definitions ${classification_compile_definitions}
"-DCGAL_LINKED_WITH_TENSORFLOW")
include_directories( ${TensorFlow_INCLUDE_DIR} )
else()
message(STATUS "NOTICE: TensorFlow not found, Neural Network predicate for classification won't be available.")
if(TBB_FOUND)
CGAL_target_use_TBB(classification_plugin)
endif()
target_link_libraries(classification_plugin PUBLIC scene_points_with_normal_item
scene_polylines_item scene_polygon_soup_item scene_surface_mesh_item scene_selection_item scene_color_ramp ${classification_linked_libraries})
add_dependencies(classification_plugin point_set_selection_plugin selection_plugin)
target_compile_definitions(classification_plugin PUBLIC ${classification_compile_definitions})
else()
message(STATUS "NOTICE: Boost Serialization or IO Streams or ZLIB not found. Classification plugin won't be available.")
endif()
else(EIGEN3_FOUND)
message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Classification plugin will not be available.")
endif()

View File

@ -3,4 +3,5 @@ if(EIGEN3_FOUND)
qt5_wrap_ui( display_propertyUI_FILES Display_property.ui )
polyhedron_demo_plugin(display_property_plugin Display_property_plugin ${display_propertyUI_FILES})
target_link_libraries(display_property_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_color_ramp)
CGAL_target_use_Eigen(display_property_plugin)
endif(EIGEN3_FOUND)

View File

@ -71,8 +71,9 @@ else()
if (LASLIB_FOUND)
polyhedron_demo_plugin(las_plugin LAS_io_plugin KEYWORDS IO PointSetProcessing Classification)
target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item ${LASLIB_LIBRARIES})
target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item)
target_compile_features(las_plugin PRIVATE ${needed_cxx_features})
CGAL_target_use_LASLIB(las_plugin)
else()
message(STATUS "NOTICE : the LAS IO plugin needs LAS libraries and will not be compiled.")
endif()

View File

@ -51,7 +51,14 @@ polyhedron_demo_plugin(mesh_3_optimization_plugin Optimization_plugin
${meshingUI_FILES} KEYWORDS IO Mesh_3)
target_link_libraries(mesh_3_optimization_plugin PUBLIC scene_c3t3_item scene_surface_mesh_item scene_image_item scene_implicit_function_item )
# Use Eigen
find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
if (EIGEN3_FOUND)
CGAL_target_use_Eigen(mesh_3_optimization_plugin)
else() #eigen
message(STATUS "The Mesh_3_optimization_plugin requires Eigen, which was not found, and will use a deprecated class to replace it. Warnings are to be expected.")
endif()#eigen
polyhedron_demo_plugin(c3t3_io_plugin C3t3_io_plugin KEYWORDS IO Mesh_3)
target_link_libraries(c3t3_io_plugin PUBLIC scene_c3t3_item)

View File

@ -3,24 +3,31 @@ if(EIGEN3_FOUND)
polyhedron_demo_plugin(jet_fitting_plugin Jet_fitting_plugin)
target_link_libraries(jet_fitting_plugin PUBLIC scene_surface_mesh_item scene_polylines_item)
CGAL_target_use_Eigen(jet_fitting_plugin)
else(EIGEN3_FOUND)
message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Jet fitting plugin will not be available.")
endif(EIGEN3_FOUND)
polyhedron_demo_plugin(extrude_plugin Extrude_plugin KEYWORDS PMP)
target_link_libraries(extrude_plugin PUBLIC scene_surface_mesh_item scene_selection_item)
if(EIGEN3_FOUND)
if("${EIGEN3_VERSION}" VERSION_GREATER "3.1.90")
qt5_wrap_ui( hole_fillingUI_FILES Hole_filling_widget.ui)
polyhedron_demo_plugin(hole_filling_plugin Hole_filling_plugin ${hole_fillingUI_FILES} KEYWORDS PMP)
target_link_libraries(hole_filling_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_selection_item)
CGAL_target_use_Eigen(hole_filling_plugin)
qt5_wrap_ui( fairingUI_FILES Fairing_widget.ui)
polyhedron_demo_plugin(fairing_plugin Fairing_plugin ${fairingUI_FILES} KEYWORDS PMP)
target_link_libraries(fairing_plugin PUBLIC scene_selection_item)
CGAL_target_use_Eigen(fairing_plugin)
polyhedron_demo_plugin(hole_filling_polyline_plugin Hole_filling_polyline_plugin )
target_link_libraries(hole_filling_polyline_plugin PUBLIC scene_surface_mesh_item scene_polylines_item)
CGAL_target_use_Eigen(hole_filling_polyline_plugin)
qt5_wrap_ui( Mean_curvature_flow_skeleton_pluginUI_FILES Mean_curvature_flow_skeleton_plugin.ui)
polyhedron_demo_plugin(mean_curvature_flow_skeleton_plugin Mean_curvature_flow_skeleton_plugin ${Mean_curvature_flow_skeleton_pluginUI_FILES})
@ -31,6 +38,19 @@ if(EIGEN3_FOUND)
scene_polylines_item
scene_mcf_item
demo_framework)
CGAL_target_use_Eigen(mean_curvature_flow_skeleton_plugin)
# The smoothing plugin can still do some things, even if Ceres is not found
qt5_wrap_ui( smoothingUI_FILES Smoothing_plugin.ui)
polyhedron_demo_plugin(smoothing_plugin Smoothing_plugin ${smoothingUI_FILES})
target_link_libraries(smoothing_plugin PUBLIC scene_surface_mesh_item scene_selection_item)
CGAL_target_use_Eigen(smoothing_plugin)
find_package(Ceres QUIET)
if(TARGET ceres)
target_compile_definitions( smoothing_plugin PRIVATE CGAL_PMP_USE_CERES_SOLVER )
target_link_libraries(smoothing_plugin PUBLIC ceres)
endif()
CGAL_target_use_Eigen(extrude_plugin)
else()
message(STATUS "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available.")
endif()
@ -111,16 +131,3 @@ qt5_wrap_ui( engravUI_FILES Engrave_dock_widget.ui )
polyhedron_demo_plugin(engrave_text_plugin Engrave_text_plugin ${engravUI_FILES})
target_link_libraries(engrave_text_plugin PUBLIC scene_surface_mesh_item scene_selection_item scene_polylines_item)
polyhedron_demo_plugin(extrude_plugin Extrude_plugin KEYWORDS PMP)
target_link_libraries(extrude_plugin PUBLIC scene_surface_mesh_item scene_selection_item)
# The smoothing plugin can still do some things, even if Ceres is not found
qt5_wrap_ui( smoothingUI_FILES Smoothing_plugin.ui)
polyhedron_demo_plugin(smoothing_plugin Smoothing_plugin ${smoothingUI_FILES})
target_link_libraries(smoothing_plugin PUBLIC scene_surface_mesh_item scene_selection_item)
find_package(Ceres QUIET)
if(TARGET ceres)
target_compile_definitions( smoothing_plugin PRIVATE CGAL_PMP_USE_CERES_SOLVER )
target_link_libraries(smoothing_plugin PUBLIC ceres)
endif()

View File

@ -1,20 +1,9 @@
include( polyhedron_demo_macros )
if(EIGEN3_FOUND)
set(polyfit_linked_libraries)
set(polyfit_compile_definitions)
find_package(SCIP QUIET)
if(SCIP_FOUND)
include_directories(BEFORE ${SCIP_INCLUDE_DIRS})
set(polyfit_linked_libraries ${polyfit_linked_libraries} ${SCIP_LIBRARIES})
set(polyfit_compile_definitions ${polyfit_compile_definitions} "-DCGAL_USE_SCIP")
endif()
find_package(GLPK QUIET)
if(GLPK_FOUND)
include_directories(BEFORE ${GLPK_INCLUDE_DIR})
set(polyfit_linked_libraries ${polyfit_linked_libraries} ${GLPK_LIBRARIES})
set(polyfit_compile_definitions ${polyfit_compile_definitions} "-DCGAL_USE_GLPK")
if(NOT SCIP_FOUND)
find_package(GLPK QUIET)
endif()
if(NOT SCIP_FOUND AND NOT GLPK_FOUND)
@ -23,26 +12,37 @@ if(EIGEN3_FOUND)
qt5_wrap_ui( surface_reconstructionUI_FILES Surface_reconstruction_plugin.ui)
polyhedron_demo_plugin(surface_reconstruction_plugin Surface_reconstruction_plugin Surface_reconstruction_poisson_impl Surface_reconstruction_advancing_front_impl Surface_reconstruction_scale_space_impl Surface_reconstruction_polygonal_impl ${surface_reconstructionUI_FILES} KEYWORDS PointSetProcessing)
target_link_libraries(surface_reconstruction_plugin PUBLIC scene_polygon_soup_item scene_surface_mesh_item scene_points_with_normal_item ${polyfit_linked_libraries})
target_compile_definitions(surface_reconstruction_plugin PRIVATE ${polyfit_compile_definitions})
target_link_libraries(surface_reconstruction_plugin PUBLIC scene_polygon_soup_item scene_surface_mesh_item scene_points_with_normal_item)
CGAL_target_use_Eigen(surface_reconstruction_plugin)
if (SCIP_FOUND)
CGAL_target_use_SCIP(surface_reconstruction_plugin)
elseif(GLPK_FOUND)
CGAL_target_use_GLPK(surface_reconstruction_plugin)
endif()
qt5_wrap_ui( point_set_normal_estimationUI_FILES Point_set_normal_estimation_plugin.ui)
polyhedron_demo_plugin(point_set_normal_estimation_plugin Point_set_normal_estimation_plugin ${point_set_normal_estimationUI_FILES} KEYWORDS PointSetProcessing Classification)
target_link_libraries(point_set_normal_estimation_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler)
CGAL_target_use_Eigen(point_set_normal_estimation_plugin)
qt5_wrap_ui( features_detection_pluginUI_FILES Features_detection_plugin.ui)
polyhedron_demo_plugin(features_detection_plugin Features_detection_plugin ${features_detection_pluginUI_FILES} KEYWORDS PointSetProcessing)
target_link_libraries(features_detection_plugin PUBLIC scene_points_with_normal_item)
CGAL_target_use_Eigen(features_detection_plugin)
polyhedron_demo_plugin(point_set_smoothing_plugin Point_set_smoothing_plugin KEYWORDS PointSetProcessing)
target_link_libraries(point_set_smoothing_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler)
CGAL_target_use_Eigen(point_set_smoothing_plugin)
polyhedron_demo_plugin(point_set_average_spacing_plugin Point_set_average_spacing_plugin KEYWORDS PointSetProcessing Classification)
target_link_libraries(point_set_average_spacing_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler)
CGAL_target_use_Eigen(point_set_average_spacing_plugin)
qt5_wrap_ui(point_set_shape_detectionUI_FILES Point_set_shape_detection_plugin.ui)
polyhedron_demo_plugin(point_set_shape_detection_plugin Point_set_shape_detection_plugin ${point_set_shape_detectionUI_FILES} KEYWORDS PointSetProcessing Classification)
target_link_libraries(point_set_shape_detection_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_polygon_soup_item scene_callback_signaler)
CGAL_target_use_Eigen(point_set_shape_detection_plugin)
else(EIGEN3_FOUND)
message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Surface reconstruction plugin will not be available.")
@ -50,7 +50,6 @@ else(EIGEN3_FOUND)
message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Smoothing plugin will not be available.")
message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Average spacing plugin will not be available.")
message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Feature detection plugin will not be available.")
endif()
qt5_wrap_ui(point_set_bilateral_smoothingUI_FILES Point_set_bilateral_smoothing_plugin.ui)

View File

@ -12,6 +12,7 @@ if(EIGEN3_FOUND)
qt5_wrap_ui(parameterizationUI_FILES Parameterization_widget.ui OTE_dialog.ui)
polyhedron_demo_plugin(parameterization_plugin Parameterization_plugin ${parameterizationUI_FILES})
target_link_libraries(parameterization_plugin PUBLIC scene_surface_mesh_item scene_textured_item scene_selection_item)
CGAL_target_use_Eigen(parameterization_plugin)
else(EIGEN3_FOUND)
message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. The Parameterization plugin will not be available.")
endif(EIGEN3_FOUND)
@ -31,7 +32,9 @@ target_link_libraries(mesh_simplification_plugin PUBLIC scene_surface_mesh_item
qt5_wrap_ui( remeshingUI_FILES Remeshing_dialog.ui)
polyhedron_demo_plugin(offset_meshing_plugin Offset_meshing_plugin ${remeshingUI_FILES})
target_link_libraries(offset_meshing_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item)
if(EIGEN3_FOUND)
CGAL_target_use_Eigen(offset_meshing_plugin)
endif()
if(TBB_FOUND)
CGAL_target_use_TBB(offset_meshing_plugin)
endif()

View File

@ -19,9 +19,7 @@ include_directories( ./ )
find_package(CGAL COMPONENTS Qt5)
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
else()
if (NOT EIGEN3_FOUND)
message(STATUS "NOTICE: This project requires the Eigen library, and will not be compiled.")
return()
endif()
@ -47,6 +45,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND )
add_file_dependencies( PCA_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" )
add_executable ( PCA_demo PCA_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
CGAL_target_use_Eigen(PCA_demo)
target_link_libraries( PCA_demo PRIVATE
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui)

View File

@ -12,14 +12,15 @@ if ( CGAL_FOUND )
# Use Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
if (EIGEN3_FOUND)
get_filename_component(target ${cppfile} NAME_WE)
CGAL_target_use_Eigen(${target})
endif()
endforeach()
else()

View File

@ -12,14 +12,15 @@ if ( CGAL_FOUND )
# Use Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
# create a target per cppfile
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
foreach(cppfile ${cppfiles})
create_single_source_cgal_program( "${cppfile}" )
if (EIGEN3_FOUND)
get_filename_component(target ${cppfile} NAME_WE)
CGAL_target_use_Eigen(${target})
endif()
endforeach()
else()

View File

@ -11,7 +11,6 @@ if ( CGAL_FOUND )
# use either Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
# Link with Boost.ProgramOptions (optional)
find_package(Boost QUIET COMPONENTS program_options)
@ -29,9 +28,12 @@ if ( CGAL_FOUND )
endif()
create_single_source_cgal_program( Compute_Ridges_Umbilics.cpp)
CGAL_target_use_Eigen(Compute_Ridges_Umbilics)
create_single_source_cgal_program( Ridges_Umbilics_SM.cpp)
CGAL_target_use_Eigen(Ridges_Umbilics_SM)
create_single_source_cgal_program( Ridges_Umbilics_LCC.cpp)
CGAL_target_use_Eigen(Ridges_Umbilics_LCC)
else()
message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.")

View File

@ -14,9 +14,8 @@ if ( CGAL_FOUND )
# use either Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "ridge_test.cpp" )
CGAL_target_use_Eigen(ridge_test)
else()
message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.")

View File

@ -20,11 +20,14 @@ if ( CGAL_FOUND )
find_package( Eigen3 3.1.0 )
if( EIGEN3_FOUND )
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "scale_space.cpp" )
CGAL_target_use_Eigen(scale_space)
create_single_source_cgal_program( "scale_space_incremental.cpp" )
CGAL_target_use_Eigen(scale_space_incremental)
create_single_source_cgal_program( "scale_space_manifold.cpp" )
CGAL_target_use_Eigen(scale_space_manifold)
create_single_source_cgal_program( "scale_space_advancing_front.cpp" )
CGAL_target_use_Eigen(scale_space_advancing_front)
if(ACTIVATE_CONCURRENCY AND TBB_FOUND)
CGAL_target_use_TBB(scale_space)
CGAL_target_use_TBB(scale_space_incremental)

View File

@ -15,12 +15,12 @@ if(CGAL_FOUND)
# Use Eigen.
find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater)
if(EIGEN3_FOUND)
include(${EIGEN3_USE_FILE})
create_single_source_cgal_program(
"benchmark_region_growing_on_point_set_2.cpp")
CGAL_target_use_Eigen(benchmark_region_growing_on_point_set_2)
create_single_source_cgal_program(
"benchmark_region_growing_on_point_set_3.cpp")
CGAL_target_use_Eigen(benchmark_region_growing_on_point_set_3)
endif()
else()

View File

@ -15,8 +15,6 @@ if(CGAL_FOUND)
# Use Eigen.
find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater)
if(EIGEN3_FOUND)
include(${EIGEN3_USE_FILE})
create_single_source_cgal_program(
"efficient_RANSAC_basic.cpp")
create_single_source_cgal_program(
@ -35,6 +33,19 @@ if(CGAL_FOUND)
create_single_source_cgal_program(
"shape_detection_basic_deprecated.cpp")
foreach(target
efficient_RANSAC_basic
efficient_RANSAC_with_callback
efficient_RANSAC_and_plane_regularization
region_growing_on_point_set_2
region_growing_on_point_set_3
region_growing_on_polygon_mesh
region_growing_with_custom_classes
shape_detection_basic_deprecated)
CGAL_target_use_Eigen(${target})
endforeach()
endif()
create_single_source_cgal_program(

View File

@ -15,8 +15,6 @@ if(CGAL_FOUND)
# Use Eigen.
find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater)
if(EIGEN3_FOUND)
include(${EIGEN3_USE_FILE})
create_single_source_cgal_program(
"test_region_growing_basic.cpp")
create_single_source_cgal_program(
@ -35,6 +33,19 @@ if(CGAL_FOUND)
"test_region_growing_on_polygon_mesh_with_sorting.cpp")
create_single_source_cgal_program(
"test_region_growing_on_degenerated_mesh.cpp")
foreach(target
test_region_growing_basic
test_region_growing_on_cube
test_region_growing_on_point_set_2
test_region_growing_on_point_set_3
test_region_growing_on_polygon_mesh
test_region_growing_on_point_set_2_with_sorting
test_region_growing_on_point_set_3_with_sorting
test_region_growing_on_polygon_mesh_with_sorting
test_region_growing_on_degenerated_mesh)
CGAL_target_use_Eigen(${target})
endforeach()
endif()
create_single_source_cgal_program(

View File

@ -14,24 +14,21 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "singular_value_decomposition.cpp" )
CGAL_target_use_Eigen(singular_value_decomposition)
create_single_source_cgal_program( "sparse_solvers.cpp" )
CGAL_target_use_Eigen(sparse_solvers)
create_single_source_cgal_program( "diagonalize_matrix.cpp" )
CGAL_target_use_Eigen(diagonalize_matrix)
endif()
create_single_source_cgal_program( "diagonalize_matrix.cpp" )
create_single_source_cgal_program( "mixed_integer_program.cpp" )
find_package( SCIP QUIET)
if (SCIP_FOUND)
include_directories( BEFORE ${SCIP_INCLUDE_DIRS} )
target_link_libraries( mixed_integer_program PRIVATE ${SCIP_LIBRARIES} )
target_compile_definitions(mixed_integer_program PRIVATE -DCGAL_USE_SCIP)
CGAL_target_use_SCIP(mixed_integer_program)
message("SCIP found and used")
else()
@ -39,13 +36,8 @@ if ( CGAL_FOUND )
find_package( GLPK QUIET)
if (GLPK_FOUND)
include_directories( BEFORE ${GLPK_INCLUDE_DIR} )
target_link_libraries( mixed_integer_program PRIVATE ${GLPK_LIBRARIES} )
target_compile_definitions(mixed_integer_program PRIVATE -DCGAL_USE_GLPK)
CGAL_target_use_GLPK(mixed_integer_program)
message("GLPK found and used")
else()

View File

@ -13,9 +13,6 @@ if ( CGAL_FOUND )
include(${CGAL_USE_FILE})
find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
include_directories (BEFORE "include")
@ -33,6 +30,23 @@ endif()
create_single_source_cgal_program( "nn3nanoflan.cpp" )
create_single_source_cgal_program( "sizeof.cpp" )
create_single_source_cgal_program( "deque.cpp" )
foreach(target
Compare_ANN_STANN_CGAL
nanoflan
binary
nearest_neighbor_searching_50
nearest_neighbor_searching_inplace_50
Nearest_neighbor_searching
Nearest_neighbor_searching_2D
Nearest_neighbor_searching_2D_user_defined
Split_data
nn3cgal
nn4cgal
nn3nanoflan
sizeof
deque)
CGAL_target_use_Eigen(${target})
endforeach()
else()

View File

@ -18,9 +18,6 @@ if ( NOT CGAL_FOUND )
endif()
find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
if (MSVC)
# Turn off VC++ warning
@ -68,8 +65,10 @@ create_single_source_cgal_program( "weighted_Minkowski_distance.cpp" )
if (EIGEN3_FOUND)
create_single_source_cgal_program( "fuzzy_range_query.cpp" )
CGAL_target_use_Eigen(fuzzy_range_query)
create_single_source_cgal_program( "general_neighbor_searching.cpp" )
CGAL_target_use_Eigen(general_neighbor_searching)
else()

View File

@ -31,8 +31,6 @@ find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
return()
else()
include( ${EIGEN3_USE_FILE} )
endif()
# Creating entries for all C++ files with "main" routine
@ -41,14 +39,20 @@ endif()
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program( "vsa_approximation_2_example.cpp" )
CGAL_target_use_Eigen(vsa_approximation_2_example)
create_single_source_cgal_program( "vsa_approximation_example.cpp" )
CGAL_target_use_Eigen(vsa_approximation_example)
create_single_source_cgal_program( "vsa_class_interface_example.cpp" )
CGAL_target_use_Eigen(vsa_class_interface_example)
create_single_source_cgal_program( "vsa_isotropic_metric_example.cpp" )
CGAL_target_use_Eigen(vsa_isotropic_metric_example)
create_single_source_cgal_program( "vsa_segmentation_example.cpp" )
CGAL_target_use_Eigen(vsa_segmentation_example)
create_single_source_cgal_program( "vsa_simple_approximation_example.cpp" )
CGAL_target_use_Eigen(vsa_simple_approximation_example)

View File

@ -32,8 +32,6 @@ find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater)
if (NOT EIGEN3_FOUND)
message(STATUS "This project requires the Eigen library, and will not be compiled.")
return()
else()
include( ${EIGEN3_USE_FILE} )
endif()
@ -43,21 +41,30 @@ endif()
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program( "vsa_class_interface_test.cpp" )
CGAL_target_use_Eigen(vsa_class_interface_test)
create_single_source_cgal_program( "vsa_correctness_test.cpp" )
CGAL_target_use_Eigen(vsa_correctness_test)
create_single_source_cgal_program( "vsa_error_decrease_test.cpp" )
CGAL_target_use_Eigen(vsa_error_decrease_test)
create_single_source_cgal_program( "vsa_kernel_test.cpp" )
CGAL_target_use_Eigen(vsa_kernel_test)
create_single_source_cgal_program( "vsa_approximation_test.cpp" )
CGAL_target_use_Eigen(vsa_approximation_test)
create_single_source_cgal_program( "vsa_segmentation_test.cpp" )
CGAL_target_use_Eigen(vsa_segmentation_test)
create_single_source_cgal_program( "vsa_meshing_manifold_test.cpp" )
CGAL_target_use_Eigen(vsa_meshing_manifold_test)
create_single_source_cgal_program( "vsa_metric_test.cpp" )
CGAL_target_use_Eigen(vsa_metric_test)
create_single_source_cgal_program( "vsa_teleportation_test.cpp" )
CGAL_target_use_Eigen(vsa_teleportation_test)

View File

@ -11,10 +11,8 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "benchmark_for_concept_models.cpp" )
CGAL_target_use_Eigen(benchmark_for_concept_models)
else()
message(STATUS "This program requires the Eigen library, version 3.1 or later and will not be compiled.")
endif()

View File

@ -18,10 +18,8 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "deform_mesh_for_botsch08_format.cpp" )
CGAL_target_use_Eigen(deform_mesh_for_botsch08_format)
else()
message(STATUS "NOTICE: This program requires the Eigen library, version 3.2 or later and will not be compiled.")
endif()

View File

@ -13,8 +13,6 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "all_roi_assign_example.cpp" )
create_single_source_cgal_program( "all_roi_assign_example_custom_polyhedron.cpp" )
create_single_source_cgal_program( "all_roi_assign_example_Surface_mesh.cpp" )
@ -24,11 +22,24 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "k_ring_roi_translate_rotate_Surface_mesh.cpp" )
create_single_source_cgal_program( "deform_mesh_for_botsch08_format_sre_arap.cpp" )
foreach(target
all_roi_assign_example
all_roi_assign_example_custom_polyhedron
all_roi_assign_example_Surface_mesh
custom_weight_for_edges_example
deform_polyhedron_with_custom_pmap_example
k_ring_roi_translate_rotate_example
k_ring_roi_translate_rotate_Surface_mesh
deform_mesh_for_botsch08_format_sre_arap)
CGAL_target_use_Eigen(${target})
endforeach()
find_package( OpenMesh QUIET )
if ( OpenMesh_FOUND )
include( UseOpenMesh )
create_single_source_cgal_program( "all_roi_assign_example_with_OpenMesh.cpp" )
target_link_libraries( all_roi_assign_example_with_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} )
CGAL_target_use_Eigen(all_roi_assign_example_with_OpenMesh)
else()
message(STATUS "Example that use OpenMesh will not be compiled.")
endif()

View File

@ -13,15 +13,18 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "Cactus_deformation_session.cpp" )
CGAL_target_use_Eigen(Cactus_deformation_session)
create_single_source_cgal_program( "Cactus_performance_test.cpp" )
CGAL_target_use_Eigen(Cactus_performance_test)
create_single_source_cgal_program( "Symmetry_test.cpp" )
CGAL_target_use_Eigen(Symmetry_test)
find_package( OpenMesh QUIET )
if ( OpenMesh_FOUND )
include( UseOpenMesh )
create_single_source_cgal_program( "Cactus_deformation_session_OpenMesh.cpp" )
CGAL_target_use_Eigen(Cactus_deformation_session_OpenMesh)
target_link_libraries( Cactus_deformation_session_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} )
else()
message(STATUS "Example that use OpenMesh will not be compiled.")

View File

@ -14,7 +14,6 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if (EIGEN3_FOUND)
# Executables that require Eigen 3.1
include( ${EIGEN3_USE_FILE} )
# ------------------------------------------------------------------
# Detect SuiteSparse libraries:
@ -52,11 +51,17 @@ if ( CGAL_FOUND )
# ------------------------------------------------------------------
create_single_source_cgal_program( "discrete_authalic.cpp" )
CGAL_target_use_Eigen(discrete_authalic)
create_single_source_cgal_program( "lscm.cpp" )
CGAL_target_use_Eigen(lscm)
create_single_source_cgal_program( "orbifold.cpp" )
CGAL_target_use_Eigen(orbifold)
create_single_source_cgal_program( "seam_Polyhedron_3.cpp" )
CGAL_target_use_Eigen(seam_Polyhedron_3)
create_single_source_cgal_program( "simple_parameterization.cpp" )
CGAL_target_use_Eigen(simple_parameterization)
create_single_source_cgal_program( "square_border_parameterizer.cpp" )
CGAL_target_use_Eigen(square_border_parameterizer)
if(SuiteSparse_FOUND)
target_link_libraries(orbifold PRIVATE ${SuiteSparse_LIBRARIES})

View File

@ -14,8 +14,8 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
if(EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "extensive_parameterization_test.cpp" )
CGAL_target_use_Eigen(extensive_parameterization_test)
else(EIGEN3_FOUND)
message(STATUS "NOTICE: The tests require Eigen 3.1 (or greater) and will not be compiled.")
endif(EIGEN3_FOUND)

View File

@ -44,8 +44,8 @@ create_single_source_cgal_program( "edge_collapse_visitor_surface_mesh.cpp" )
find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater)
if( Eigen3_FOUND )
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "edge_collapse_garland_heckbert.cpp" )
CGAL_target_use_Eigen(edge_collapse_garland_heckbert)
else ()
message(STATUS "Garland-Heckbert polices require the Eigen library, which has not been found; related examples will not be compiled.")
endif()

View File

@ -38,8 +38,6 @@ find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater)
if(NOT EIGEN3_FOUND)
message(STATUS "NOTICE: Eigen 3.2 (or greater) is not found.")
else()
include( ${EIGEN3_USE_FILE} )
endif(NOT EIGEN3_FOUND)
@ -47,5 +45,7 @@ endif(NOT EIGEN3_FOUND)
# ##########################################################
create_single_source_cgal_program( "solver_benchmark.cpp" )
CGAL_target_use_Eigen(solver_benchmark)
create_single_source_cgal_program( "mcf_scale_invariance.cpp" )
CGAL_target_use_Eigen(mcf_scale_invariance)

View File

@ -14,8 +14,6 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater)
if(EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "simple_mcfskel_example.cpp" )
create_single_source_cgal_program( "simple_mcfskel_sm_example.cpp" )
create_single_source_cgal_program( "simple_mcfskel_LCC_example.cpp" )
@ -23,6 +21,16 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "MCF_Skeleton_sm_example.cpp" )
create_single_source_cgal_program( "MCF_Skeleton_LCC_example.cpp" )
create_single_source_cgal_program( "segmentation_example.cpp" )
foreach(target
simple_mcfskel_example
simple_mcfskel_sm_example
simple_mcfskel_LCC_example
MCF_Skeleton_example
MCF_Skeleton_sm_example
MCF_Skeleton_LCC_example
segmentation_example)
CGAL_target_use_Eigen(${target})
endforeach()
else()
message(STATUS "These programs require the Eigen library (3.2 or greater), and will not be compiled.")
endif()

View File

@ -14,10 +14,10 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater)
if(EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "MCF_Skeleton_test.cpp" )
CGAL_target_use_Eigen(MCF_Skeleton_test)
create_single_source_cgal_program( "skeleton_connectivity_test.cpp" )
CGAL_target_use_Eigen(skeleton_connectivity_test)
else()
message(STATUS "These tests require the Eigen library (3.2 or greater), and will not be compiled.")
endif()

View File

@ -26,9 +26,6 @@ if ( NOT Boost_FOUND )
endif()
find_package(Eigen3 3.1.0)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
endif()
# include for local directory
include_directories( BEFORE include )
@ -39,6 +36,8 @@ include_directories( BEFORE include )
# ##########################################################
create_single_source_cgal_program( "points_to_RT_to_off.cpp" )
CGAL_target_use_Eigen(points_to_RT_to_off)
create_single_source_cgal_program( "points_to_DT_to_off.cpp" )
CGAL_target_use_Eigen(points_to_DT_to_off)

View File

@ -15,10 +15,11 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.0)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
include_directories (BEFORE "include")
create_single_source_cgal_program( "delaunay.cpp" )
CGAL_target_use_Eigen(delaunay)
create_single_source_cgal_program( "Td_vs_T2_and_T3.cpp" )
CGAL_target_use_Eigen(Td_vs_T2_and_T3)
else()
message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.")

View File

@ -18,8 +18,6 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.0)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
create_single_source_cgal_program( "barycentric_subdivision.cpp" )
create_single_source_cgal_program( "delaunay_triangulation.cpp" )
create_single_source_cgal_program( "convex_hull.cpp" )
@ -28,6 +26,16 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "triangulation_data_structure_dynamic.cpp" )
create_single_source_cgal_program( "triangulation_data_structure_static.cpp" )
foreach(target
barycentric_subdivision
delaunay_triangulation
convex_hull
regular_triangulation
triangulation
triangulation_data_structure_dynamic
triangulation_data_structure_static)
CGAL_target_use_Eigen(${target})
endforeach()
else()
message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.")
endif()

View File

@ -16,7 +16,6 @@ if ( CGAL_FOUND )
find_package(Eigen3 3.1.0)
if (EIGEN3_FOUND)
include( ${EIGEN3_USE_FILE} )
include_directories (BEFORE "include")
create_single_source_cgal_program( "test_triangulation.cpp" )
@ -25,6 +24,15 @@ if ( CGAL_FOUND )
create_single_source_cgal_program( "test_tds.cpp" )
create_single_source_cgal_program( "test_torture.cpp" )
create_single_source_cgal_program( "test_insert_if_in_star.cpp" )
foreach(target
test_triangulation
test_delaunay
test_regular
test_tds
test_torture
test_insert_if_in_star)
CGAL_target_use_Eigen(${target})
endforeach()
else()
message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.")