Skip to content

Commit

Permalink
CMake: Fix TIFF_INCLUDE_DIRS
Browse files Browse the repository at this point in the history
(cherry picked from commit f8498e2)
  • Loading branch information
jschueller authored and sezero committed Oct 29, 2023
1 parent 0059bbb commit 0a44dce
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmake/TiffConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ function(set_variable_from_rel_or_absolute_path var root rel_or_abs_path)
endfunction()

# Tell the user project where to find our headers and libraries
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" ABSOLUTE)
get_filename_component(_DIR "${_DIR}" DIRECTORY)
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
get_filename_component(_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)
# Use _ROOT as prefix here for the possibility of relocation after installation.
set_variable_from_rel_or_absolute_path("TIFF_INCLUDE_DIR" "${_ROOT}" "@CMAKE_INSTALL_INCLUDEDIR@")
Expand All @@ -21,7 +20,7 @@ set(TIFF_INCLUDE_DIRS ${TIFF_INCLUDE_DIR})
set(TIFF_LIBRARIES TIFF::tiff)

if(NOT TARGET TIFF::tiff)
include("${_DIR}/TiffTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/TiffTargets.cmake")
endif()

unset (_ROOT)
Expand Down

0 comments on commit 0a44dce

Please sign in to comment.