vcpkg/ports/opencolorio/0001-lcms-dependency-search.patch

40 lines
1.2 KiB
Diff

diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt
index d31b4e3..778b631 100644
--- a/src/apps/ociobakelut/CMakeLists.txt
+++ b/src/apps/ociobakelut/CMakeLists.txt
@@ -5,6 +5,34 @@ if(LCMS_FOUND AND (LCMS_VERSION VERSION_EQUAL 2.1 OR LCMS_VERSION VERSION_GREATE
FIND_PACKAGE_MESSAGE(LCMS "Found lcms: ${LCMS_LIBRARIES}"
"${LCMS_INCLUDE_DIR}")
else()
+ find_path(LCMS_INCLUDE_DIRS
+ NAMES
+ lcms2.h
+ lcms2_plugin.h
+ HINTS
+ ${LCMS_INCLUDEDIR}
+ ${LCMS_INCLUDE_DIRS}
+ )
+
+ find_library(LCMS_LIBRARIES
+ LIBRARY_NAMES
+ lcms
+ HINTS
+ ${LCMS_LIBRARY_DIRS}
+ )
+
+ get_filename_component(LCMS_LIBRARY_DIRS ${LCMS_LIBRARIES} DIRECTORY)
+
+ find_package_handle_standard_args(LCMS
+ REQUIRED_VARS
+ LCMS_LIBRARIES
+ LCMS_LIBRARY_DIRS
+ LCMS_INCLUDE_DIRS
+ )
+ mark_as_advanced(LCMS_LIBRARIES LCMS_INCLUDE_DIRS LCMS_LIBRARY_DIRS LCMS_FOUND)
+endif()
+
+if(NOT LCMS_FOUND)
find_package(Git)
if(NOT GIT_EXECUTABLE)
message("Git not found, could not build external LCMS as we cannot apply patch")