diff options
author | fuzzard <fuzzard@kodi.tv> | 2024-05-11 22:33:35 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2024-05-18 11:27:12 +1000 |
commit | 97306348142f1d3f5b69eeb0cbdf8238775837f4 (patch) | |
tree | 3cf26253fb767eb31df60e752e85a572c29bbbc3 | |
parent | 362c21e1b0c4e139e5857eb3cef17068b290abd9 (diff) |
[cmake][modules] FindLCMS2 cleanup and use core_target_link_libraries
-rw-r--r-- | cmake/modules/FindLCMS2.cmake | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/cmake/modules/FindLCMS2.cmake b/cmake/modules/FindLCMS2.cmake index e0501d2624..bb13ba8d82 100644 --- a/cmake/modules/FindLCMS2.cmake +++ b/cmake/modules/FindLCMS2.cmake @@ -5,10 +5,9 @@ # # This will define the following target: # -# LCMS2::LCMS2 - The LCMS Color Management library - -if(NOT TARGET LCMS2::LCMS2) +# ${APP_NAME_LC}::LCMS2 - The LCMS Color Management library +if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME}) if(LCMS2_FIND_VERSION) if(LCMS2_FIND_VERSION_EXACT) set(LCMS2_FIND_SPEC "=${LCMS2_FIND_VERSION_COMPLETE}") @@ -18,16 +17,14 @@ if(NOT TARGET LCMS2::LCMS2) endif() find_package(PkgConfig) - if(PKG_CONFIG_FOUND) + if(PKG_CONFIG_FOUND AND NOT (WIN32 OR WINDOWS_STORE)) pkg_check_modules(PC_LCMS2 lcms2${LCMS2_FIND_SPEC} QUIET) endif() find_path(LCMS2_INCLUDE_DIR NAMES lcms2.h - HINTS ${PC_LCMS2_INCLUDEDIR} - NO_CACHE) + HINTS ${DEPENDS_PATH}/include ${PC_LCMS2_INCLUDEDIR}) find_library(LCMS2_LIBRARY NAMES lcms2 liblcms2 - HINTS ${PC_LCMS2_LIBDIR} - NO_CACHE) + HINTS ${DEPENDS_PATH}/lib ${PC_LCMS2_LIBDIR}) set(LCMS2_VERSION ${PC_LCMS2_VERSION}) @@ -37,11 +34,10 @@ if(NOT TARGET LCMS2::LCMS2) VERSION_VAR LCMS2_VERSION) if(LCMS2_FOUND) - add_library(LCMS2::LCMS2 UNKNOWN IMPORTED) - set_target_properties(LCMS2::LCMS2 PROPERTIES - IMPORTED_LOCATION "${LCMS2_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIR}" - INTERFACE_COMPILE_DEFINITIONS "HAVE_LCMS2=1;CMS_NO_REGISTER_KEYWORD=1") - set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP LCMS2::LCMS2) + add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} UNKNOWN IMPORTED) + set_target_properties(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} PROPERTIES + IMPORTED_LOCATION "${LCMS2_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS "HAVE_LCMS2;CMS_NO_REGISTER_KEYWORD") endif() endif() |