forked from PocketRent/hhvm-pgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.cmake
25 lines (18 loc) · 861 Bytes
/
config.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Find include directory
FIND_PATH(PGSQL_INCLUDE_DIR NAMES libpq-fe.h
PATHS /usr/include /usr/include/postgresql /usr/local/include /usr/local/include/postgresql /usr/include/pgsql)
FIND_LIBRARY(PGSQL_LIBRARY NAMES pq PATHS /lib /usr/lib /usr/local/lib)
IF (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY)
MESSAGE(STATUS "pgSQL Include dir: ${PGSQL_INCLUDE_DIR}")
MESSAGE(STATUS "libpq library: ${PGSQL_LIBRARY}")
ELSE()
MESSAGE(FATAL_ERROR "Cannot find libpq library")
ENDIF()
option(HACK_FRIENDLY "Alters the API to make it work better with the Hack typechecker")
if (HACK_FRIENDLY)
add_definitions(-DHACK_FRIENDLY)
endif()
include_directories(${PGSQL_INCLUDE_DIR})
HHVM_EXTENSION(pgsql pgsql.cpp pdo_pgsql_statement.cpp pdo_pgsql_connection.cpp pdo_pgsql.cpp)
HHVM_SYSTEMLIB(pgsql ext_pgsql.php)
target_link_libraries(pgsql ${PGSQL_LIBRARY})