-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
85 lines (63 loc) · 2.19 KB
/
CMakeLists.txt
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
# prepair
#
# Copyright © 2009-2022,
# Ken Arroyo Ohori [email protected]
# Hugo Ledoux [email protected]
# Martijn Meijers [email protected]
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
project( prepair )
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)
endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
if ( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
endif()
set( CMAKE_BUILD_TYPE "Release")
# CGAL
find_package( CGAL REQUIRED )
if ( NOT CGAL_FOUND )
message(SEND_ERROR "prepair requires the CGAL library")
return()
endif()
# include helper file
include( ${CGAL_USE_FILE} )
# Boost
find_package( Boost 1.50.0 REQUIRED COMPONENTS program_options filesystem)
if ( NOT Boost_FOUND )
message(SEND_ERROR "prepair requires the Boost library version 1.50 or higher")
return()
endif()
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
# GDAL
find_package( GDAL 3.0 )
if ( NOT GDAL_FOUND )
message(SEND_ERROR "prepair requires the GDAL library")
endif()
include_directories( ${GDAL_INCLUDE_DIR} )
# Creating entries for target: prepair
# ############################
add_executable( prepair prepair.cpp )
set_property(TARGET prepair PROPERTY CXX_STANDARD 17)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS prepair )
# Link to CGAL and third-party libraries
target_link_libraries(prepair ${GDAL_LIBRARY} ${Boost_LIBRARIES})
install(TARGETS prepair DESTINATION bin)