-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists_delphilib.txt
118 lines (92 loc) · 2.98 KB
/
CMakeLists_delphilib.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Cmake config for DelphiSurface module
project(DelphiSurface)
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()
include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_git.txt)
SET(CMAKE_CXX_STANDARD 14)
SET(CXX_STANDARD_REQUIRED ON)
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
SET(JSON_BuildTests OFF CACHE INTERNAL "")
include_directories (BEFORE include)
include_directories(src)
include_directories(src/ConfigFile)
include_directories(src/jama)
include_directories(src/tnt)
include_directories(src/sturm)
include_directories(src/octree)
find_package(Boost COMPONENTS thread)
if (Boost_FOUND)
link_directories ( ${Boost_LIBRARY_DIRS} )
link_libraries(${Boost_LIBRARIES})
include_directories ( ${Boost_INCLUDE_DIRS} )
include_directories (BEFORE include)
add_definitions(-DENABLE_BOOST_THREADS)
else (Boost_FOUND)
message(STATUS "Boost libs not found, Multithreading will be disabled")
endif (Boost_FOUND)
add_subdirectory(lib/spdlog)
add_definitions(-DSPDLOG)
add_subdirectory(lib/json)
#######################
### delphi bind mode ##
#######################
#delphi module
add_library(DelphiSurface SHARED
./src/sturm/sturm.cpp
./src/sturm/util.cpp
./src/sturm/solve.h
${SRC}
./src/ConfigFile/ConfigFile.cpp
./src/ConfigFile/ConfigFile.h
./src/octree/octree.h
)
add_definitions(-DDELPHI_BIND)
# if cgal is found, boost is automatically found
find_package(CGAL)
file(GLOB SRC
"./src/*.h"
"./src/*.cpp")
if (CGAL_FOUND)
include( ${CGAL_USE_FILE} )
add_definitions(-DENABLE_CGAL)
add_definitions(-DENABLE_BOOST_THREADS)
if (${UNIX})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mtune=native")
endif (${UNIX})
#######################
### delphi bind mode ##
#######################
#delphi module
target_sources(DelphiSurface
PRIVATE ./src/ply/ply.cpp
PRIVATE ./src/ply/ply.h
)
if (MSVC)
set_target_properties(DelphiSurface PROPERTIES COMPILE_FLAGS "/wd4503")
endif (MSVC)
else(CGAL_FOUND)
message(STATUS "CGAL not found, Skin Surface and Connolly Surface will be disabled")
if (${UNIX})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
endif (${UNIX})
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
if (CMAKE_COMPILER_IS_GNUCXX)
#...
endif (CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_C_COMPILER MATCHES "icc")
#..
endif ()
endif(CGAL_FOUND)
target_link_libraries(DelphiSurface
PRIVATE spdlog::spdlog_header_only
PRIVATE nlohmann_json::nlohmann_json
)
message(STATUS "C++ Release flags ${CMAKE_CXX_FLAGS_RELEASE}")