-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (58 loc) · 2.13 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
cmake_minimum_required(VERSION 3.10.0)
project(grana VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_BUILD_TYPE Debug)
###################################################################
if(NOT WIN32)
string(ASCII 27 Esc)
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif()
###################################################################
set(GRANA_CGAL_DIR "" CACHE STRING "CGAL installation folder.")
add_executable(grana "")
target_sources(grana
PRIVATE
src/main.cpp
src/utils.cpp
src/continuous_base.cpp
src/continuous.cpp
src/grid.cpp
src/grid_base.cpp
src/octree.cpp
src/PDB.cpp
include/GrANA/utils.hpp
include/GrANA/continuous_primitives.hpp
include/GrANA/continuous_base.hpp
include/GrANA/continuous.hpp
include/GrANA/grid_primitives.hpp
include/GrANA/grid_base.hpp
include/GrANA/grid.hpp
include/GrANA/octree.hpp
include/GrANA/PDB.hpp
)
message("${Magenta}Trying to automatically locate CGAL, gmp and mpfr libraries.${ColourReset}")
find_package(CGAL CONFIG REQUIRED)
target_link_libraries(grana PRIVATE CGAL)
target_link_libraries(grana PRIVATE gmp)
target_link_libraries(grana PRIVATE mpfr)
message("${Magenta}Building own chemfiles library.${ColourReset}")
add_subdirectory(external/chemfiles EXCLUDE_FROM_ALL)
target_link_libraries(grana PRIVATE chemfiles)
message("${Magenta}Using chemfiles's fmt header-only library.${ColourReset}")
include_directories(build/external/chemfiles/external/fmt/include)
# find_package(fmt)
# target_link_libraries(<your-target> fmt::fmt)
# find_package(Open3D HINTS ${CMAKE_INSTALL_PREFIX}/lib/cmake)
# target_link_libraries(grana Open3D::Open3D)
target_include_directories(grana
PRIVATE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_compile_options(grana PRIVATE -Wall -Wextra)
target_compile_features(grana PRIVATE cxx_std_17)