From b623b861ee0532793537bdd256424dcca1f2b0b1 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 12 Sep 2024 14:44:13 +0200 Subject: [PATCH] build io_3mf plugin only if lib3mf target is found --- src/meshlabplugins/io_3mf/CMakeLists.txt | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/meshlabplugins/io_3mf/CMakeLists.txt b/src/meshlabplugins/io_3mf/CMakeLists.txt index 9b76f7323..eb6a2578f 100644 --- a/src/meshlabplugins/io_3mf/CMakeLists.txt +++ b/src/meshlabplugins/io_3mf/CMakeLists.txt @@ -21,14 +21,19 @@ # # ############################################################################# -set(HEADERS - io_3mf.h - ) +# Only build if we have lib3mf +if(TARGET external-lib3mf) + set(HEADERS io_3mf.h) -set(SOURCES - io_3mf.cpp - ) + set(SOURCES io_3mf.cpp) -add_meshlab_plugin(io_3mf ${SOURCES} ${HEADERS}) + add_meshlab_plugin(io_3mf ${SOURCES} ${HEADERS}) -target_link_libraries(io_3mf PUBLIC external-lib3mf) + target_link_libraries(io_3mf PUBLIC external-lib3mf) + +else() + message( + STATUS + "Skipping io_3mf - missing lib3mf in external directory." + ) +endif()