-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathCMakeLists.txt
executable file
·70 lines (55 loc) · 2.12 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
# Cmake 2.6.0 is missing a few macros that FindEigen3.cmake uses
cmake_minimum_required (VERSION 2.6.2)
project (libWetCloth)
set (LIBWETCLOTH_VERSION "2018")
add_definitions (-DLIBWETCLOTH_VERSION="${LIBWETCLOTH_VERSION}")
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install")
# Initialize the build type (Release, Debug, etc)
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: Debug Release."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
add_definitions (-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}")
# Add warnings to the compiler flags
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -DEIGEN_DONT_ALIGN -DEIGEN_DONT_ALIGN_STATICALLY")
if (WIN32)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions (-DDEBUG)
endif (CMAKE_BUILD_TYPE MATCHES Debug)
if (CMAKE_BUILD_TYPE MATCHES Release)
add_definitions (-DNDEBUG)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif (CMAKE_BUILD_TYPE MATCHES Release)
# Add directory with macros
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
# Add cmake file with useful functions
include (libWetClothCommon)
option (USE_MKL "Builds in support for mkl" OFF)
if (USE_MKL)
set (MKL_STATIC 1)
find_package (MKL REQUIRED)
if (MKL_FOUND)
include_directories (${MKL_INCLUDE_DIRS})
set (LIBWETCLOTH_LIBRARIES ${LIBWETCLOTH_LIBRARIES} ${MKL_LIBRARIES})
add_definitions (-DEIGEN_USE_MKL_ALL)
else (MKL_FOUND)
message (SEND_ERROR "Unable to locate MKL")
endif (MKL_FOUND)
endif (USE_MKL)
# Eigen3 library is required
find_package (Eigen3 REQUIRED)
if (EIGEN3_FOUND)
include_directories (${EIGEN3_INCLUDE_DIR})
else (EIGEN3_FOUND)
message (SEND_ERROR "Unable to locate Eigen3")
endif (EIGEN3_FOUND)
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include/)
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include/eigen/)
add_subdirectory (libWetCloth)
if (NOT WIN32)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/assets ${CMAKE_CURRENT_BINARY_DIR}/libWetCloth/assets )
endif ()