forked from libigl/libigl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
51 lines (44 loc) · 2.54 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
cmake_minimum_required(VERSION 2.8.12)
project(libigl)
### Compilation flags: adapt to your needs ###
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /bigobj /w") ### Enable parallel compilation
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR} )
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR} )
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") #### Libigl requires a modern C++ compiler that supports c++11
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter -Wno-deprecated-register -Wno-return-type-c-linkage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations -Wno-unused-parameter -Wno-deprecated-register -Wno-return-type-c-linkage")
endif()
option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" ON)
option(LIBIGL_WITH_ANTTWEAKBAR "Use AntTweakBar" ON)
option(LIBIGL_WITH_BBW "Use BBW" ON)
find_package(CGAL QUIET)
option(LIBIGL_WITH_CGAL "Use CGAL" "${CGAL_FOUND}")
option(LIBIGL_WITH_COMISO "Use CoMiso" ON)
### Cork is off by default since it fails to build out-of-the-box on windows
option(LIBIGL_WITH_CORK "Use Cork" OFF)
option(LIBIGL_WITH_EMBREE "Use Embree" ON)
option(LIBIGL_WITH_LIM "Use LIM" ON)
find_package(MATLAB QUIET)
option(LIBIGL_WITH_MATLAB "Use Matlab" "${MATLAB_FOUND}")
find_package(MOSEK QUIET)
option(LIBIGL_WITH_MOSEK "Use MOSEK" "${MOSEK_FOUND}")
### Nanogui is off by default because it has many dependencies and generates
### many issues
option(LIBIGL_WITH_NANOGUI "Use Nanogui menu" OFF)
option(LIBIGL_WITH_OPENGL "Use OpenGL" ON)
option(LIBIGL_WITH_PNG "Use PNG" ON)
option(LIBIGL_WITH_TETGEN "Use Tetgen" ON)
option(LIBIGL_WITH_TRIANGLE "Use Triangle" ON)
option(LIBIGL_WITH_VIEWER "Use OpenGL viewer" ON)
option(LIBIGL_WITH_XML "Use XML" ON)
if(LIBIGL_WITH_CGAL) # Do not remove or move this block, cgal strange build system fails without it
find_package(CGAL REQUIRED)
set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE CACHE BOOL "CGAL's CMAKE Setup is super annoying ")
include(${CGAL_USE_FILE})
endif()
# libigl*.a libraries should be built directly into libigl/lib/
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
add_subdirectory("${PROJECT_SOURCE_DIR}/../shared/cmake" "libigl")