Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 30 additions & 32 deletions Installation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ if(CGAL_BRANCH_BUILD)
find_package(GMP REQUIRED)
find_package(Doxygen REQUIRED)
find_package(Eigen3 REQUIRED)
include(CGAL_Eigen3_support)
get_target_property(CGAL_EIGEN_3_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
find_package(Qt6 COMPONENTS Core Widgets OpenGL Gui REQUIRED)
set(CMAKE_POLICY_DEFAULT_CMP0167 NEW)
Expand All @@ -843,23 +844,18 @@ if(CGAL_BRANCH_BUILD)
find_package(OpenMesh)
find_package(OpenCV QUIET)

set(compile_options
"\
${CMAKE_CXX_FLAGS} -DCGAL_EIGEN3_ENABLED -DCGAL_PROFILE \
${Qt6Widgets_DEFINITIONS} ${Qt6OpenGL_DEFINITIONS} ${Qt6Gui_DEFINITIONS} \
${Qt6OpenGL_EXECUTABLE_COMPILE_FLAGS} -fPIC \
${Qt6Gui_EXECUTABLE_COMPILE_FLAGS} \
${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt6_3RD_PARTY_DEFINITIONS} \
${CGAL_DEFINITIONS}" -std=c++17)
message("COMPILATION OPTIONS ARE : ${compile_options}")
set(compile_options ${CMAKE_CXX_FLAGS} -DCGAL_EIGEN3_ENABLED -DCGAL_PROFILE ${Qt6Widgets_DEFINITIONS}
${Qt6OpenGL_DEFINITIONS} ${Qt6Gui_DEFINITIONS} ${Qt6OpenGL_EXECUTABLE_COMPILE_FLAGS} -fPIC
${Qt6Gui_EXECUTABLE_COMPILE_FLAGS} ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt6_3RD_PARTY_DEFINITIONS}
${CGAL_DEFINITIONS} -std=c++17)
message("COMPILATION OPTIONS ARE: ${compile_options}")

if(NOT OpenMesh_FOUND)
set(compile_options
"${compile_options} \
-DCGAL_BOOST_GRAPH_GRAPH_TRAITS_POLYMESH_ARRAYKERNELT_H \
-DCGAL_BOOST_GRAPH_GRAPH_TRAITS_TRIMESH_ARRAYKERNELT_H \
-DCGAL_PROPERTIES_POLYMESH_ARRAYKERNELT_H \
-DCGAL_PROPERTIES_TRIMESH_ARRAYKERNELT_H")
list(APPEND compile_options
-DCGAL_BOOST_GRAPH_GRAPH_TRAITS_POLYMESH_ARRAYKERNELT_H
-DCGAL_BOOST_GRAPH_GRAPH_TRAITS_TRIMESH_ARRAYKERNELT_H
-DCGAL_PROPERTIES_POLYMESH_ARRAYKERNELT_H
-DCGAL_PROPERTIES_TRIMESH_ARRAYKERNELT_H)
message(
STATUS
"Skip headers \
Expand All @@ -870,17 +866,17 @@ ${CGAL_DEFINITIONS}" -std=c++17)
because OpenMesh_FOUND is false.")
endif()
if(NOT OpenCV_FOUND)
set(compile_options "${compile_options} \
-DCGAL_CLASSIFICATION_OPENCV_RANDOM_FOREST_CLASSIFIER_H")
list(APPEND compile_options
-DCGAL_CLASSIFICATION_OPENCV_RANDOM_FOREST_CLASSIFIER_H)
message(STATUS "Skip header \
\"CGAL/Classification/OpenCV_random_forest_classifier.h\" \
because OpenCV_FOUND is false")
endif()
if(LEDA_FOUND)
set(compile_options "${compile_options} -DCGAL_USE_LEDA")
list(APPEND compile_options -DCGAL_USE_LEDA)
endif()
if(NOT IPE_FOUND)
set(compile_options "${compile_options} -DCGAL_IPELET_BASE_H=1")
list(APPEND compile_options -DCGAL_IPELET_BASE_H=1)
message(STATUS "Skip header \"CGAL/CGAL_ipelet_base.h\" \
because IPE_FOUND is false.")
endif()
Expand Down Expand Up @@ -929,7 +925,6 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.")
${GMP_INCLUDE_DIR}
${Qt6OpenGL_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
${Qt6Gui_DEFINITIONS}
${CGAL_3RD_PARTY_INCLUDE_DIRS}
${CGAL_Qt6_3RD_PARTY_INCLUDE_DIRS})
list(APPEND include_options "-I${incdir}")
Expand Down Expand Up @@ -1062,6 +1057,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
endif() # end the if on list_of_documented_headers
endforeach() # look on headers
add_custom_target(check_pkg_${package}_headers
COMMENT "Check headers for package ${package}"
DEPENDS ${check_pkg_headers_depends})
add_custom_command(
OUTPUT ${CGAL_BINARY_DIR}/package_info/${package}/included_headers
Expand All @@ -1078,6 +1074,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
${check_pkg_headers_depends})
add_custom_target(
pkg_${package}_deps
COMMENT "Compute dependencies for package ${package}"
DEPENDS ${CGAL_BINARY_DIR}/package_info/${package}/dependencies)
list(APPEND check_pkg_target_list check_pkg_${package}_headers)
list(APPEND packages_deps
Expand All @@ -1095,26 +1092,27 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
file(COPY_FILE ${CGAL_BINARY_DIR}/test_headers.cpp ${CGAL_BINARY_DIR}/test_headers2.cpp)
file(APPEND ${CGAL_BINARY_DIR}/test_headers.cpp "int main(){}\n")

add_custom_target(check_headers DEPENDS ${check_pkg_target_list})

string(REPLACE " " ";" compile_options ${compile_options})
string(REPLACE " " ";" include_options ${include_options_str})
add_custom_command(
TARGET check_headers
POST_BUILD
COMMAND ${CMAKE_CXX_COMPILER} ${compile_options} ${include_options} -x
c++ -fsyntax-only ${CGAL_BINARY_DIR}/test_headers.cpp)

# New check that headers can be included in different compilation units, that can be linked
# together. That checks for missing `inline` keywords.
add_executable(check_headers_linked_twice
${CGAL_BINARY_DIR}/test_headers.cpp
${CGAL_BINARY_DIR}/test_headers2.cpp)
target_link_libraries(check_headers_linked_twice PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Widgets)
target_link_libraries(check_headers_linked_twice PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Widgets CGAL::Eigen3_support)
target_compile_options(check_headers_linked_twice PRIVATE ${compile_options} ${include_options})
if(VTK_FOUND)
target_link_libraries(check_headers_linked_twice PRIVATE VTK::IOImage)
endif()
target_compile_options(check_headers_linked_twice PRIVATE ${compile_options} ${include_options})

add_custom_target(check_headers DEPENDS ${check_pkg_target_list} check_headers_linked_twice)

string(REPLACE " " ";" include_options ${include_options_str})
add_custom_command(
TARGET check_headers
COMMENT "Check that all headers can be included in the same translation unit"
POST_BUILD
COMMAND ${CMAKE_CXX_COMPILER} ${compile_options} ${include_options} -x
c++ -fsyntax-only "${CGAL_BINARY_DIR}/test_headers.cpp")


add_custom_target(packages_dependencies DEPENDS ${packages_deps})
message(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
#include <CGAL/Dynamic_property_map.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Surface_mesh/Surface_mesh.h>
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/boost/graph/named_params_helper.h>
#include <CGAL/Named_function_parameters.h>

#include <CGAL/Surface_mesh.h>

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <CGAL/boost/graph/properties.h>
#include <CGAL/property_map.h>
#include <CGAL/use.h>

#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/property_map/property_map.hpp>

#include <cassert>
#include <map>
#include <sstream>
#include <iostream>
#include <unordered_map>


namespace CGAL {
Expand Down Expand Up @@ -65,11 +77,15 @@ void my_function_with_named_parameters(PolygonMesh& mesh, const NamedParameters&

VCM vcm_np = choose_parameter<Default_VCM>(get_parameter(np, internal_np::vertex_is_constrained));

auto vcmap = choose_parameter(get_parameter(np, internal_np::vertex_color_map),
CGAL::dynamic_vertex_property_t<bool>{}, mesh, false);

//demonstrates usage for those values.
for(auto v : vertices(mesh))
{
std::cout<<"vertex #"<<get(vim, v)<<" : "<<get(vpm, v)<<" : "<<get(vcm_np, v)<<std::endl;
put(vcmap, v, true);
assert(get(vcmap, v));
}

if (!do_project_is_default)
Expand Down Expand Up @@ -114,7 +130,17 @@ int main()
typedef boost::associative_property_map<VCmap> Vertex_constrained_pmap;
Vertex_constrained_pmap vcm_pmap(vcm);
CGAL::my_function_with_named_parameters(sm);

VCmap colors;
for(auto v : vertices(sm))
colors[v] = false;
Vertex_constrained_pmap color_pmap(colors);

CGAL::my_function_with_named_parameters(sm, CGAL::parameters::vertex_is_constrained_map(vcm_pmap)
.vertex_color_map(color_pmap)
.do_project(true));
for(auto v : vertices(sm))
assert(colors[v]);

return 0;
}
Loading
Loading