mirror of
https://github.com/pgpointcloud/pointcloud.git
synced 2025-12-08 20:36:04 +00:00
Support missing CUnit
This commit is contained in:
parent
af0e262701
commit
d0e39ac27b
@ -79,7 +79,9 @@ exec_program(${PG_CONFIG} ARGS --includedir-server
|
||||
exec_program(${PG_CONFIG} ARGS --pkglibdir OUTPUT_VARIABLE PGSQL_PKGLIBDIR)
|
||||
exec_program(${PG_CONFIG} ARGS --sharedir OUTPUT_VARIABLE PGSQL_SHAREDIR)
|
||||
exec_program(${PG_CONFIG} ARGS --bindir OUTPUT_VARIABLE PGSQL_BINDIR)
|
||||
|
||||
exec_program(${PG_CONFIG} ARGS --cppflags OUTPUT_VARIABLE PGSQL_CPPFLAGS)
|
||||
exec_program(${PG_CONFIG} ARGS --ldflags OUTPUT_VARIABLE PGSQL_LDFLAGS)
|
||||
exec_program(${PG_CONFIG} ARGS --libs OUTPUT_VARIABLE PGSQL_LIBS)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# libxml2
|
||||
@ -117,7 +119,6 @@ if (NOT DEFINED LIB_INSTALL_DIR)
|
||||
set (LIB_INSTALL_DIR lib)
|
||||
endif()
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# generate config include
|
||||
|
||||
|
||||
57
configure.ac
57
configure.ac
@ -58,21 +58,65 @@ dnl ===========================================================================
|
||||
dnl Detect CUnit if it is installed
|
||||
dnl ===========================================================================
|
||||
|
||||
CUNIT_LDFLAGS=""
|
||||
AC_ARG_WITH([cunit],
|
||||
[AS_HELP_STRING([--with-cunit=DIR], [specify the base cunit install directory])],
|
||||
[CUNITDIR="$withval"], [CUNITDIR=""])
|
||||
|
||||
if test "x$CUNITDIR" = "xyes"; then
|
||||
AC_MSG_ERROR([you must specify a prefix directory to --with-cunit, e.g. --with-cunit=/opt/local])
|
||||
fi
|
||||
|
||||
if test "x$CUNITDIR" != "x"; then
|
||||
|
||||
dnl CUNITDIR was specified, so let's look there!
|
||||
|
||||
dnl Build the linker and include flags
|
||||
CUNIT_LDFLAGS="-L${CUNITDIR}/lib"
|
||||
CUNIT_CPPFLAGS="-I${CUNITDIR}/include"
|
||||
|
||||
dnl Swap to use provided cflags
|
||||
CPPFLAGS_SAVE="$CPPFLAGS"
|
||||
CPPFLAGS="$CUNIT_CPPFLAGS"
|
||||
|
||||
dnl Swap to use provided ldflags
|
||||
LDFLAGS_SAVE="$LDFLAGS"
|
||||
LDFLAGS="$CUNIT_LDFLAGS"
|
||||
|
||||
fi
|
||||
|
||||
dnl Run the header/link tests
|
||||
AC_CHECK_HEADER([CUnit/CUnit.h], [
|
||||
CUNIT_CPPFLAGS="$CPPFLAGS"
|
||||
AC_CHECK_LIB([cunit],
|
||||
[CU_initialize_registry],
|
||||
[CUNIT_LDFLAGS="$LDFLAGS -lcunit"],
|
||||
[AC_MSG_RESULT([notice C unit tests will not be run])]
|
||||
[CUNIT_LDFLAGS="$LDFLAGS -lcunit" FOUND_CUNIT="YES"],
|
||||
[FOUND_CUNIT="NO"]
|
||||
)
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([notice C unit tests will not be run])
|
||||
FOUND_CUNIT="NO"
|
||||
])
|
||||
|
||||
AC_SUBST([CUNIT_CPPFLAGS])
|
||||
|
||||
if test "x$CUNITDIR" != "x"; then
|
||||
dnl Swap back to the original flags
|
||||
LDFLAGS="${LDFLAGS_SAVE}"
|
||||
CPPFLAGS="${CPPFLAGS_SAVE}"
|
||||
fi
|
||||
|
||||
if test "$FOUND_CUNIT" = "YES"; then
|
||||
AC_DEFINE([HAVE_CUNIT])
|
||||
CUNIT_STATUS="enabled"
|
||||
if test $CUNITDIR; then
|
||||
CUNIT_STATUS="$CUNITDIR"
|
||||
fi
|
||||
else
|
||||
CUNIT_LDFLAGS=""
|
||||
CUNIT_CPPFLAGS=""
|
||||
CUNIT_STATUS="disabled"
|
||||
fi
|
||||
|
||||
AC_SUBST([CUNIT_LDFLAGS])
|
||||
AC_SUBST([CUNIT_CPPFLAGS])
|
||||
|
||||
|
||||
dnl ===========================================================================
|
||||
@ -306,4 +350,5 @@ AC_MSG_RESULT([ PostgreSQL version: ${PGSQL_FULL_VERSION}])
|
||||
AC_MSG_RESULT([ Libxml2 config: ${XML2CONFIG}])
|
||||
AC_MSG_RESULT([ Libxml2 version: ${LIBXML2_VERSION}])
|
||||
AC_MSG_RESULT([ LibGHT status: ${GHT_STATUS}])
|
||||
AC_MSG_RESULT([ CUnit status: ${CUNIT_STATUS}])
|
||||
AC_MSG_RESULT()
|
||||
|
||||
@ -280,11 +280,12 @@ PCBITMAP* pc_bitmap_new(uint32_t npoints);
|
||||
void pc_bitmap_free(PCBITMAP *map);
|
||||
/** Set the indicated bit to true if val!=0 otherwise false */
|
||||
extern inline void pc_bitmap_set(PCBITMAP *map, int i, int val);
|
||||
/** Read indicated bit of bitmap */
|
||||
extern inline uint8_t pc_bitmap_get(const PCBITMAP *map, int i);
|
||||
/** Set indicated bit on bitmap if filter and value are consistent */
|
||||
void pc_bitmap_filter(PCBITMAP *map, PC_FILTERTYPE filter, int i, double d, double val1, double val2);
|
||||
|
||||
/** Read indicated bit of bitmap */
|
||||
#define pc_bitmap_get(map, i) ((map)->map[(i)])
|
||||
|
||||
|
||||
|
||||
#endif /* _PC_API_INTERNAL_H */
|
||||
|
||||
@ -4,4 +4,6 @@
|
||||
|
||||
#cmakedefine HAVE_LIBGHT ${HAVE_LIBGHT}
|
||||
|
||||
#cmakedefine HAVE_CUNIT ${HAVE_CUNIT}
|
||||
|
||||
#cmakedefine PROJECT_SOURCE_DIR "${PROJECT_SOURCE_DIR}"
|
||||
|
||||
@ -4,5 +4,7 @@
|
||||
|
||||
#undef HAVE_LIBGHT
|
||||
|
||||
#undef HAVE_CUNIT
|
||||
|
||||
#undef PROJECT_SOURCE_DIR
|
||||
|
||||
|
||||
@ -41,12 +41,6 @@ pc_bitmap_set(PCBITMAP *map, int i, int val)
|
||||
map->map[i] = (val!=0);
|
||||
}
|
||||
|
||||
inline uint8_t
|
||||
pc_bitmap_get(const PCBITMAP *map, int i)
|
||||
{
|
||||
return map->map[i];
|
||||
}
|
||||
|
||||
void
|
||||
pc_bitmap_filter(PCBITMAP *map, PC_FILTERTYPE filter, int i, double d, double val1, double val2)
|
||||
{
|
||||
|
||||
@ -14,7 +14,9 @@ set ( PC_INSTALL_EXENSIONS
|
||||
pointcloud--1.0.sql
|
||||
pointcloud.control
|
||||
)
|
||||
|
||||
|
||||
set(CMAKE_C_FLAGS "${PGSQL_CPPFLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${PGSQL_LDFLAGS}")
|
||||
|
||||
include_directories ("${PGSQL_INCLUDEDIR_SERVER}")
|
||||
include_directories ("${PROJECT_SOURCE_DIR}/lib")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user