File: CMakeLists.txt

package info (click to toggle)
cgal 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 144,952 kB
  • sloc: cpp: 811,597; ansic: 208,576; sh: 493; python: 411; makefile: 286; javascript: 174
file content (79 lines) | stat: -rw-r--r-- 2,837 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.

cmake_minimum_required(VERSION 3.12...3.31)
project(Classification_Examples)

# CGAL and its components
find_package(CGAL REQUIRED)

set(Classification_dependencies_met TRUE)

find_package(Boost OPTIONAL_COMPONENTS serialization iostreams)
include(CGAL_Boost_serialization_support)
include(CGAL_Boost_iostreams_support)

if(NOT TARGET CGAL::Boost_serialization_support)
  message("NOTICE: This project requires Boost Serialization, and will not be compiled.")
  set(Classification_dependencies_met FALSE)
endif()

if(NOT TARGET CGAL::Boost_iostreams_support)
  message("NOTICE: This project requires Boost IO Streams, and will not be compiled.")
  set(Classification_dependencies_met FALSE)
endif()

find_package(Eigen3 QUIET)
include(CGAL_Eigen3_support)

if(NOT TARGET CGAL::Eigen3_support)
  message("NOTICE: This project requires the Eigen library, and will not be compiled.")
  set(Classification_dependencies_met FALSE)
endif()

if(NOT Classification_dependencies_met)
  return()
endif()

find_package(TBB QUIET)
include(CGAL_TBB_support)

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" )
create_single_source_cgal_program( "gis_tutorial_example.cpp" )
create_single_source_cgal_program( "example_deprecated_conversion.cpp" )

find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning
include(CGAL_OpenCV_support)
if(TARGET CGAL::OpenCV_support)
  message(STATUS "Found OpenCV")

  create_single_source_cgal_program( "example_opencv_random_forest.cpp" )
  target_link_libraries(example_opencv_random_forest PRIVATE CGAL::OpenCV_support)
else()
  message("NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.")
endif()

foreach(target
    example_classification
    example_ethz_random_forest
    example_feature
    example_generation_and_training
    example_mesh_classification
    example_cluster_classification
    example_opencv_random_forest
    gis_tutorial_example
    example_deprecated_conversion)
  if(TARGET ${target})
    target_link_libraries(${target} PRIVATE CGAL::Eigen3_support
                                            CGAL::Boost_iostreams_support
                                            CGAL::Boost_serialization_support)
    if(TARGET CGAL::TBB_support)
      target_link_libraries(${target} PRIVATE CGAL::TBB_support)
    endif()
  endif()
endforeach()