From 65302ecc2d2d876588c6ef8f0f17ecb0b81b89cf Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 22 Apr 2021 15:05:11 +0200 Subject: [PATCH] external-exif lib --- src/common/CMakeLists.txt | 6 ++---- src/external/CMakeLists.txt | 4 +++- src/external/easyexif.cmake | 17 +++++++++++++++++ src/meshlab/CMakeLists.txt | 3 +-- src/meshlabplugins/io_base/CMakeLists.txt | 5 ++--- 5 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 src/external/easyexif.cmake diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index b1f377488..3055a4e23 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -130,8 +130,7 @@ set(SOURCES ml_selection_buffers.cpp ml_thread_safe_memory_info.cpp mlapplication.cpp - searcher.cpp - ${EXTERNAL_DIR}/easyexif/exif.cpp) + searcher.cpp) set(TARGET_TYPE SHARED) if(WIN32) @@ -145,8 +144,6 @@ target_compile_definitions(meshlab-common MESHLAB_SCALAR=${MESHLAB_SCALAR}) target_include_directories(meshlab-common - PRIVATE - ${EXTERNAL_DIR}/easyexif/ PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..) @@ -160,6 +157,7 @@ target_link_libraries( Qt5::Network vcglib external-glew + external-exif ) set_property(TARGET meshlab-common PROPERTY FOLDER Core) diff --git a/src/external/CMakeLists.txt b/src/external/CMakeLists.txt index e2f79d750..8046e4fed 100644 --- a/src/external/CMakeLists.txt +++ b/src/external/CMakeLists.txt @@ -24,8 +24,10 @@ endif() ## REQUIRED EXTERNAL LIBS ## # GLEW - required -include(${EXTERNAL_DIR}/glew.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/glew.cmake) +# EasyExif - required +include(${CMAKE_CURRENT_SOURCE_DIR}/easyexif.cmake) ## OPTIONAL EXTERNAL LIBS ## diff --git a/src/external/easyexif.cmake b/src/external/easyexif.cmake new file mode 100644 index 000000000..6d0c3e4e6 --- /dev/null +++ b/src/external/easyexif.cmake @@ -0,0 +1,17 @@ +# Copyright 2019, 2020, Collabora, Ltd. +# Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council +# SPDX-License-Identifier: BSL-1.0 + +option(ALLOW_BUNDLED_EXIF "Allow use of bundled EasyExif source" ON) + +set(EXIF_DIR ${EXTERNAL_DIR}/easyexif) + +if(ALLOW_BUNDLED_EXIF AND EXISTS "${EXIF_DIR}/exif.h") + message(STATUS "- exif - using bundled source") + add_library(external-exif STATIC ${EXIF_DIR}/exif.h ${EXIF_DIR}/exif.cpp) + target_include_directories(external-exif PUBLIC ${EXIF_DIR}) +else() + message( + FATAL_ERROR + "Exif is required - ALLOW_BUNDLED_EXIF must be enabled and found.") +endif() diff --git a/src/meshlab/CMakeLists.txt b/src/meshlab/CMakeLists.txt index 87b0f7eae..5749ab356 100644 --- a/src/meshlab/CMakeLists.txt +++ b/src/meshlab/CMakeLists.txt @@ -29,8 +29,7 @@ set(SOURCES rich_parameter_gui/richparameterwidgets.cpp ${VCGDIR}/wrap/gui/trackball.cpp ${VCGDIR}/wrap/gui/trackmode.cpp - ${VCGDIR}/wrap/gui/coordinateframe.cpp - ${EXTERNAL_DIR}/easyexif/exif.cpp) + ${VCGDIR}/wrap/gui/coordinateframe.cpp) set(HEADERS additionalgui.h diff --git a/src/meshlabplugins/io_base/CMakeLists.txt b/src/meshlabplugins/io_base/CMakeLists.txt index da10ac369..fffd82a7d 100644 --- a/src/meshlabplugins/io_base/CMakeLists.txt +++ b/src/meshlabplugins/io_base/CMakeLists.txt @@ -6,8 +6,7 @@ set(SOURCES baseio.cpp ${VCGDIR}/wrap/openfbx/src/miniz.c ${VCGDIR}/wrap/openfbx/src/ofbx.cpp - ${VCGDIR}/wrap/ply/plylib.cpp - ${EXTERNAL_DIR}/easyexif/exif.cpp) + ${VCGDIR}/wrap/ply/plylib.cpp) set(HEADERS baseio.h @@ -25,6 +24,6 @@ set(HEADERS add_meshlab_plugin(io_base ${SOURCES} ${HEADERS}) -target_include_directories(io_base PRIVATE ${EXTERNAL_DIR}/easyexif/) +#target_include_directories(io_base PRIVATE ${EXTERNAL_DIR}/easyexif/) target_link_libraries(io_base PRIVATE OpenGL::GLU)