diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bfc7266e..af09ed229 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ option(USE_SHARED_GIFLIB "Use your installed copy of giflib" off) option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off) option(USE_SHARED_ZLIB "Use your installed copy of zlib" off) option(USE_SHARED_LIBPNG "Use your installed copy of libpng" off) +option(USE_SHARED_TINYEXIF "Use your installed copy of TinyEXIF" off) option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off) option(USE_SHARED_PIXMAN "Use your installed copy of pixman" off) option(USE_SHARED_FREETYPE "Use shared FreeType library" off) @@ -192,6 +193,7 @@ set(PIXMAN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/pixman) set(FREETYPE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/freetype2) set(HARFBUZZ_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/harfbuzz) set(SIMPLEINI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/simpleini) +set(TINYEXIF_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/TinyEXIF) set(TINYXML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/tinyxml2) set(ZLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib) @@ -264,6 +266,16 @@ else() endif() include_directories(${TINYXML_INCLUDE_DIR}) +# TinyEXIF +if(USE_SHARED_TINYEXIF) + find_library(TINYEXIF_LIBRARY NAMES TinyEXIF) + find_path(TINYEXIF_INCLUDE_DIR NAMES TinyEXIF.h) +else() + set(TINYEXIF_LIBRARY TinyEXIFstatic) + set(TINYEXIF_INCLUDE_DIR ${TINYEXIF_DIR}) +endif() +include_directories(${TINYEXIF_INCLUDE_DIR}) + # pixman if(USE_SHARED_PIXMAN) find_library(PIXMAN_LIBRARY NAMES pixman pixman-1) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index b95fc9c5a..9c67c0268 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -747,6 +747,7 @@ target_link_libraries(app-lib undo ${CMARK_LIBRARIES} ${TINYXML_LIBRARY} + ${TINYEXIF_LIBRARY} ${JPEG_LIBRARIES} ${GIF_LIBRARIES} ${PNG_LIBRARIES} @@ -755,7 +756,6 @@ target_link_libraries(app-lib archive_static fmt tinyexpr - TinyEXIFstatic qoi) if(ENABLE_WEBP AND WEBP_FOUND) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index d8b914def..9d09a98c8 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -58,11 +58,13 @@ if(NOT USE_SHARED_TINYXML) add_subdirectory(tinyxml2) endif() -set(BUILD_SHARED_LIBS OFF CACHE BOOL "build as shared library") -set(BUILD_STATIC_LIBS ON CACHE BOOL "build as static library") -set(LINK_CRT_STATIC_LIBS OFF CACHE BOOL "link CRT static library") -set(BUILD_DEMO OFF CACHE BOOL "build demo binary") -add_subdirectory(TinyEXIF) +if(NOT USE_SHARED_TINYEXIF) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "build as shared library") + set(BUILD_STATIC_LIBS ON CACHE BOOL "build as static library") + set(LINK_CRT_STATIC_LIBS OFF CACHE BOOL "link CRT static library") + set(BUILD_DEMO OFF CACHE BOOL "build demo binary") + add_subdirectory(TinyEXIF) +endif() if(REQUIRE_CURL AND NOT USE_SHARED_CURL) set(BUILD_RELEASE_DEBUG_DIRS ON BOOL)