diff --git a/cmake/Conky.cmake b/cmake/Conky.cmake index 62465bb2..65204d28 100644 --- a/cmake/Conky.cmake +++ b/cmake/Conky.cmake @@ -128,18 +128,19 @@ macro(AC_SEARCH_LIBS FUNCTION_NAME INCLUDES TARGET_VAR) check_symbol_exists(${FUNCTION_NAME} ${INCLUDES} AC_SEARCH_LIBS_TMP) if(${AC_SEARCH_LIBS_TMP}) set(${TARGET_VAR} "" CACHE INTERNAL "Library containing ${FUNCTION_NAME}") - return() + else(${AC_SEARCH_LIBS_TMP}) + foreach(LIB ${ARGN}) + unset(AC_SEARCH_LIBS_TMP CACHE) + unset(AC_SEARCH_LIBS_FOUND CACHE) + find_library(AC_SEARCH_LIBS_TMP ${LIB}) + check_library_exists(${LIB} ${FUNCTION_NAME} ${AC_SEARCH_LIBS_TMP} + AC_SEARCH_LIBS_FOUND) + if(${AC_SEARCH_LIBS_FOUND}) + set(${TARGET_VAR} ${AC_SEARCH_LIBS_TMP} CACHE INTERNAL + "Library containing ${FUNCTION_NAME}") + break() + endif(${AC_SEARCH_LIBS_FOUND}) + endforeach(LIB) endif(${AC_SEARCH_LIBS_TMP}) - - foreach(LIB ${ARGN}) - unset(AC_SEARCH_LIBS_TMP CACHE) - unset(AC_SEARCH_LIBS_FOUND CACHE) - find_library(AC_SEARCH_LIBS_TMP ${LIB}) - check_library_exists(${LIB} ${FUNCTION_NAME} ${AC_SEARCH_LIBS_TMP} AC_SEARCH_LIBS_FOUND) - if(${AC_SEARCH_LIBS_FOUND}) - set(${TARGET_VAR} ${AC_SEARCH_LIBS_TMP} CACHE INTERNAL "Library containing ${FUNCTION_NAME}") - break() - endif(${AC_SEARCH_LIBS_FOUND}) - endforeach(LIB) endif("${TARGET_VAR}" MATCHES "^${TARGET_VAR}$") endmacro(AC_SEARCH_LIBS) diff --git a/cmake/ConkyPlatformChecks.cmake b/cmake/ConkyPlatformChecks.cmake index 1f2e4bf0..61e87af1 100644 --- a/cmake/ConkyPlatformChecks.cmake +++ b/cmake/ConkyPlatformChecks.cmake @@ -39,9 +39,9 @@ check_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC) check_symbol_exists(statfs64 "sys/statfs.h" HAVE_STATFS64) AC_SEARCH_LIBS(clock_gettime "time.h" CLOCK_GETTIME_LIB "rt") -if(NOT CLOCK_GETTIME_LIB) +if(NOT DEFINED CLOCK_GETTIME_LIB) message(FATAL_ERROR "clock_gettime not found.") -endif(NOT CLOCK_GETTIME_LIB) +endif(NOT DEFINED CLOCK_GETTIME_LIB) set(conky_libs ${conky_libs} ${CLOCK_GETTIME_LIB}) # standard path to search for includes