forked from DanielLiamAnderson/Packaide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
73 lines (56 loc) · 2.77 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
69
70
71
72
73
# -------------------------------------------------------------------
# Build system for Packaide
# -------------------------------------------------------------------
# Requirements:
# - CMake version 3.13+
# - CGAL
# - Boost 1.65.1
# - Boost Python
# - A C++17 compiler
# -------------------------------------------------------------------
cmake_minimum_required(VERSION 3.13)
project(Packaide VERSION 1.0
DESCRIPTION "Fast and robust 2D nesting"
LANGUAGES CXX)
# Default to RELEASE build
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# Make sure -fno-omit-frame-pointer is set for profiling
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer")
message(STATUS "--------------- General configuration -------------")
message(STATUS "CMake Generator: ${CMAKE_GENERATOR}")
message(STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
message(STATUS "CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
message(STATUS "CMAKE_EXE_LINKER_FLAGS ${CMAKE_CXX_LINKER_FLAGS}")
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}" )
message(STATUS "---------------------------------------------------")
# -------------------------------------------------------------------
# Library definition
add_library(PackaideLib INTERFACE)
set(LIB_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
target_include_directories(PackaideLib INTERFACE ${LIB_INCLUDE_DIR})
target_compile_features(PackaideLib INTERFACE cxx_std_17)
# -------------------------------------------------------------------
# Link with CGAL
find_package(CGAL)
target_link_libraries(PackaideLib INTERFACE CGAL::CGAL)
# -------------------------------------------------------------------
# Python bindings
add_subdirectory(src)
# -------------------------------------------------------------------
# Python library installation
add_subdirectory(python)
# -------------------------------------------------------------------
# Tests
enable_testing()
add_subdirectory(test)
# -------------------------------------------------------------------
# Benchmarks
add_subdirectory(benchmark)