You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2022/12/09 19:18:03 UTC

[arrow-adbc] branch main updated: feat(c/driver/postgres,c/driver/sqlite): add pkg-config/CMake definitions (#231)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 5682bb4  feat(c/driver/postgres,c/driver/sqlite): add pkg-config/CMake definitions (#231)
5682bb4 is described below

commit 5682bb4852c7dc394950df73eaab1d2ff417c291
Author: David Li <li...@gmail.com>
AuthorDate: Fri Dec 9 14:17:57 2022 -0500

    feat(c/driver/postgres,c/driver/sqlite): add pkg-config/CMake definitions (#231)
    
    Fixes #190.
---
 .../postgres/AdbcDriverPostgresConfig.cmake.in     | 24 ++++++++++++++++++++
 c/driver/postgres/CMakeLists.txt                   |  4 ++++
 c/driver/postgres/adbc-driver-postgres.pc.in       | 26 ++++++++++++++++++++++
 c/driver/sqlite/AdbcDriverSqliteConfig.cmake.in    | 24 ++++++++++++++++++++
 c/driver/sqlite/CMakeLists.txt                     |  4 ++++
 c/driver/sqlite/adbc-driver-sqlite.pc.in           | 26 ++++++++++++++++++++++
 6 files changed, 108 insertions(+)

diff --git a/c/driver/postgres/AdbcDriverPostgresConfig.cmake.in b/c/driver/postgres/AdbcDriverPostgresConfig.cmake.in
new file mode 100644
index 0000000..029eb8e
--- /dev/null
+++ b/c/driver/postgres/AdbcDriverPostgresConfig.cmake.in
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+@PACKAGE_INIT@
+
+set(ADBC_VERSION "@ADBC_VERSION@")
+
+include("${CMAKE_CURRENT_LIST_DIR}/AdbcDriverPostgresTargets.cmake")
+
+check_required_components(AdbcDriverPostgres)
diff --git a/c/driver/postgres/CMakeLists.txt b/c/driver/postgres/CMakeLists.txt
index 15c9712..d1985bb 100644
--- a/c/driver/postgres/CMakeLists.txt
+++ b/c/driver/postgres/CMakeLists.txt
@@ -46,6 +46,10 @@ add_arrow_lib(adbc_driver_postgres
               type.cc
               OUTPUTS
               ADBC_LIBRARIES
+              CMAKE_PACKAGE_NAME
+              AdbcDriverPostgres
+              PKG_CONFIG_NAME
+              adbc-driver-postgres
               SHARED_LINK_FLAGS
               ${ADBC_LINK_FLAGS}
               SHARED_LINK_LIBS
diff --git a/c/driver/postgres/adbc-driver-postgres.pc.in b/c/driver/postgres/adbc-driver-postgres.pc.in
new file mode 100644
index 0000000..51981d4
--- /dev/null
+++ b/c/driver/postgres/adbc-driver-postgres.pc.in
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ADBC_PKG_CONFIG_INCLUDEDIR@
+libdir=@ADBC_PKG_CONFIG_LIBDIR@
+
+Name: Apache Arrow Database Connectivity (ADBC) Postgres driver
+Description: The ADBC Postgres driver provides an ADBC driver for Postgres.
+Version: @ADBC_VERSION@
+Libs: -L${libdir} -ladbc_driver_postgres
+Cflags: -I${includedir}
diff --git a/c/driver/sqlite/AdbcDriverSqliteConfig.cmake.in b/c/driver/sqlite/AdbcDriverSqliteConfig.cmake.in
new file mode 100644
index 0000000..7371cab
--- /dev/null
+++ b/c/driver/sqlite/AdbcDriverSqliteConfig.cmake.in
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+@PACKAGE_INIT@
+
+set(ADBC_VERSION "@ADBC_VERSION@")
+
+include("${CMAKE_CURRENT_LIST_DIR}/AdbcDriverSqliteTargets.cmake")
+
+check_required_components(AdbcDriverSqlite)
diff --git a/c/driver/sqlite/CMakeLists.txt b/c/driver/sqlite/CMakeLists.txt
index 490594c..1b00a70 100644
--- a/c/driver/sqlite/CMakeLists.txt
+++ b/c/driver/sqlite/CMakeLists.txt
@@ -43,6 +43,10 @@ add_arrow_lib(adbc_driver_sqlite
               utils.c
               OUTPUTS
               ADBC_LIBRARIES
+              CMAKE_PACKAGE_NAME
+              AdbcDriverSqlite
+              PKG_CONFIG_NAME
+              adbc-driver-sqlite
               SHARED_LINK_FLAGS
               ${ADBC_LINK_FLAGS}
               SHARED_LINK_LIBS
diff --git a/c/driver/sqlite/adbc-driver-sqlite.pc.in b/c/driver/sqlite/adbc-driver-sqlite.pc.in
new file mode 100644
index 0000000..359e37b
--- /dev/null
+++ b/c/driver/sqlite/adbc-driver-sqlite.pc.in
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ADBC_PKG_CONFIG_INCLUDEDIR@
+libdir=@ADBC_PKG_CONFIG_LIBDIR@
+
+Name: Apache Arrow Database Connectivity (ADBC) SQLite driver
+Description: The ADBC SQLite driver provides an ADBC driver for SQLite.
+Version: @ADBC_VERSION@
+Libs: -L${libdir} -ladbc_driver_sqlite
+Cflags: -I${includedir}