From: Shlomi Fish Date: Tue, 23 May 2017 08:20:07 +0000 (+0300) Subject: Fix check for recode.h. X-Git-Tag: fortune-mod-2.0.0~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77c4394f12eb745d6262b1eb908918d35155ebf8;p=fortune-mod Fix check for recode.h. See https://github.com/shlomif/fortune-mod/issues/9 . It previously didn't detect it properly which caused a problem in compile-time. --- diff --git a/fortune-mod/CMakeLists.txt b/fortune-mod/CMakeLists.txt index 3789c39..643e183 100644 --- a/fortune-mod/CMakeLists.txt +++ b/fortune-mod/CMakeLists.txt @@ -94,7 +94,12 @@ SET (OCOOKIEDIR "${COOKIEDIR}/off" CACHE STRING "offensive cookie dir not under SHLOMIF_ADD_COMMON_C_FLAGS() -FIND_PATH( RECODE_H "recode.h") +INCLUDE(CheckIncludeFile) +SET(_r "stdbool.h" "stdio.h" "recode.h") +CHECK_INCLUDE_FILES("${_r}" HAVE_RECODE_H) +IF (NOT "${HAVE_RECODE_H}") + MESSAGE(FATAL_ERROR "Cannot find recode.h anywhere - please install lib recode") +ENDIF () MACRO(my_exe exe c_file dir) ADD_EXECUTABLE("${exe}" "${c_file}") @@ -159,7 +164,6 @@ IF ("${NO_OFFENSIVE}") ADD_DEFINITIONS("-DNO_OFFENSIVE=1") ENDIF() -INCLUDE(CheckIncludeFile) CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) IF ("${HAVE_REGEX_H}")