diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 14cd330c8..382cbfc23 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,6 +26,9 @@ find_package( COMPONENTS OpenGL Xml Network REQUIRED) find_package(OpenMP) +if (NOT BUILD_MINI) + find_package(Qt5Qml) +endif() message(STATUS "Searching for required components with bundled fallback") find_package(GLEW) @@ -103,14 +106,24 @@ endif() ### Enter subdirectories +# VCGLib -- required +if(NOT VCGDIR) + get_filename_component(VCGDIR "${CMAKE_CURRENT_LIST_DIR}/vcglib" ABSOLUTE) + if(NOT EXISTS ${VCGDIR}) + set(VCGDIR NOTFOUND) + endif() +endif() +set(VCGDIR "${VCGDIR}") + +if(NOT VCGDIR) + message(FATAL_ERROR "VCGLib not found. Please clone recursively the MeshLab repo.") +endif() + + # External set(EXTERNAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external) -include(${CMAKE_CURRENT_SOURCE_DIR}/external_common.cmake) -if(NOT BUILD_MINI) - message(STATUS "Searching for optional components") - find_package(Qt5Qml) - include(${EXTERNAL_DIR}/external.cmake) -endif() +include(${EXTERNAL_DIR}/external_common.cmake) +add_subdirectory(${EXTERNAL_DIR}) # Start automoc/autouic/autorcc set(CMAKE_AUTOMOC ON) diff --git a/src/external/CMakeLists.txt b/src/external/CMakeLists.txt new file mode 100644 index 000000000..fe3e0c10c --- /dev/null +++ b/src/external/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright 2019, 2020, Collabora, Ltd. +# Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council +# SPDX-License-Identifier: BSL-1.0 + +# GLEW - required +include(${EXTERNAL_DIR}/glew.cmake) + +if(NOT BUILD_MINI) + message(STATUS "Searching for optional components") + include(${EXTERNAL_DIR}/external.cmake) +endif() diff --git a/src/external_common.cmake b/src/external/external_common.cmake similarity index 62% rename from src/external_common.cmake rename to src/external/external_common.cmake index e5ed003ce..c5f22167b 100644 --- a/src/external_common.cmake +++ b/src/external/external_common.cmake @@ -12,23 +12,5 @@ if(BUILD_BUNDLED_SOURCES_WITHOUT_WARNINGS) endif() endif() -# GLEW - required -include(${EXTERNAL_DIR}/glew.cmake) - - -# VCGLib -- required -if(NOT VCGDIR) - get_filename_component(VCGDIR "${CMAKE_CURRENT_LIST_DIR}/vcglib" ABSOLUTE) - if(NOT EXISTS ${VCGDIR}) - set(VCGDIR NOTFOUND) - endif() -endif() -set(VCGDIR "${VCGDIR}") - -if(NOT VCGDIR) - message(FATAL_ERROR "VCGLib not found. Please clone recursively the MeshLab repo.") -endif() - - # Eigen3 - required include(${EXTERNAL_DIR}/eigen.cmake) diff --git a/src/meshlabplugins/io_u3d/CMakeLists.txt b/src/meshlabplugins/io_u3d/CMakeLists.txt index 7f2c41cbe..e6091e150 100644 --- a/src/meshlabplugins/io_u3d/CMakeLists.txt +++ b/src/meshlabplugins/io_u3d/CMakeLists.txt @@ -8,7 +8,7 @@ if(TARGET external-IDTFConverter) set(SOURCES io_u3d.cpp) set(HEADERS io_u3d.h) - include_directories("${U3D_DIR}/src/IDTF") + include_directories("${EXTERNAL_DIR}/u3d/src/IDTF") add_library(io_u3d MODULE ${SOURCES} ${HEADERS}) diff --git a/src/meshlabplugins/io_u3d/io_u3d.cpp b/src/meshlabplugins/io_u3d/io_u3d.cpp index e35cdbde4..f6ddc35a0 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.cpp +++ b/src/meshlabplugins/io_u3d/io_u3d.cpp @@ -81,7 +81,7 @@ bool U3DIOPlugin::save( const int mask, const RichParameterList & par, vcg::CallBackPos *, - QWidget *parent) + QWidget *) { vcg::tri::Allocator::CompactVertexVector(m.cm); vcg::tri::Allocator::CompactFaceVector(m.cm);