]> granicus.if.org Git - fortune-mod/commitdiff
Fix check for recode.h.
authorShlomi Fish <shlomif@shlomifish.org>
Tue, 23 May 2017 08:20:07 +0000 (11:20 +0300)
committerShlomi Fish <shlomif@shlomifish.org>
Tue, 23 May 2017 08:20:07 +0000 (11:20 +0300)
See https://github.com/shlomif/fortune-mod/issues/9 . It previously
didn't detect it properly which caused a problem in compile-time.

fortune-mod/CMakeLists.txt

index 3789c39877be82457ee08d0e3d23f8d83a597e29..643e18307e5e2b5d4fc443d1e07a9d6e0b798001 100644 (file)
@@ -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}")