diff --git a/.gitmodules b/.gitmodules index a892ada732..90e29d2f65 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,3 @@ path = src/vcglib url = https://github.com/cnr-isti-vclab/vcglib branch = devel -[submodule "src/external/nexus"] - path = src/external/nexus - url = https://github.com/cnr-isti-vclab/nexus diff --git a/src/external/newuoa.cmake b/src/external/newuoa.cmake index 73821e8fe9..3f065ae7d4 100644 --- a/src/external/newuoa.cmake +++ b/src/external/newuoa.cmake @@ -2,11 +2,11 @@ # Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council # SPDX-License-Identifier: BSL-1.0 -option(ALLOW_BUNDLED_NEWUOA "Allow use of bundled newuoa source" ON) +option(MESHLAB_ALLOW_BUNDLED_NEWUOA "Allow use of bundled newuoa source" ON) set(NEWUOA_DIR ${VCGDIR}/wrap/newuoa) -if(ALLOW_BUNDLED_NEWUOA AND EXISTS "${NEWUOA_DIR}/include/newuoa.h") +if(MESHLAB_ALLOW_BUNDLED_NEWUOA AND EXISTS "${NEWUOA_DIR}/include/newuoa.h") message(STATUS "- newuoa - using bundled source") add_library(external-newuoa INTERFACE) target_include_directories(external-newuoa INTERFACE ${NEWUOA_DIR}/include) diff --git a/src/external/nexus b/src/external/nexus deleted file mode 160000 index 9f56edab7c..0000000000 --- a/src/external/nexus +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9f56edab7cf80d2d4a654e65be087ebd973f66bd diff --git a/src/external/nexus.cmake b/src/external/nexus.cmake index 1e1d1e69ad..fe247fa795 100644 --- a/src/external/nexus.cmake +++ b/src/external/nexus.cmake @@ -2,12 +2,31 @@ # Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council # SPDX-License-Identifier: BSL-1.0 -option(ALLOW_BUNDLED_NEXUS "Allow use of bundled nexus source" ON) +option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS "Allow download and use of nexus source" ON) + +if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS) + # todo - make release of nexus and corto + set(NEXUS_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/nexus-master) + set(CORTO_DIR ${NEXUS_DIR}/src/corto) + + if (NOT EXISTS "${NEXUS_DIR}/CMakeLists.txt") + set(NEXUS_LINK https://github.com/cnr-isti-vclab/nexus/archive/refs/heads/master.zip) + download_and_unzip(${NEXUS_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "nexus") + endif() + + if (NOT EXISTS "${CORTO_DIR}/CMakeLists.txt") + set(CORTO_LINK https://github.com/cnr-isti-vclab/corto/archive/refs/heads/master.zip) + download_and_unzip(${CORTO_LINK} "${NEXUS_DIR}/src/" "corto") + file(REMOVE ${NEXUS_DIR}/src/corto) + file(RENAME ${NEXUS_DIR}/src/corto-master ${NEXUS_DIR}/src/corto) + endif() + + message(STATUS "- nexus - using downloaded source") -if(ALLOW_BUNDLED_NEXUS AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/nexus/CMakeLists.txt") - message(STATUS "- nexus - using bundled source") set (BUILD_NXS_BUILD OFF) set (BUILD_NXS_EDIT OFF) set (BUILD_NXS_VIEW OFF) - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/nexus EXCLUDE_FROM_ALL) + add_subdirectory(${NEXUS_DIR} EXCLUDE_FROM_ALL) + add_library(external-nexus INTERFACE) + target_link_libraries(external-nexus INTERFACE nexus) endif() diff --git a/src/meshlabplugins/filter_io_nxs/CMakeLists.txt b/src/meshlabplugins/filter_io_nxs/CMakeLists.txt index bfe48051c8..c6b7343482 100644 --- a/src/meshlabplugins/filter_io_nxs/CMakeLists.txt +++ b/src/meshlabplugins/filter_io_nxs/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: BSL-1.0 # Only build if we have nexus -if (TARGET nexus) +if (TARGET external-nexus) set(SOURCES filter_io_nxs.cpp) @@ -10,7 +10,7 @@ if (TARGET nexus) add_meshlab_plugin(filter_io_nxs MODULE ${SOURCES} ${HEADERS}) - target_link_libraries(filter_io_nxs PRIVATE nexus) + target_link_libraries(filter_io_nxs PRIVATE external-nexus) else() message(STATUS "Skipping filter_io_nxs - missing nexus")