From 3182dfb02123ffe5708ea2dd232afa4701f11ddc Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Thu, 21 Mar 2019 19:53:37 +0000 Subject: Build: automatically enable system error messages Define HAVE_STRERROR during configuration. Before: $ cs2cs +proj=latlong +to +proj=latlong dummy : Sys errno: 2: dummy After: $ cs2cs +proj=latlong +to +proj=latlong dummy : Sys errno: 2: No such file or directory dummy --- cmake/ProjConfig.cmake | 3 ++- cmake/proj_config.cmake.in | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/ProjConfig.cmake b/cmake/ProjConfig.cmake index ada827ea..cd5a635e 100644 --- a/cmake/ProjConfig.cmake +++ b/cmake/ProjConfig.cmake @@ -24,7 +24,8 @@ check_include_files (sys/types.h HAVE_SYS_TYPES_H) check_include_files (unistd.h HAVE_UNISTD_H) check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) -CHECK_FUNCTION_EXISTS(localeconv HAVE_LOCALECONV) +check_function_exists(localeconv HAVE_LOCALECONV) +check_function_exists(strerror HAVE_STRERROR) # check libm need on unix check_library_exists(m ceil "" HAVE_LIBM) diff --git a/cmake/proj_config.cmake.in b/cmake/proj_config.cmake.in index bbdf3249..caeb0934 100644 --- a/cmake/proj_config.cmake.in +++ b/cmake/proj_config.cmake.in @@ -22,6 +22,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H 1 +/* Define to 1 if you have the `strerror' function. */ +#cmakedefine HAVE_STRERROR 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H 1 -- cgit v1.2.3