[cosmetic] separate c-lang format commit
[xbmc.git] / cmake / modules / FindSmctemp.cmake
blob3cfa5d6fa5672661e74f0fc371355014e79ab40c
1 #.rst:
2 # FindSmctemp
3 # -------
4 # Finds the smctemp library
6 # This will define the following imported targets::
8 #   ${APP_NAME_LC}::Smctemp   - The smctemp library
10 if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME})
12   find_path(SMCTEMP_INCLUDE_DIR NAMES smctemp.h
13                                 HINTS ${DEPENDS_PATH}/include)
14   find_library(SMCTEMP_LIBRARY NAMES smctemp
15                                HINTS ${DEPENDS_PATH}/lib)
17   include(FindPackageHandleStandardArgs)
18   find_package_handle_standard_args(Smctemp
19                                     REQUIRED_VARS SMCTEMP_LIBRARY SMCTEMP_INCLUDE_DIR
20                                     VERSION_VAR SMCTEMP_VERSION)
22   if(SMCTEMP_FOUND)
23     add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} UNKNOWN IMPORTED)
24     set_target_properties(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} PROPERTIES
25                                                                      IMPORTED_LOCATION "${SMCTEMP_LIBRARY}"
26                                                                      INTERFACE_INCLUDE_DIRECTORIES "${SMCTEMP_INCLUDE_DIR}")
27   else()
28     if(Smctemp_FIND_REQUIRED)
29       message(FATAL_ERROR "Smctemp library not found.")
30     endif()
31   endif()
32 endif()