Skip to content

Commit

Permalink
remove nexus submodule and download it using cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Nov 4, 2022
1 parent 65012cd commit 86eb628
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/external/newuoa.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/external/nexus
Submodule nexus deleted from 9f56ed
27 changes: 23 additions & 4 deletions src/external/nexus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions src/meshlabplugins/filter_io_nxs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# 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)

set(HEADERS filter_io_nxs.h)

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")
Expand Down

0 comments on commit 86eb628

Please sign in to comment.