Skip to content

Commit 86eb628

Browse files
committed
remove nexus submodule and download it using cmake
1 parent 65012cd commit 86eb628

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
path = src/vcglib
33
url = https://github.com/cnr-isti-vclab/vcglib
44
branch = devel
5-
[submodule "src/external/nexus"]
6-
path = src/external/nexus
7-
url = https://github.com/cnr-isti-vclab/nexus

src/external/newuoa.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council
33
# SPDX-License-Identifier: BSL-1.0
44

5-
option(ALLOW_BUNDLED_NEWUOA "Allow use of bundled newuoa source" ON)
5+
option(MESHLAB_ALLOW_BUNDLED_NEWUOA "Allow use of bundled newuoa source" ON)
66

77
set(NEWUOA_DIR ${VCGDIR}/wrap/newuoa)
88

9-
if(ALLOW_BUNDLED_NEWUOA AND EXISTS "${NEWUOA_DIR}/include/newuoa.h")
9+
if(MESHLAB_ALLOW_BUNDLED_NEWUOA AND EXISTS "${NEWUOA_DIR}/include/newuoa.h")
1010
message(STATUS "- newuoa - using bundled source")
1111
add_library(external-newuoa INTERFACE)
1212
target_include_directories(external-newuoa INTERFACE ${NEWUOA_DIR}/include)

src/external/nexus

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/external/nexus.cmake

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,31 @@
22
# Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council
33
# SPDX-License-Identifier: BSL-1.0
44

5-
option(ALLOW_BUNDLED_NEXUS "Allow use of bundled nexus source" ON)
5+
option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS "Allow download and use of nexus source" ON)
6+
7+
if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS)
8+
# todo - make release of nexus and corto
9+
set(NEXUS_DIR ${MESHLAB_EXTERNAL_DOWNLOAD_DIR}/nexus-master)
10+
set(CORTO_DIR ${NEXUS_DIR}/src/corto)
11+
12+
if (NOT EXISTS "${NEXUS_DIR}/CMakeLists.txt")
13+
set(NEXUS_LINK https://github.com/cnr-isti-vclab/nexus/archive/refs/heads/master.zip)
14+
download_and_unzip(${NEXUS_LINK} ${MESHLAB_EXTERNAL_DOWNLOAD_DIR} "nexus")
15+
endif()
16+
17+
if (NOT EXISTS "${CORTO_DIR}/CMakeLists.txt")
18+
set(CORTO_LINK https://github.com/cnr-isti-vclab/corto/archive/refs/heads/master.zip)
19+
download_and_unzip(${CORTO_LINK} "${NEXUS_DIR}/src/" "corto")
20+
file(REMOVE ${NEXUS_DIR}/src/corto)
21+
file(RENAME ${NEXUS_DIR}/src/corto-master ${NEXUS_DIR}/src/corto)
22+
endif()
23+
24+
message(STATUS "- nexus - using downloaded source")
625

7-
if(ALLOW_BUNDLED_NEXUS AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/nexus/CMakeLists.txt")
8-
message(STATUS "- nexus - using bundled source")
926
set (BUILD_NXS_BUILD OFF)
1027
set (BUILD_NXS_EDIT OFF)
1128
set (BUILD_NXS_VIEW OFF)
12-
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/nexus EXCLUDE_FROM_ALL)
29+
add_subdirectory(${NEXUS_DIR} EXCLUDE_FROM_ALL)
30+
add_library(external-nexus INTERFACE)
31+
target_link_libraries(external-nexus INTERFACE nexus)
1332
endif()

src/meshlabplugins/filter_io_nxs/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# SPDX-License-Identifier: BSL-1.0
33

44
# Only build if we have nexus
5-
if (TARGET nexus)
5+
if (TARGET external-nexus)
66

77
set(SOURCES filter_io_nxs.cpp)
88

99
set(HEADERS filter_io_nxs.h)
1010

1111
add_meshlab_plugin(filter_io_nxs MODULE ${SOURCES} ${HEADERS})
1212

13-
target_link_libraries(filter_io_nxs PRIVATE nexus)
13+
target_link_libraries(filter_io_nxs PRIVATE external-nexus)
1414

1515
else()
1616
message(STATUS "Skipping filter_io_nxs - missing nexus")

0 commit comments

Comments
 (0)