WIP on support for CMake builds, fails to build tests (probably error in FindCheck not declaring dependency on pthread)
This commit is contained in:
parent
59d182b1c1
commit
a2396fe15b
8 changed files with 132 additions and 11 deletions
|
@ -6,19 +6,51 @@
|
|||
# cmake clean... orz
|
||||
# http://stackoverflow.com/questions/9680420/looking-for-a-cmake-clean-command-to-clear-up-cmake-output
|
||||
|
||||
# load required modules
|
||||
include(CheckIncludeFile)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckTypeSize)
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(r3)
|
||||
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(r3 VERSION 2.0.0)
|
||||
|
||||
SET(CMAKE_MODULE_PATH
|
||||
${PROJECT_SOURCE_DIR}/cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules
|
||||
${CMAKE_MODULE_PATH}
|
||||
)
|
||||
)
|
||||
|
||||
include_directories(. ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/3rdparty /opt/local/include)
|
||||
# include_directories(. ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/3rdparty ${PROJECT_SOURCE_DIR})
|
||||
# check for availability of certain headers
|
||||
CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
|
||||
CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
|
||||
CHECK_INCLUDE_FILE(jemalloc/jemalloc.h HAVE_JEMALLOC_JEMALLOC_H)
|
||||
CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
|
||||
CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
|
||||
CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
|
||||
CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
|
||||
CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
|
||||
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H)
|
||||
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
|
||||
|
||||
link_directories(${LINK_DIRECTORIES} /opt/local/lib)
|
||||
# check availability of certain system functions
|
||||
CHECK_SYMBOL_EXISTS("gettimeofday" "sys/time.h" HAVE_GETTIMEOFDAY)
|
||||
CHECK_SYMBOL_EXISTS("memset" "string.h" HAVE_MEMSET)
|
||||
CHECK_SYMBOL_EXISTS("strchr" "string.h" HAVE_STRCHR)
|
||||
CHECK_SYMBOL_EXISTS("strdup" "string.h" HAVE_STRDUP)
|
||||
CHECK_SYMBOL_EXISTS("strndup" "string.h" HAVE_STRNDUP)
|
||||
CHECK_SYMBOL_EXISTS("strnstr" "string.h" HAVE_STRNSTR)
|
||||
CHECK_SYMBOL_EXISTS("strstr" "string.h" HAVE_STRSTR)
|
||||
|
||||
# check availability of certain types
|
||||
CHECK_TYPE_SIZE(_Bool _BOOL)
|
||||
|
||||
# generate the configuration file
|
||||
configure_file("${PROJECT_SOURCE_DIR}/config.h.cmake" "${PROJECT_BINARY_DIR}/config.h")
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/3rdparty ${PROJECT_BINARY_DIR})
|
||||
|
||||
# link_directories(${LINK_DIRECTORIES} /opt/local/lib)
|
||||
find_package(PCRE REQUIRED)
|
||||
# find_package(Judy REQUIRED)
|
||||
|
||||
|
|
91
config.h.cmake
Normal file
91
config.h.cmake
Normal file
|
@ -0,0 +1,91 @@
|
|||
#cmakedefine HAVE_DLFCN_H @HAVE_STDLIB_H@
|
||||
#cmakedefine HAVE_GETTIMEOFDAY @HAVE_GETTIMEOFDAY@
|
||||
#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@
|
||||
#cmakedefine HAVE_JEMALLOC_JEMALLOC_H @HAVE_JEMALLOC_JEMALLOC_H@
|
||||
#cmakedefine HAVE_MEMORY_H @HAVE_MEMORY_H@
|
||||
#cmakedefine HAVE_MEMSET @HAVE_MEMSET@
|
||||
#cmakedefine HAVE_STDBOOL_H @HAVE_STDBOOL_H@
|
||||
#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
|
||||
#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
|
||||
#cmakedefine HAVE_STRCHR @HAVE_STRCHR@
|
||||
#cmakedefine HAVE_STRDUP @HAVE_STRDUP@
|
||||
#cmakedefine HAVE_STRINGS_H @HAVE_STRINGS_H@
|
||||
#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
|
||||
#cmakedefine HAVE_STRNDUP @HAVE_STRNDUP@
|
||||
#cmakedefine HAVE_STRSTR @HAVE_STRSTR@
|
||||
#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@
|
||||
#cmakedefine HAVE_SYS_TIME_H @HAVE_SYS_TIME_H@
|
||||
#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@
|
||||
#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
|
||||
#cmakedefine HAVE__BOOL @HAVE__BOOL@
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "@PROJECT_NAME@"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "@PROJECT_NAME@"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "@PROJECT_NAME@ @PROJECT_VERSION@"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "@PROJECT_NAME@"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "@PROJECT_VERSION@"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you have the PATH_MAX macro. */
|
||||
/* #undef USE_JEMALLOC */
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# define _ALL_SOURCE 1
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# define _POSIX_PTHREAD_SEMANTICS 1
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# define _TANDEM_SOURCE 1
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# define __EXTENSIONS__ 1
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "@PROJECT_VERSION@"
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
/* #undef inline */
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
|
@ -1,4 +1,4 @@
|
|||
AC_INIT([r3], 1.3.3)
|
||||
AC_INIT([r3], 2.0.0)
|
||||
AC_PREREQ([2.64])
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
@ -23,8 +23,6 @@ AC_C_INLINE
|
|||
AC_TYPE_SIZE_T
|
||||
|
||||
# Checks for library functions.
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_CHECK_FUNCS([gettimeofday memset strchr strdup strndup strstr])
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "r3",
|
||||
"version": "1.3.3",
|
||||
"version": "2.0.0",
|
||||
"repo": "brendanashworth/r3",
|
||||
"description": "high-performance path dispatching library",
|
||||
"keywords": ["path", "dispatch", "performance", "r3", "c9s"],
|
||||
|
|
Loading…
Reference in a new issue