|
8 | 8 | # Download and update 3rdparty libraries |
9 | 9 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) |
10 | 10 | list(REMOVE_DUPLICATES CMAKE_MODULE_PATH) |
11 | | -include(PyiglDownloadExternal) |
12 | 11 |
|
13 | 12 | ################################################################################ |
14 | 13 | # Required libraries |
15 | 14 | ################################################################################ |
16 | 15 |
|
17 | | -SET(NPE_WITH_EIGEN ${PYLIBIGL_EXTERNAL}/libigl/external/eigen) |
18 | 16 |
|
19 | 17 | include(FetchContent) |
| 18 | + |
20 | 19 | FetchContent_Declare( |
21 | 20 | libigl |
22 | 21 | GIT_REPOSITORY https://github.com/libigl/libigl.git |
23 | 22 | GIT_TAG 238a607032d725cbf1b99cad2077516b1ee066d8 |
24 | 23 | ) |
| 24 | +FetchContent_GetProperties(libigl) |
25 | 25 | FetchContent_MakeAvailable(libigl) |
26 | 26 |
|
27 | | -pyigl_download_numpyeigen() |
28 | | -pyigl_download_tutorial_data() |
| 27 | +FetchContent_Declare( |
| 28 | + numpyeigen |
| 29 | + GIT_REPOSITORY https://github.com/fwilliams/numpyeigen.git |
| 30 | + GIT_TAG 05a22ad4f06a431bffc3860b30c00cf89e81373b) |
| 31 | +# NumpyEigen's CMakeLists sets NPE_PYTHON_EXECUTABLE without a way to override, |
| 32 | +# so we must include directly rather that using FetchContent_MakeAvailable |
| 33 | +#FetchContent_MakeAvailable(numpyeigen) |
| 34 | +# Check if population has already been performed |
| 35 | +FetchContent_GetProperties(numpyeigen) |
| 36 | +if(NOT numpyeigen_POPULATED) |
| 37 | + # Fetch the content using previously declared details |
| 38 | + FetchContent_Populate(numpyeigen) |
| 39 | +endif() |
| 40 | +# Push CMAKE_MODULE_PATH |
| 41 | +set(PREV_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) |
| 42 | +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${numpyeigen_SOURCE_DIR}/cmake) |
| 43 | +# Why isn't eigen_SOURCE_DIR defined? |
| 44 | +SET(NPE_WITH_EIGEN "${libigl_SOURCE_DIR}/../eigen-src/" CACHE INTERNAL "") |
| 45 | +include(numpyeigen) |
| 46 | +# Pop CMAKE_MODULE_PATH |
| 47 | +set(CMAKE_MODULE_PATH ${PREV_CMAKE_MODULE_PATH}) |
| 48 | + |
| 49 | +if(${PY_IGL_DOWNLOAD_TEST_DATA}) |
| 50 | + FetchContent_Declare(test_data |
| 51 | + SOURCE_DIR "${PYLIBIGL_EXTERNAL}/../data" |
| 52 | + GIT_REPOSITORY https://github.com/libigl/libigl-tests-data.git |
| 53 | + GIT_TAG 19cedf96d70702d8b3a83eb27934780c542356fe) |
| 54 | + FetchContent_MakeAvailable(test_data) |
| 55 | +endif() |
29 | 56 |
|
| 57 | +if(${PY_IGL_DOWNLOAD_TUTORIAL_DATA}) |
| 58 | + FetchContent_Declare(tutorial_data |
| 59 | + SOURCE_DIR "${PYLIBIGL_EXTERNAL}/../tutorial/data" |
| 60 | + GIT_REPOSITORY https://github.com/libigl/libigl-tutorial-data.git |
| 61 | + GIT_TAG c1f9ede366d02e3531ecbaec5e3769312f31cccd) |
| 62 | + FetchContent_MakeAvailable(tutorial_data) |
| 63 | +endif() |
30 | 64 |
|
0 commit comments