You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ri...@apache.org on 2017/03/13 20:58:09 UTC

[47/50] [abbrv] incubator-madlib git commit: Build: Add error for missing server includedir

Build: Add error for missing server includedir

JIRA: MADLIB-1065

Missing server headers is a common error with new contributors. This
leads to a non-related error with CMake. This commit fixes that by
explicitly asking user to check server includedir.

Closes #102


Project: http://git-wip-us.apache.org/repos/asf/incubator-madlib/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-madlib/commit/b3495c50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-madlib/tree/b3495c50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-madlib/diff/b3495c50

Branch: refs/heads/latest_release
Commit: b3495c50bf491139ac245a21d97963e81892c610
Parents: 7055dce
Author: Rahul Iyer <ri...@apache.org>
Authored: Fri Feb 17 15:50:58 2017 -0800
Committer: Orhan Kislal <ok...@pivotal.io>
Committed: Fri Feb 17 15:50:58 2017 -0800

----------------------------------------------------------------------
 src/ports/postgres/cmake/FindPostgreSQL.cmake | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-madlib/blob/b3495c50/src/ports/postgres/cmake/FindPostgreSQL.cmake
----------------------------------------------------------------------
diff --git a/src/ports/postgres/cmake/FindPostgreSQL.cmake b/src/ports/postgres/cmake/FindPostgreSQL.cmake
index eda277b..0f9663d 100644
--- a/src/ports/postgres/cmake/FindPostgreSQL.cmake
+++ b/src/ports/postgres/cmake/FindPostgreSQL.cmake
@@ -86,7 +86,6 @@ if(${PKG_NAME}_PG_CONFIG)
         OUTPUT_VARIABLE ${PKG_NAME}_SERVER_INCLUDE_DIR
         OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-
     execute_process(COMMAND ${${PKG_NAME}_PG_CONFIG} --includedir
         OUTPUT_VARIABLE ${PKG_NAME}_CLIENT_INCLUDE_DIR
         OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -97,7 +96,7 @@ if(${PKG_NAME}_PG_CONFIG AND ${PKG_NAME}_SERVER_INCLUDE_DIR)
     set(${PKG_NAME}_VERSION_MAJOR 0)
     set(${PKG_NAME}_VERSION_MINOR 0)
     set(${PKG_NAME}_VERSION_PATCH 0)
-    
+
     set(CONFIG_FILE ${${PKG_NAME}_SERVER_INCLUDE_DIR}/pg_config.h)
 
     if(EXISTS ${CONFIG_FILE})
@@ -112,7 +111,6 @@ if(${PKG_NAME}_PG_CONFIG AND ${PKG_NAME}_SERVER_INCLUDE_DIR)
         else(${CMAKE_COMPILER_IS_GNUCC})
             file(READ ${CONFIG_FILE} _PG_CONFIG_HEADER_CONTENTS)
         endif(${CMAKE_COMPILER_IS_GNUCC})
-        
 
 		# Get PACKAGE_NAME
 		if (_PG_CONFIG_HEADER_CONTENTS MATCHES "#define PACKAGE_NAME \".*\"")
@@ -159,6 +157,10 @@ if(${PKG_NAME}_PG_CONFIG AND ${PKG_NAME}_SERVER_INCLUDE_DIR)
 			endif(_PG_CONFIG_HEADER_CONTENTS MATCHES "#define ${_PG_CONFIG_VERSION_MACRO} ([0-9]+).*")
 
         endif(${PKG_NAME}_VERSION_NUM MATCHES "^[0-9]+$")
+    else(EXISTS ${CONFIG_FILE})
+        message(FATAL_ERROR "Found pg_config (\"${${PKG_NAME}_PG_CONFIG}\"), "
+              "but pg_config.h file not present in the "
+              "server include dir (${${PKG_NAME}_SERVER_INCLUDE_DIR}).")
     endif(EXISTS ${CONFIG_FILE})
 
     if(_PACKAGE_NAME STREQUAL "${_NEEDED_PG_CONFIG_PACKAGE_NAME}")