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

isapego pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 0a16561050b IGNITE-27579 C++ Client: Use CPack to generate 
installation packages (#7487)
0a16561050b is described below

commit 0a16561050b9a4bde0fc821f8cbafe6cd2e8bcaa
Author: Dmitriy Zabotlin <[email protected]>
AuthorDate: Wed Jan 28 18:17:29 2026 +0200

    IGNITE-27579 C++ Client: Use CPack to generate installation packages (#7487)
    
    Co-authored-by: dzabotlin <[email protected]>
---
 modules/platforms/cpp/CMakeLists.txt               |  10 +-
 modules/platforms/cpp/LICENSE                      | 202 +++++++++++++++++++++
 .../cpp/cmake/ignite_install_headers.cmake         |   6 +-
 modules/platforms/cpp/cmake/packaging.cmake        | 109 +++++++++++
 .../cmake/scripts/odbc/ignite3-odbc-linux.ini.in   |   5 +
 .../scripts/odbc/post_install.sh.in}               |  17 +-
 .../scripts/odbc/pre_uninstall.sh.in}              |  15 +-
 modules/platforms/cpp/ignite/client/CMakeLists.txt |   7 +-
 modules/platforms/cpp/ignite/common/CMakeLists.txt |   6 +-
 .../platforms/cpp/ignite/network/CMakeLists.txt    |   4 +-
 modules/platforms/cpp/ignite/odbc/CMakeLists.txt   |   7 +-
 .../platforms/cpp/ignite/protocol/CMakeLists.txt   |   4 +-
 modules/platforms/cpp/ignite/tuple/CMakeLists.txt  |   6 +-
 .../platforms/cpp/tests/client-test/CMakeLists.txt |   4 +-
 .../platforms/cpp/tests/fake_server/CMakeLists.txt |   4 +-
 .../platforms/cpp/tests/odbc-test/CMakeLists.txt   |   4 +-
 .../platforms/cpp/tests/test-common/CMakeLists.txt |   4 +-
 17 files changed, 349 insertions(+), 65 deletions(-)

diff --git a/modules/platforms/cpp/CMakeLists.txt 
b/modules/platforms/cpp/CMakeLists.txt
index 49a44e20561..de12bd97977 100644
--- a/modules/platforms/cpp/CMakeLists.txt
+++ b/modules/platforms/cpp/CMakeLists.txt
@@ -25,7 +25,7 @@ if(NOT DEFINED IGNITE_VERSION)
   message(WARNING "Failed to read version from _version.txt file. Using 
default version \"${IGNITE_VERSION}\".")
 endif()
 
-project(Ignite.C++ VERSION ${IGNITE_VERSION} LANGUAGES CXX)
+project(ignite3 VERSION ${IGNITE_VERSION} LANGUAGES CXX)
 
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -85,9 +85,10 @@ else()
 endif()
 
 set(IGNITE_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/ignite)
-if(${INSTALL_IGNITE_FILES})
-    message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
-endif()
+
+include(cmake/packaging.cmake)
+include(CPack)
+
 message(STATUS "IGNITE_INCLUDEDIR=${IGNITE_INCLUDEDIR}")
 include(ignite_install_headers)
 
@@ -216,6 +217,7 @@ write_basic_package_version_file(
 install(FILES
     "${CMAKE_CURRENT_BINARY_DIR}/cmake/ignite-config.cmake"
     "${CMAKE_CURRENT_BINARY_DIR}/cmake/ignite-config-version.cmake"
+    COMPONENT client
     DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ignite"
 )
 
diff --git a/modules/platforms/cpp/LICENSE b/modules/platforms/cpp/LICENSE
new file mode 100644
index 00000000000..d6456956733
--- /dev/null
+++ b/modules/platforms/cpp/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
diff --git a/modules/platforms/cpp/cmake/ignite_install_headers.cmake 
b/modules/platforms/cpp/cmake/ignite_install_headers.cmake
index 188930de3dc..9435714c156 100644
--- a/modules/platforms/cpp/cmake/ignite_install_headers.cmake
+++ b/modules/platforms/cpp/cmake/ignite_install_headers.cmake
@@ -15,14 +15,14 @@
 # limitations under the License.
 #
 
-# ignite_install_headers(FILES <header>... DESTINATION <dest>)
+# ignite_install_headers(FILES <header>... DESTINATION <dest> COMPONENT 
<component>)
 #
 # Function to install header files.
 function(ignite_install_headers)
-    cmake_parse_arguments(IGNITE_INSTALL "" "DESTINATION" "FILES" ${ARGN})
+    cmake_parse_arguments(IGNITE_INSTALL "" "DESTINATION" "FILES;COMPONENT" 
${ARGN})
 
     foreach(HEADER ${IGNITE_INSTALL_FILES})
         get_filename_component(SUBDIR ${HEADER} DIRECTORY)
-        install(FILES ${HEADER} DESTINATION 
${IGNITE_INSTALL_DESTINATION}/${SUBDIR} COMPONENT Development)
+        install(FILES ${HEADER} DESTINATION 
${IGNITE_INSTALL_DESTINATION}/${SUBDIR} COMPONENT ${IGNITE_INSTALL_COMPONENT})
     endforeach()
 endfunction()
diff --git a/modules/platforms/cpp/cmake/packaging.cmake 
b/modules/platforms/cpp/cmake/packaging.cmake
new file mode 100644
index 00000000000..d8733ba230b
--- /dev/null
+++ b/modules/platforms/cpp/cmake/packaging.cmake
@@ -0,0 +1,109 @@
+#
+# 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.
+#
+
+set(CPACK_PACKAGE_NAME ignite3)
+
+if(ENABLE_ADDRESS_SANITIZER)
+    set(CPACK_PACKAGE_NAME ${CPACK_PACKAGE_NAME}-asan)
+endif()
+
+if(ENABLE_UB_SANITIZER)
+    set(CPACK_PACKAGE_NAME ${CPACK_PACKAGE_NAME}-ubsan)
+endif()
+
+set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
+set(PACKAGE_SO_PATH 
"${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+set(IGNITE_ODBC_INI_PATH 
"${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/ignite")
+
+set(CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION ON)
+
+set(CPACK_COMPONENTS_ALL client odbc)
+
+set(CPACK_PACKAGE_VENDOR "Apache Software Foundation")
+
+set(CPACK_VERBATIM_VARIABLES YES)
+
+set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
+set(CPACK_OUTPUT_FILE_PREFIX "_packages")
+
+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+
+set(CPACK_PACKAGE_CONTACT "[email protected]")
+set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Apache Software Foundation")
+
+set(CPACK_RESOURCE_FILE_LICENSE "${IGNITE_CMAKE_TOP_DIR}/LICENSE")
+
+set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
+set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
+set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
+set(CPACK_DEB_COMPONENT_INSTALL ON)
+set(CPACK_RPM_COMPONENT_INSTALL ON)
+
+set(CPACK_ARCHIVE_COMPONENT_INSTALL 1)
+set(CPACK_TGZ_COMPONENT_INSTALL ON)
+
+set(ODBC_SCRIPT_DIR "${IGNITE_CMAKE_TOP_DIR}/cmake/scripts/odbc")
+
+#configure_file can set permissions as well, but it will raise required cmake 
version to 3.20
+configure_file("${ODBC_SCRIPT_DIR}/post_install.sh.in"  
"${CMAKE_CURRENT_BINARY_DIR}/postinst" @ONLY)
+configure_file("${ODBC_SCRIPT_DIR}/pre_uninstall.sh.in" 
"${CMAKE_CURRENT_BINARY_DIR}/prerm" @ONLY)
+
+configure_file("${ODBC_SCRIPT_DIR}/post_install.sh.in"  
"${CMAKE_CURRENT_BINARY_DIR}/post_install.sh" @ONLY)
+configure_file("${ODBC_SCRIPT_DIR}/pre_uninstall.sh.in" 
"${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh" @ONLY)
+
+set(SCRIPTS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/scripts/")
+
+file(MAKE_DIRECTORY ${SCRIPTS_BINARY_DIR})
+
+file(COPY
+    "${CMAKE_CURRENT_BINARY_DIR}/post_install.sh"
+    "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh"
+    "${CMAKE_CURRENT_BINARY_DIR}/postinst"
+    "${CMAKE_CURRENT_BINARY_DIR}/prerm"
+    DESTINATION "${SCRIPTS_BINARY_DIR}"
+    FILE_PERMISSIONS
+    OWNER_READ OWNER_WRITE OWNER_EXECUTE
+    GROUP_READ GROUP_EXECUTE
+    WORLD_READ WORLD_EXECUTE
+)
+
+set(CPACK_DEBIAN_ODBC_PACKAGE_CONTROL_EXTRA 
"${SCRIPTS_BINARY_DIR}/postinst;${SCRIPTS_BINARY_DIR}/prerm")
+set(CPACK_DEBIAN_ODBC_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
+
+set(CPACK_DEBIAN_CLIENT_PACKAGE_DEPENDS libc6 libstdc++6)
+set(CPACK_DEBIAN_ODBC_PACKAGE_DEPENDS unixodbc odbcinst libc6 libstdc++6)
+
+set(CPACK_RPM_ODBC_POST_INSTALL_SCRIPT_FILE  
"${SCRIPTS_BINARY_DIR}/post_install.sh")
+set(CPACK_RPM_ODBC_PRE_UNINSTALL_SCRIPT_FILE 
"${SCRIPTS_BINARY_DIR}/pre_uninstall.sh")
+
+set(CPACK_RPM_CLIENT_PACKAGE_DEPENDS libc6 libstdc++6)
+set(CPACK_RPM_ODBC_PACKAGE_DEPENDS unixODBC libc6 libstdc++6)
+
+configure_file("${ODBC_SCRIPT_DIR}/ignite3-odbc-linux.ini.in" 
"${CMAKE_CURRENT_BINARY_DIR}/ignite3-odbc-linux.ini")
+
+install(FILES
+    "${CMAKE_CURRENT_BINARY_DIR}/ignite3-odbc-linux.ini"
+    COMPONENT odbc
+    DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ignite/"
+    RENAME "ignite3-odbc.ini"
+)
+
+set(CPACK_COMPONENT_CLIENT_DESCRIPTION "Apache Ignite 3 client library for 
C++")
+set(CPACK_COMPONENT_ODBC_DESCRIPTION "Apache Ignite 3 ODBC driver")
+set(CPACK_PACKAGE_CHECKSUM "SHA256")
diff --git a/modules/platforms/cpp/cmake/scripts/odbc/ignite3-odbc-linux.ini.in 
b/modules/platforms/cpp/cmake/scripts/odbc/ignite3-odbc-linux.ini.in
new file mode 100644
index 00000000000..7279552b882
--- /dev/null
+++ b/modules/platforms/cpp/cmake/scripts/odbc/ignite3-odbc-linux.ini.in
@@ -0,0 +1,5 @@
+[Apache Ignite 3]
+Description=Apache Ignite 3 ODBC Driver
+Driver=@PACKAGE_SO_PATH@/libignite3-odbc.so
+Setup=@PACKAGE_SO_PATH@/libignite3-odbc.so
+DriverODBCVer=03.80
diff --git a/modules/platforms/cpp/tests/fake_server/CMakeLists.txt 
b/modules/platforms/cpp/cmake/scripts/odbc/post_install.sh.in
old mode 100644
new mode 100755
similarity index 76%
copy from modules/platforms/cpp/tests/fake_server/CMakeLists.txt
copy to modules/platforms/cpp/cmake/scripts/odbc/post_install.sh.in
index 2bb36ff07be..842403a8db9
--- a/modules/platforms/cpp/tests/fake_server/CMakeLists.txt
+++ b/modules/platforms/cpp/cmake/scripts/odbc/post_install.sh.in
@@ -1,3 +1,4 @@
+#!/bin/sh
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements. See the NOTICE file distributed with
@@ -15,15 +16,7 @@
 # limitations under the License.
 #
 
-project(ignite-fake-server)
-
-set(TARGET ${PROJECT_NAME})
-
-set(SOURCES
-    main.cpp
-    fake_server.cpp
-    tcp_client_channel.cpp
-    connection_test.cpp
-)
-
-ignite_test(${TARGET} SOURCES ${SOURCES} LIBS ignite-test-common 
ignite3-client msgpack-c)
\ No newline at end of file
+if ! odbcinst -i -d -f @IGNITE_ODBC_INI_PATH@/ignite3-odbc.ini -v; then
+    echo "Error: Failed to install Apache Ignite 3 ODBC driver using 
odbcinst." >&2
+    exit 1
+fi
diff --git a/modules/platforms/cpp/tests/fake_server/CMakeLists.txt 
b/modules/platforms/cpp/cmake/scripts/odbc/pre_uninstall.sh.in
old mode 100644
new mode 100755
similarity index 76%
copy from modules/platforms/cpp/tests/fake_server/CMakeLists.txt
copy to modules/platforms/cpp/cmake/scripts/odbc/pre_uninstall.sh.in
index 2bb36ff07be..ebb5285381a
--- a/modules/platforms/cpp/tests/fake_server/CMakeLists.txt
+++ b/modules/platforms/cpp/cmake/scripts/odbc/pre_uninstall.sh.in
@@ -1,3 +1,4 @@
+#!/bin/sh
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements. See the NOTICE file distributed with
@@ -15,15 +16,5 @@
 # limitations under the License.
 #
 
-project(ignite-fake-server)
-
-set(TARGET ${PROJECT_NAME})
-
-set(SOURCES
-    main.cpp
-    fake_server.cpp
-    tcp_client_channel.cpp
-    connection_test.cpp
-)
-
-ignite_test(${TARGET} SOURCES ${SOURCES} LIBS ignite-test-common 
ignite3-client msgpack-c)
\ No newline at end of file
+# Best-effort: ignore failures so uninstall does not fail if the driver is not 
registered or already removed.
+odbcinst -u -d -n "Apache Ignite 3" -v || true
diff --git a/modules/platforms/cpp/ignite/client/CMakeLists.txt 
b/modules/platforms/cpp/ignite/client/CMakeLists.txt
index 12c5eda7a60..93599a93aae 100644
--- a/modules/platforms/cpp/ignite/client/CMakeLists.txt
+++ b/modules/platforms/cpp/ignite/client/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite3-client)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ${PROJECT_NAME}-client)
 
 set(SOURCES
     cancel_handle.cpp
@@ -125,6 +123,7 @@ add_library(ignite::client-static ALIAS ${TARGET}-static)
 
 install(TARGETS ${TARGET}
     EXPORT ignite-client-targets
+    COMPONENT client
     ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -145,7 +144,7 @@ install(
     FILE "ignite-client-targets.cmake"
 )
 
-ignite_install_headers(FILES ${PUBLIC_HEADERS} DESTINATION 
${IGNITE_INCLUDEDIR}/client)
+ignite_install_headers(FILES ${PUBLIC_HEADERS} DESTINATION 
${IGNITE_INCLUDEDIR}/client COMPONENT client)
 
 ignite_test(utils_test DISCOVER SOURCES detail/utils_test.cpp LIBS 
${TARGET}-obj ${LIBRARIES})
 ignite_test(name_utils_test DISCOVER SOURCES detail/table/name_utils_test.cpp 
LIBS ${TARGET}-obj ${LIBRARIES})
diff --git a/modules/platforms/cpp/ignite/common/CMakeLists.txt 
b/modules/platforms/cpp/ignite/common/CMakeLists.txt
index 821aaa6a70d..afd0a609dc7 100644
--- a/modules/platforms/cpp/ignite/common/CMakeLists.txt
+++ b/modules/platforms/cpp/ignite/common/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite-common)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ignite-common)
 
 set(PUBLIC_HEADERS
     big_decimal.h
@@ -63,7 +61,7 @@ target_include_directories(${TARGET} INTERFACE
     PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>)
 
 if (${INSTALL_IGNITE_FILES})
-    ignite_install_headers(FILES ${PUBLIC_HEADERS} DESTINATION 
${IGNITE_INCLUDEDIR}/common)
+    ignite_install_headers(FILES ${PUBLIC_HEADERS} DESTINATION 
${IGNITE_INCLUDEDIR}/common COMPONENT client)
 endif()
 
 ignite_test(bits_test DISCOVER SOURCES detail/bits_test.cpp LIBS ${TARGET})
diff --git a/modules/platforms/cpp/ignite/network/CMakeLists.txt 
b/modules/platforms/cpp/ignite/network/CMakeLists.txt
index 3bacf2925b4..90356cf2865 100644
--- a/modules/platforms/cpp/ignite/network/CMakeLists.txt
+++ b/modules/platforms/cpp/ignite/network/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite-network)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ignite-network)
 
 find_package(OpenSSL)
 if (EXISTS ${OPENSSL_INCLUDE_DIR})
diff --git a/modules/platforms/cpp/ignite/odbc/CMakeLists.txt 
b/modules/platforms/cpp/ignite/odbc/CMakeLists.txt
index 66db99ff97b..c9bd9aaad3f 100644
--- a/modules/platforms/cpp/ignite/odbc/CMakeLists.txt
+++ b/modules/platforms/cpp/ignite/odbc/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite3-odbc)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ${PROJECT_NAME}-odbc)
 
 include(find_odbc)
 find_package(ODBC REQUIRED)
@@ -107,6 +105,7 @@ add_library(ignite::odbc ALIAS ${TARGET})
 
 install(TARGETS ${TARGET}
     EXPORT ignite-odbc-targets
+    COMPONENT odbc
     ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -123,7 +122,7 @@ install(
     EXPORT ignite-odbc-targets
     NAMESPACE ignite::
     DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ignite"
-    COMPONENT odbc
+    COMPONENT odbc-local
     FILE "ignite-odbc-targets.cmake"
 )
 
diff --git a/modules/platforms/cpp/ignite/protocol/CMakeLists.txt 
b/modules/platforms/cpp/ignite/protocol/CMakeLists.txt
index a77aefb5c76..1eb38a78021 100644
--- a/modules/platforms/cpp/ignite/protocol/CMakeLists.txt
+++ b/modules/platforms/cpp/ignite/protocol/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite-protocol)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ignite-protocol)
 
 set(SOURCES
     sql/column_meta.cpp sql/column_meta.h
diff --git a/modules/platforms/cpp/ignite/tuple/CMakeLists.txt 
b/modules/platforms/cpp/ignite/tuple/CMakeLists.txt
index b079f1d22a6..d94d5d0b298 100644
--- a/modules/platforms/cpp/ignite/tuple/CMakeLists.txt
+++ b/modules/platforms/cpp/ignite/tuple/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite-tuple)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ignite-tuple)
 
 set(SOURCES
     binary_tuple_builder.cpp
@@ -37,5 +35,5 @@ target_link_libraries(${TARGET} ignite-common)
 ignite_test(tuple_test DISCOVER SOURCES tuple_test.cpp LIBS ${TARGET})
 
 if (${INSTALL_IGNITE_FILES})
-    ignite_install_headers(FILES ${PUBLIC_HEADERS} DESTINATION 
${IGNITE_INCLUDEDIR}/tuple)
+    ignite_install_headers(FILES ${PUBLIC_HEADERS} DESTINATION 
${IGNITE_INCLUDEDIR}/tuple COMPONENT client)
 endif()
diff --git a/modules/platforms/cpp/tests/client-test/CMakeLists.txt 
b/modules/platforms/cpp/tests/client-test/CMakeLists.txt
index ea09a299f9b..715c784bd80 100644
--- a/modules/platforms/cpp/tests/client-test/CMakeLists.txt
+++ b/modules/platforms/cpp/tests/client-test/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite-client-test)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ignite-client-test)
 
 set(SOURCES
     basic_authenticator_test.cpp
diff --git a/modules/platforms/cpp/tests/fake_server/CMakeLists.txt 
b/modules/platforms/cpp/tests/fake_server/CMakeLists.txt
index 2bb36ff07be..b923dcd5a1e 100644
--- a/modules/platforms/cpp/tests/fake_server/CMakeLists.txt
+++ b/modules/platforms/cpp/tests/fake_server/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite-fake-server)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ignite-fake-server)
 
 set(SOURCES
     main.cpp
diff --git a/modules/platforms/cpp/tests/odbc-test/CMakeLists.txt 
b/modules/platforms/cpp/tests/odbc-test/CMakeLists.txt
index 6c24a52a521..42ea7016240 100644
--- a/modules/platforms/cpp/tests/odbc-test/CMakeLists.txt
+++ b/modules/platforms/cpp/tests/odbc-test/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite-odbc-test)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ignite-odbc-test)
 
 find_package(ODBC REQUIRED)
 
diff --git a/modules/platforms/cpp/tests/test-common/CMakeLists.txt 
b/modules/platforms/cpp/tests/test-common/CMakeLists.txt
index 304c1e53002..4ec7a914f6e 100644
--- a/modules/platforms/cpp/tests/test-common/CMakeLists.txt
+++ b/modules/platforms/cpp/tests/test-common/CMakeLists.txt
@@ -15,9 +15,7 @@
 # limitations under the License.
 #
 
-project(ignite-test-common)
-
-set(TARGET ${PROJECT_NAME})
+set(TARGET ignite-test-common)
 
 set(SOURCES
     basic_auth_test_suite.h

Reply via email to