forked from tudelft3d/val3dity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (47 loc) · 1.51 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
project( val3dity )
cmake_minimum_required (VERSION 3.2)
add_definitions(-std=c++14)
set( CMAKE_BUILD_TYPE "Release")
set( CMAKE_CXX_FLAGS "-O2" )
set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
if ( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
endif()
if (MSVC)
add_definitions("/EHsc")
endif(MSVC)
# CGAL
find_package( CGAL QUIET COMPONENTS )
if ( CGAL_FOUND )
include( ${CGAL_USE_FILE} )
message(STATUS "CGAL found")
message(STATUS ${CGAL_LIBRARIES})
message(STATUS ${CGAL_3RD_PARTY_LIBRARIES})
else()
message(SEND_ERROR "val3dity requires the CGAL library")
return()
endif()
# Eigen
find_package(Eigen3)
include( ${EIGEN3_USE_FILE} )
# Boost
find_package( Boost REQUIRED COMPONENTS filesystem)
if ( NOT Boost_FOUND )
message(SEND_ERROR "val3dity requires the Boost library")
return()
endif()
# GEOS
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package( GEOS )
if ( NOT GEOS_FOUND )
message(SEND_ERROR "val3dity requires the GEOS library")
endif()
include_directories( ${GEOS_INCLUDE_DIR} )
include_directories( ${CMAKE_SOURCE_DIR}/thirdparty )
FILE(GLOB_RECURSE THIRDPARTY thirdparty/*.cpp)
add_library(thirdparty STATIC ${THIRDPARTY})
FILE(GLOB SRC_FILES src/*.cpp)
add_executable(val3dity ${SRC_FILES})
# add_to_cached_list( CGAL_EXECUTABLE_TARGETS val3dity )
target_link_libraries(val3dity ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${GEOS_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} thirdparty)
install(TARGETS val3dity DESTINATION bin)