remove nexus submodule and download it using cmake

This commit is contained in:
alemuntoni 2022-11-04 10:41:49 +01:00
parent 65012cd020
commit b9c9bb264b
5 changed files with 27 additions and 12 deletions

3
.gitmodules vendored
View File

@ -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

View File

@ -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)

1
src/external/nexus vendored

@ -1 +0,0 @@
Subproject commit 9f56edab7cf80d2d4a654e65be087ebd973f66bd

View File

@ -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")
file(REMOVE_RECURSE ${NEXUS_DIR}/src/corto)
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(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()

View File

@ -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")