diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9bda3b3a63..f5c7a6dd70 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -100,8 +100,8 @@ if (PNG_FOUND) target_link_libraries(heif-convert PRIVATE ${PNG_LIBRARIES}) target_link_libraries(heif-enc PRIVATE ${PNG_LIBRARIES}) - target_include_directories(heif-convert PRIVATE ${PNG_INCLUDE_DIR}) - target_include_directories(heif-enc PRIVATE ${PNG_INCLUDE_DIR}) + target_include_directories(heif-convert PRIVATE ${PNG_INCLUDE_DIRS}) + target_include_directories(heif-enc PRIVATE ${PNG_INCLUDE_DIRS}) target_sources(heif-convert PRIVATE encoder_png.cc encoder_png.h) target_sources(heif-enc PRIVATE decoder_png.cc decoder_png.h) @@ -120,7 +120,7 @@ if (PNG_FOUND) common.cc common.h) target_link_libraries(heif-thumbnailer heif ${PNG_LIBRARIES}) - target_include_directories(heif-thumbnailer PRIVATE ${PNG_INCLUDE_DIR}) + target_include_directories(heif-thumbnailer PRIVATE ${PNG_INCLUDE_DIRS}) install(TARGETS heif-thumbnailer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES heif-thumbnailer.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) diff --git a/libheif/CMakeLists.txt b/libheif/CMakeLists.txt index df9743ccf7..bec2d214db 100644 --- a/libheif/CMakeLists.txt +++ b/libheif/CMakeLists.txt @@ -109,8 +109,8 @@ add_subdirectory(plugins) if (LIBSHARPYUV_FOUND) message("Compiling in 'libsharpyuv'") target_compile_definitions(heif PUBLIC HAVE_LIBSHARPYUV=1) - target_include_directories(heif PRIVATE ${LIBSHARPYUV_INCLUDE_DIR}) - target_link_libraries(heif PRIVATE ${LIBSHARPYUV_LIBRARIES} ${LIBSHARPYUV_LINKDIR}) + target_include_directories(heif PRIVATE ${LIBSHARPYUV_INCLUDE_DIRS}) + target_link_libraries(heif PRIVATE ${LIBSHARPYUV_LIBRARIES}) else () message("Not compiling 'libsharpyuv'") endif () diff --git a/libheif/plugins/CMakeLists.txt b/libheif/plugins/CMakeLists.txt index b10d73c399..bdf4d2d44a 100644 --- a/libheif/plugins/CMakeLists.txt +++ b/libheif/plugins/CMakeLists.txt @@ -1,10 +1,6 @@ macro(plugin_compilation name varName optionName defineName) if (${varName}_FOUND AND WITH_${optionName}) - if (NOT "${${varName}_LIBRARY_DIRS}" STREQUAL "") - set(${varName}_LINKDIR "-L${${varName}_LIBRARY_DIRS}") - endif () - if (PLUGIN_LOADING_SUPPORTED_AND_ENABLED AND WITH_${optionName}_PLUGIN) message("Compiling '" ${name} "' as dynamic plugin") add_library(heif-${name} @@ -22,8 +18,8 @@ macro(plugin_compilation name varName optionName defineName) LIBHEIF_EXPORTS HAVE_VISIBILITY) target_compile_definitions(heif-${name} PRIVATE PLUGIN_${defineName}=1) - target_include_directories(heif-${name} PRIVATE ${PROJECT_SOURCE_DIR} ${libheif_BINARY_DIR} ${libheif_SOURCE_DIR} ${${varName}_INCLUDE_DIR} ${${varName}_INCLUDE_DIRS}) - target_link_libraries(heif-${name} PRIVATE ${${varName}_LIBRARIES} ${${varName}_LINKDIR} heif) + target_include_directories(heif-${name} PRIVATE ${PROJECT_SOURCE_DIR} ${libheif_BINARY_DIR} ${libheif_SOURCE_DIR} ${${varName}_INCLUDE_DIRS}) + target_link_libraries(heif-${name} PRIVATE ${${varName}_LIBRARIES} heif) install(TARGETS heif-${name} LIBRARY DESTINATION ${PLUGIN_DIRECTORY} @@ -32,8 +28,8 @@ macro(plugin_compilation name varName optionName defineName) message("Compiling '" ${name} "' as built-in backend") target_sources(heif PRIVATE ${${optionName}_sources}) target_compile_definitions(heif PRIVATE HAVE_${defineName}=1) - target_include_directories(heif PRIVATE ${${varName}_INCLUDE_DIR} ${${varName}_INCLUDE_DIRS}) - target_link_libraries(heif PRIVATE ${${varName}_LIBRARIES} ${${varName}_LINKDIR}) + target_include_directories(heif PRIVATE ${${varName}_INCLUDE_DIRS}) + target_link_libraries(heif PRIVATE ${${varName}_LIBRARIES}) endif () set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${varName}_CFLAGS}")