-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
57 lines (44 loc) · 1.08 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
cmake_minimum_required(VERSION 3.5.0)
PROJECT (TetGrain CXX)
# Add a compiler flag
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
# Static / dynamic library
option(BUILD_STATIC "BUILD STATIC LIBRARY" OFF)
# Testing options
option(USE_TESTS "ENABLE TESTS" OFF)
# Adaptor options
option(USE_CGAL "USE CGAL MESHER" OFF)
# Include sources
set(SOURCE_EXE
src/grainratio.h
src/grainratio.cpp
src/grainmesh.h
src/grainmesh.cpp
src/iotetgen.h
src/iotetgen.cpp
src/common.h
src/common.cpp)
set(SOURCE_NETGEN
src/netgenadaptor.h
src/netgenadaptor.cpp)
SET(SOURCE_CGAL)
if(USE_CGAL)
find_package(CGAL)
include(${CGAL_USE_FILE})
SET(SOURCE_CGAL
src/adaptorcgal.h
src/adaptorcgal.cpp)
endif()
# Create library
if(BUILD_STATIC)
add_library(TetGrain ${SOURCE_EXE} ${SOURCE_NETGEN} ${SOURCE_CGAL})
else()
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(TetGrain SHARED ${SOURCE_EXE} ${SOURCE_NETGEN} ${SOURCE_CGAL})
endif()
if(USE_TESTS)
add_subdirectory(test build/test)
endif()
if(USE_CGAL)
target_link_libraries(TetGrain ${CGAL_LIBS})
endif()