Fix FindLibuhttpd

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
main
Jianhui Zhao 2018-01-23 10:29:17 +08:00
parent 43801ddfd6
commit e6f0c01918
1 changed files with 2 additions and 2 deletions

View File

@ -8,9 +8,9 @@ find_path(LIBUHTTPD_INCLUDE_DIR uhttpd)
find_library(LIBUHTTPD_LIBRARY uhttpd PATH_SUFFIXES lib64)
if(LIBUHTTPD_INCLUDE_DIR)
file(STRINGS "${LIBUHTTPD_INCLUDE_DIR}/uhttpd/uhttpd.h"
file(STRINGS "${LIBUHTTPD_INCLUDE_DIR}/uhttpd/config.h"
LIBUHTTPD_VERSION_MAJOR REGEX "^#define[ \t]+UHTTPD_VERSION_MAJOR[ \t]+[0-9]+")
file(STRINGS "${LIBUHTTPD_INCLUDE_DIR}/uhttpd/uhttpd.h"
file(STRINGS "${LIBUHTTPD_INCLUDE_DIR}/uhttpd/config.h"
LIBUHTTPD_VERSION_MINOR REGEX "^#define[ \t]+UHTTPD_VERSION_MINOR[ \t]+[0-9]+")
string(REGEX REPLACE "[^0-9]+" "" LIBUHTTPD_VERSION_MAJOR "${LIBUHTTPD_VERSION_MAJOR}")
string(REGEX REPLACE "[^0-9]+" "" LIBUHTTPD_VERSION_MINOR "${LIBUHTTPD_VERSION_MINOR}")