diff --git a/cmake/ConkyPlatformChecks.cmake b/cmake/ConkyPlatformChecks.cmake index 05d8bbd9..f19ac24c 100644 --- a/cmake/ConkyPlatformChecks.cmake +++ b/cmake/ConkyPlatformChecks.cmake @@ -119,12 +119,12 @@ if(BUILD_HTTP) endif(BUILD_HTTP) if(BUILD_NCURSES) - check_include_files(ncurses.h NCURSES_H) - find_library(NCURSES_LIB NAMES ncurses) - if(NOT NCURSES_H OR NOT NCURSES_LIB) + pkg_check_modules(NCURSES ncurses) + if(NOT NCURSES_FOUND) message(FATAL_ERROR "Unable to find ncurses library") - endif(NOT NCURSES_H OR NOT NCURSES_LIB) - set(conky_libs ${conky_libs} ${NCURSES_LIB}) + endif(NOT NCURSES_FOUND) + set(conky_libs ${conky_libs} ${NCURSES_LIBRARIES}) + set(conky_includes ${conky_includes} ${NCURSES_INCLUDE_DIRS}) endif(BUILD_NCURSES) if(BUILD_MYSQL)