mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-22 10:37:10 +01:00
[libpqxx] Initial port
This commit is contained in:
parent
e48a655df0
commit
a0d09ae1fb
68
ports/libpqxx/CMakeLists.txt
Normal file
68
ports/libpqxx/CMakeLists.txt
Normal file
@ -0,0 +1,68 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(libpqxx VERSION 6.0.0 LANGUAGES CXX)
|
||||
set(CMAKE_DEBUG_POSTFIX "D")
|
||||
|
||||
find_library(LIBPQD libpqd)
|
||||
find_library(LIBPQ libpq)
|
||||
find_path(LIBPQ_FE_H libpq-fe.h)
|
||||
find_path(POSTGRES_EXT_H postgres_ext.h)
|
||||
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
check_include_file_cxx(poll.h HAVE_POLL)
|
||||
check_include_file_cxx(sys/select.h HAVE_SYS_SELECT_H)
|
||||
check_include_file_cxx(sys/time.h HAVE_SYS_TIME_H)
|
||||
check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file_cxx(unistd.h HAVE_UNISTD_H)
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
check_cxx_source_compiles("[[deprecated]] void f();
|
||||
int main() { return 0; }" PQXX_HAVE_DEPRECATED)
|
||||
check_cxx_source_compiles("#include <optional>
|
||||
int main() { return std::optional<int>(0).value(); }" PQXX_HAVE_OPTIONAL)
|
||||
check_cxx_source_compiles("#include <experimental/optional>
|
||||
int main() { return std::experimental::optional<int>(0).value(); }" PQXX_HAVE_EXP_OPTIONAL)
|
||||
|
||||
configure_file(config-internal-compiler.h.in pqxx/config-internal-compiler.h)
|
||||
configure_file(config-public-compiler.h.in pqxx/config-public-compiler.h)
|
||||
|
||||
file(GLOB SRCS "${PROJECT_SOURCE_DIR}/src/*.cxx")
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(TARGET libpqxx)
|
||||
set(SHARED_DEFINITION -DPQXX_SHARED)
|
||||
list(APPEND SRCS "${PROJECT_SOURCE_DIR}/win32/libpqxx.cxx")
|
||||
else()
|
||||
set(TARGET libpqxx_static)
|
||||
set(SHARED_DEFINITION "")
|
||||
endif()
|
||||
|
||||
add_library(${TARGET} ${SRCS})
|
||||
target_compile_definitions(${TARGET} PRIVATE -DPQXX_INTERNAL -DNOMINMAX ${SHARED_DEFINITION})
|
||||
target_include_directories(${TARGET} PRIVATE include ${LIBPQ_FE_H} ${POSTGRES_EXT_H} ${CMAKE_BINARY_DIR})
|
||||
target_link_libraries(${TARGET} PRIVATE ws2_32)
|
||||
if(LIBPQD AND LIBPQ)
|
||||
target_link_libraries(${TARGET} PRIVATE debug ${LIBPQD} optimized ${LIBPQ})
|
||||
elseif(LIBPQD)
|
||||
target_link_libraries(${TARGET} PRIVATE ${LIBPQD})
|
||||
else()
|
||||
target_link_libraries(${TARGET} PRIVATE ${LIBPQ})
|
||||
endif()
|
||||
|
||||
install(TARGETS ${TARGET}
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
install(DIRECTORY include/ DESTINATION include
|
||||
CONFIGURATIONS Release
|
||||
PATTERN "doc" EXCLUDE
|
||||
PATTERN "*.am" EXCLUDE
|
||||
PATTERN "*.in" EXCLUDE
|
||||
PATTERN "*.template" EXCLUDE
|
||||
)
|
||||
install(DIRECTORY ${CMAKE_BINARY_DIR}/pqxx/ DESTINATION include/pqxx
|
||||
CONFIGURATIONS Release
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
)
|
4
ports/libpqxx/CONTROL
Normal file
4
ports/libpqxx/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: libpqxx
|
||||
Version: 6.0.0
|
||||
Description: The official C++ client API for PostgreSQL
|
||||
Build-Depends: libpq
|
14
ports/libpqxx/config-internal-compiler.h.in
Normal file
14
ports/libpqxx/config-internal-compiler.h.in
Normal file
@ -0,0 +1,14 @@
|
||||
/* System supports poll(). */
|
||||
#cmakedefine HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
8
ports/libpqxx/config-public-compiler.h.in
Normal file
8
ports/libpqxx/config-public-compiler.h.in
Normal file
@ -0,0 +1,8 @@
|
||||
/* Define if compiler supports [[deprecated]] attribute */
|
||||
#cmakedefine PQXX_HAVE_DEPRECATED 1
|
||||
|
||||
/* Define if the compiler supports std::experimental::optional. */
|
||||
#cmakedefine PQXX_HAVE_EXP_OPTIONAL 1
|
||||
|
||||
/* Define if the compiler supports std::optional. */
|
||||
#cmakedefine PQXX_HAVE_OPTIONAL 1
|
23
ports/libpqxx/portfile.cmake
Normal file
23
ports/libpqxx/portfile.cmake
Normal file
@ -0,0 +1,23 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO jtv/libpqxx
|
||||
REF 6.0.0
|
||||
SHA512 f237cc03c01a8262eee44a9428206c1cc11b6034dddf540afef145f58eee5c32b880d84832563480d73d834c24311170e2ef6789e100793afbe0b6e393bd4169
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/config-public-compiler.h.in DESTINATION ${SOURCE_PATH})
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/config-internal-compiler.h.in DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libpqxx RENAME copyright)
|
Loading…
x
Reference in New Issue
Block a user