forked from tudelft3d/prepair
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (62 loc) · 2.11 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
# Copyright (c) 2009-2014,
# Ken Arroyo Ohori g.a.k.arroyoohori@tudelft.nl
# Hugo Ledoux h.ledoux@tudelft.nl
# Martijn Meijers b.m.meijers@tudelft.nl
# All rights reserved.
#
# This file is part of prepair: 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.
#
# Licensees holding a valid commercial license may use this file in
# accordance with the commercial license agreement provided with
# the software.
#
# This file 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.
#
project( prepair )
cmake_minimum_required(VERSION 2.6.2)
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3)
cmake_policy(VERSION 2.8.4)
else()
cmake_policy(VERSION 2.6)
endif()
endif()
set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
if ( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
endif()
# CGAL
find_package( CGAL QUIET COMPONENTS )
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 REQUIRED )
if ( NOT Boost_FOUND )
message(SEND_ERROR "prepair requires the Boost library")
return()
endif()
# GDAL
find_package( GDAL )
if ( NOT GDAL_FOUND )
message(SEND_ERROR "prepair requires the GDAL library")
endif()
include_directories( ${GDAL_INCLUDE_DIR} )
# Creating entries for target: prepair
# ############################
if ( AS_LIBRARY )
add_library( prepair SHARED TriangleInfo.cpp PolygonRepair.cpp )
else()
add_executable( prepair TriangleInfo.cpp PolygonRepair.cpp prepair.cpp )
endif()
add_to_cached_list( CGAL_EXECUTABLE_TARGETS prepair )
# Link to CGAL and third-party libraries
target_link_libraries(prepair ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${GDAL_LIBRARY})