-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
77 lines (66 loc) · 2.27 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
cmake_minimum_required(VERSION 3.17)
set(CMAKE_TOOLCHAIN_FILE C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake)
project(BGAL)
# Default Build_type RELEASE
set(CMAKE_BUILD_TYPE RELEASE)
# CXX STANDARD
set(CMAKE_CXX_STANDARD 17)
# Set Version
set(VERSION 1.0)
# Set lib output directory
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/lib)
#set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
option(CMAKE_INSTALL_PREFIX "BGAL install PATH" /usr/local)
# include header from project_source_dir
include_directories(${PROJECT_SOURCE_DIR}/include)
# Get Eigen3
find_package(Eigen3 REQUIRED)
if (Eigen3_FOUND)
message(STATUS "${EIGEN3_VERSION_STRING}")
include_directories(${EIGEN3_INCLUDE_DIR})
endif ()
# Get Boost
find_package(Boost REQUIRED)
if (Boost_FOUND)
message(STATUS "BOOST FOUNDED")
include_directories(${Boost_INCLUDE_DIRS})
endif ()
# Get CGAL
find_package(CGAL REQUIRED)
if (CGAL_FOUND)
include(${CGAL_USE_FILE})
else ()
message("ERROR: this program requires CGAL and will not be compiled.")
endif ()
if(WIN32 AND NOT MINGW)
if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
if(NOT DEFINED CMAKE_RELWITHDEBINFO_POSTFIX)
set(CMAKE_RELWITHDEBINFO_POSTFIX "rd")
endif()
if(NOT DEFINED CMAKE_MINSIZEREL_POSTFIX)
set(CMAKE_MINSIZEREL_POSTFIX "s")
endif()
endif()
# sub_directory
add_subdirectory(include)
add_subdirectory(src)
#target_link_libraries(${PROJECT_NAME} Algorithm BaseShape Draw Geodesic Integral Model Optimization PointCloudProcessing PQP Reconstruction Tessellation2D Tessellation3D ${Boost_LIBRARIES})
add_subdirectory(MAIN)
install(TARGETS Algorithm BaseShape Draw Geodesic Integral Model Optimization PointCloudProcessing PQP Reconstruction Tessellation2D Tessellation3D CVTLike
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION include
)
install(DIRECTORY ./include/ DESTINATION include
FILES_MATCHING PATTERN "*.h")
configure_file(${PROJECT_NAME}-config.cmake.in ${PROJECT_NAME}-config.cmake @ONLY)
install(EXPORT ${PROJECT_NAME}Targets
FILE ${PROJECT_NAME}-config.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION lib/cmake/${PROJECT_NAME}
)