aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2024-05-12 15:41:00 +1000
committerfuzzard <fuzzard@kodi.tv>2024-06-22 13:17:14 +1000
commit48abdb5a32b610bcaa148295951252d69b8e0280 (patch)
tree28898982cdf6861819364681eafe182f1b5d9366 /cmake
parentdcec96dc89606dc5efcdd5e0830c493a197862f8 (diff)
[cmake][modules] FindWebOSHelpers cleanup and use core_target_link_libraries
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindWebOSHelpers.cmake40
1 files changed, 20 insertions, 20 deletions
diff --git a/cmake/modules/FindWebOSHelpers.cmake b/cmake/modules/FindWebOSHelpers.cmake
index 0c862b7a79..facfbcc03e 100644
--- a/cmake/modules/FindWebOSHelpers.cmake
+++ b/cmake/modules/FindWebOSHelpers.cmake
@@ -5,29 +5,26 @@
#
# This will define the following target:
#
-# WEBOSHELPERS::WEBOSHELPERS - The webOS helpers library
-
-if(NOT TARGET WEBOSHELPERS::WEBOSHELPERS)
-
- if(WebOSHelpers_FIND_VERSION)
- if(WebOSHelpers_FIND_VERSION_EXACT)
- set(WebOSHelpers_FIND_SPEC "=${WebOSHelpers_FIND_VERSION_COMPLETE}")
- else()
- set(WebOSHelpers_FIND_SPEC ">=${WebOSHelpers_FIND_VERSION_COMPLETE}")
- endif()
- endif()
+# ${APP_NAME_LC}::WebOSHelpers - The webOS helpers library
+if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME})
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
+ if(WebOSHelpers_FIND_VERSION)
+ if(WebOSHelpers_FIND_VERSION_EXACT)
+ set(WebOSHelpers_FIND_SPEC "=${WebOSHelpers_FIND_VERSION_COMPLETE}")
+ else()
+ set(WebOSHelpers_FIND_SPEC ">=${WebOSHelpers_FIND_VERSION_COMPLETE}")
+ endif()
+ endif()
+
pkg_check_modules(PC_WEBOSHELPERS helpers${WebOSHelpers_FIND_SPEC} QUIET)
endif()
find_path(WEBOSHELPERS_INCLUDE_DIR NAMES webos-helpers/libhelpers.h
- HINTS ${PC_WEBOSHELPERS_INCLUDEDIR}
- NO_CACHE)
+ HINTS ${PC_WEBOSHELPERS_INCLUDEDIR})
find_library(WEBOSHELPERS_LIBRARY NAMES helpers
- HINTS ${PC_WEBOSHELPERS_LIBDIR}
- NO_CACHE)
+ HINTS ${PC_WEBOSHELPERS_LIBDIR})
set(WEBOSHELPERS_VERSION ${PC_WEBOSHELPERS_VERSION})
@@ -37,10 +34,13 @@ if(NOT TARGET WEBOSHELPERS::WEBOSHELPERS)
VERSION_VAR WEBOSHELPERS_VERSION)
if(WEBOSHELPERS_FOUND)
- add_library(WEBOSHELPERS::WEBOSHELPERS UNKNOWN IMPORTED)
- set_target_properties(WEBOSHELPERS::WEBOSHELPERS PROPERTIES
- IMPORTED_LOCATION "${WEBOSHELPERS_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES "${WEBOSHELPERS_INCLUDE_DIR}")
- set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP WEBOSHELPERS::WEBOSHELPERS)
+ add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} UNKNOWN IMPORTED)
+ set_target_properties(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} PROPERTIES
+ IMPORTED_LOCATION "${WEBOSHELPERS_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${WEBOSHELPERS_INCLUDE_DIR}")
+ else()
+ if(WebOSHelpers_FIND_REQUIRED)
+ message(FATAL_ERROR "WebOSHelpers libraries were not found.")
+ endif()
endif()
endif()