File: CMakeLists.txt

package info (click to toggle)
cgal 6.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 141,840 kB
  • sloc: cpp: 797,081; ansic: 203,398; sh: 490; python: 411; makefile: 286; javascript: 174
file content (166 lines) | stat: -rw-r--r-- 5,984 bytes parent folder | download
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# This is the CMake script for compiling this folder.

cmake_minimum_required(VERSION 3.12...3.29)
project(Point_set_processing_3_Examples)

# Find CGAL
find_package(CGAL REQUIRED)

# VisualC++ optimization for applications dealing with large data
if(MSVC)
  # Quit warning in the lasreader
  add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)

  if(CMAKE_SIZEOF_VOID_P EQUAL 4)
    # Allow Windows 32bit applications to use up to 3GB of RAM
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
  endif()
  # Prints new compilation options
  message(STATUS "USING DEBUG CXXFLAGS   = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'")
  message(STATUS "USING DEBUG EXEFLAGS   = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'")
  message(STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'")
  message(STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'")
endif()

# Activate concurrency?
option(CGAL_ACTIVATE_CONCURRENT_PSP3 "Enable concurrency" OFF)

if(CGAL_ACTIVATE_CONCURRENT_PSP3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_PSP3}")
  find_package(TBB REQUIRED)
  include(CGAL_TBB_support)
endif()

# Executables that do *not* require EIGEN
foreach(
  target
  average_spacing_example
  bilateral_smooth_point_set_example
  grid_simplification_example
  grid_simplify_indices
  property_map
  random_simplification_example
  read_write_xyz_point_set_example
  remove_outliers_example
  wlop_simplify_and_regularize_point_set_example
  edge_aware_upsample_point_set_example
  structuring_example
  read_ply_points_with_colors_example
  write_ply_points_example)
  create_single_source_cgal_program("${target}.cpp")
  target_link_libraries(${target} PRIVATE ${CGAL_libs})
endforeach()

#disable if MSVC 2017
if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910)
  find_package(LASLIB QUIET)
  include(CGAL_LASLIB_support)
  if (TARGET CGAL::LASLIB_support)
    create_single_source_cgal_program("read_las_example.cpp")
    create_single_source_cgal_program("write_las_example.cpp")
    target_link_libraries(read_las_example PRIVATE CGAL::LASLIB_support)
    target_link_libraries(write_las_example PRIVATE CGAL::LASLIB_support)
  else()
    message(STATUS "NOTICE : the LAS reader test requires LASlib and will not be compiled.")
  endif()
else()
  message(STATUS "NOTICE: the LAS reader does not work with your version of Visual Studio 2017.")
endif()

# Use Eigen
find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater)
include(CGAL_Eigen3_support)
if(TARGET CGAL::Eigen3_support)

  # Executables that require Eigen
  foreach(
    target
    callback_example
    clustering_example
    edges_example
    hierarchy_simplification_example
    jet_smoothing_example
    normal_estimation
    normals_example
    scale_estimation_example
    scale_estimation_2d_example)
    create_single_source_cgal_program("${target}.cpp")
    target_link_libraries(${target} PRIVATE CGAL::Eigen3_support)
  endforeach()

  if (TARGET CGAL::TBB_support)
    foreach(
      target
      callback_example
      clustering_example
      jet_smoothing_example
      normal_estimation
      normals_example
      scale_estimation_example)
      target_link_libraries(${target} PRIVATE CGAL::TBB_support)
    endforeach()
  endif()

  if (TARGET CGAL::Eigen3_support AND TARGET CGAL::LASLIB_support)
    create_single_source_cgal_program( "orient_scanlines_example.cpp" )
    target_link_libraries(orient_scanlines_example PRIVATE
      CGAL::Eigen3_support CGAL::LASLIB_support)
    if (TARGET CGAL::TBB_support)
      target_link_libraries(orient_scanlines_example PRIVATE CGAL::TBB_support)
    endif()
  endif()

  # Executables that require libpointmatcher
  find_package(libpointmatcher QUIET)
  include(CGAL_pointmatcher_support)
  if(TARGET CGAL::pointmatcher_support)
    create_single_source_cgal_program("registration_with_pointmatcher.cpp")
    target_link_libraries(registration_with_pointmatcher PRIVATE CGAL::Eigen3_support
                          CGAL::pointmatcher_support)
  else()
    message(STATUS "NOTICE: registration with pointmatcher requires libpointmatcher and will not be compiled.")
  endif()

  # Executables that require OpenGR
  if (NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1910)
    find_package(OpenGR QUIET)
    include(CGAL_OpenGR_support)
      message(
        STATUS
          "NOTICE : OpenGR does not support your compiler, registration_with_OpenGR will not be compiled."
      )
  endif()

  if(TARGET CGAL::OpenGR_support)
    create_single_source_cgal_program("registration_with_OpenGR.cpp")
    target_link_libraries(registration_with_OpenGR PRIVATE CGAL::Eigen3_support
                          CGAL::OpenGR_support)
  else()
    message(STATUS "NOTICE: registration_with_OpenGR requires OpenGR, and will not be compiled.")
  endif()

  # Executables that require both libpointmatcher and OpenGR
  if (TARGET CGAL::pointmatcher_support AND
      TARGET CGAL::OpenGR_support)
    create_single_source_cgal_program("registration_with_opengr_pointmatcher_pipeline.cpp")
    target_link_libraries(
      registration_with_opengr_pointmatcher_pipeline PRIVATE CGAL::Eigen3_support
      CGAL::pointmatcher_support CGAL::OpenGR_support)
  else()
    message(STATUS "NOTICE: registration with OpenGR and pointmatcher requires both libpointmatcher and OpenGR, and will not be compiled.")
  endif()

else()
  message(STATUS "NOTICE: Some of the executables in this directory require Eigen 3.1 (or greater), and will not be compiled.")
endif()

if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support)
  foreach(
    target
    average_spacing_example
    bilateral_smooth_point_set_example
    edge_aware_upsample_point_set_example
    remove_outliers_example
    wlop_simplify_and_regularize_point_set_example)
    target_link_libraries(${target} PRIVATE CGAL::TBB_support)
  endforeach()
endif()