-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists_standalone.txt
98 lines (77 loc) · 2.6 KB
/
CMakeLists_standalone.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
# Cmake config for NanoShaper
project(NanoShaper)
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()
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
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)
file(GLOB SRC
"./src/*.h"
"./src/*.cpp")
# if cgal is found, boost is automatically found
find_package(CGAL)
if (CGAL_FOUND)
include( ${CGAL_USE_FILE} )
add_definitions(-DENABLE_CGAL)
add_definitions(-DENABLE_BOOST_THREADS)
if (MSVC)
set_target_properties(NanoShaper PROPERTIES COMPILE_FLAGS "/wd4503")
#message(STATUS "Adding optimizations for processor ${CMAKE_SYSTEM_PROCESSOR}")
endif (MSVC)
else(CGAL_FOUND)
message(STATUS "CGAL not found, Skin Surface and Connolly Surface will be disabled")
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)
if (${UNIX})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mtune=native")
endif (${UNIX})
add_executable(NanoShaper
./src/sturm/sturm.cpp
./src/sturm/util.cpp
./src/sturm/solve.h
${SRC}
./src/ply/ply.cpp
./src/ply/ply.h
./src/ConfigFile/ConfigFile.cpp
./src/ConfigFile/ConfigFile.h
./src/octree/octree.h
)
target_link_libraries(NanoShaper
PRIVATE spdlog::spdlog_header_only
PRIVATE nlohmann_json::nlohmann_json
)
message(STATUS "C++ Release flags ${CMAKE_CXX_FLAGS_RELEASE}")