-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
executable file
·61 lines (43 loc) · 1.78 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
################################################################################
# Check required CMake version
set(REQUIRED_CMAKE_VERSION "3.14.0")
cmake_minimum_required(VERSION ${REQUIRED_CMAKE_VERSION})
if(INPUT_POLYFEMPY_DATA_ROOT)
set(POLYFEMPY_DATA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_POLYFEMPY_DATA_ROOT}/")
else()
set(POLYFEMPY_DATA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/data/")
endif()
if(NOT EXISTS ${POLYFEMPY_DATA_ROOT})
file(MAKE_DIRECTORY ${POLYFEMPY_DATA_ROOT})
endif()
project(polyfempy)
################################################################################
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/recipes/")
# Color output
include(UseColors)
# Prepend function
include(PrependCurrentPath)
# Extra warnings
include(Warnings)
# Use C++11/14
include(CXXFeatures)
# Sort projects inside the solution
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Generate position independent code by default
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
################################################################################
# Polyfem library
################################################################################
# dependencies
include(polyfem)
include(pybind11)
include(pybind11_json)
#for testing purpose
include(polyfem_data)
################################################################################
# Subdirectories
################################################################################
add_library(polyfempy MODULE src/binding.cpp src/raster.cpp)
target_link_libraries(polyfempy PRIVATE polyfem::polyfem pybind11::module pybind11::json)
set_target_properties(polyfempy PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}" SUFFIX "${PYTHON_MODULE_EXTENSION}")