-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
38 lines (30 loc) · 1.17 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
cmake_minimum_required(VERSION 3.5)
project(carpentry_geom)
set(CMAKE_CXX_STANDARD 11)
set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE TRUE)
find_package( CGAL QUIET COMPONENTS Core)
if ( NOT CGAL_FOUND )
message(STATUS "This project requires the CGAL library, and will not be compiled.")
return()
endif()
include( ${CGAL_USE_FILE} )
include(ExternalProject)
ExternalProject_Add(
glm
PREFIX ${CMAKE_BINARY_DIR}/glm
GIT_REPOSITORY https://github.com/g-truc/glm.git
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
)
ExternalProject_Get_Property(glm source_dir)
set(GlmIncludeDir ${source_dir})
add_library(${PROJECT_NAME} SHARED geom.h twoD.cpp threeD.cpp mesh.cpp math.hpp clipper/clipper.cpp io.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# Export interface symbols and hide internal implementation
include(GenerateExportHeader)
generate_export_header(${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR} PRIVATE ${GlmIncludeDir})
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden)
add_dependencies(${PROJECT_NAME} glm)