tree: 89c60c8e09ea7c3041bb2beef116f97c0c890fdd
  1. cmake_package/
  2. cmake_package_install/
  3. cmake_subdirectory/
  4. compile_public_headers/
  5. README.md
  6. test_client.cpp
  7. test_odbc.cpp
modules/platforms/cpp/tests/package-test/README.md

Ignite Package Test

This directory contains tests to verify that the installed Ignite package can be found and used correctly via CMake's find_package() mechanism.

Purpose

These tests verify:

  1. The ignite-config.cmake package configuration works correctly
  2. Component-based discovery (client, odbc) functions properly
  3. The exported CMake targets link correctly
  4. Headers and libraries are accessible

Building the Tests

Each test configuration can build two executables: test_client and test_odbc; there are corresponding CMake options:

  • ENABLE_CLIENT
  • ENABLE_ODBC These options can be used together. Each CMake configuration should build two tests (if ENABLE_CLIENT=ON and ENABLE_ODBC=ON are specified). Successful compilation of these tests means we have found Ignite components, include directories and libraries to link with.

cmake_package

This test implies that there is Ignite source code folder and Ignite was built at least once, but was not installed. This test uses ignite-config.cmake which will be generated in the binary directory.

Build command: cmake -DENABLE_CLIENT=ON -DENABLE_ODBC=ON -S ../tests/package-test/cmake_package/ -B build_package && cmake --build build_package

cmake_package_install

This test will search for the Ignite installation. For test purposes, the install will be done in a directory inside the build directory. The Test will search for ignite-config.cmake in the installation directory.

Build command: cmake -DENABLE_CLIENT=ON -DENABLE_ODBC=ON -S ../tests/package-test/cmake_package_install/ -B build_package_install && cmake --build build_package_install

cmake_subdirectory

This test will include Ignite as cmake subdirectory and will build its targets to link to the tests.

Build command: cmake -DENABLE_CLIENT=ON -DENABLE_ODBC=ON -S ../tests/package-test/cmake_subdirectory/ -B build_subdirectory && cmake --build build_subdirectory