Add custom target to show SOCI build configuration

This can be useful to check how the library was configured later.
This commit is contained in:
Vadim Zeitlin
2025-08-20 19:10:39 +02:00
parent 6fa9eb88ae
commit abce5acd55
2 changed files with 13 additions and 0 deletions

View File

@@ -156,3 +156,14 @@ message(STATUS "SOCI ${SOCI_VERSION} will be built as ${SOCI_LIB_TYPE} library${
message(STATUS "Enabled SOCI backends are: ${SOCI_ENABLED_BACKENDS}")
endif()
# Also make it possible to see SOCI configuration later.
add_custom_target(show_config
COMMAND ${CMAKE_COMMAND} -E echo "SOCI ${SOCI_VERSION} configured with:"
COMMAND ${CMAKE_COMMAND} -E echo " Build type: ${CMAKE_BUILD_TYPE}"
COMMAND ${CMAKE_COMMAND} -E echo " Library type: ${SOCI_LIB_TYPE}"
COMMAND ${CMAKE_COMMAND} -E echo " Enabled backends: ${SOCI_ENABLED_BACKENDS}"
COMMENT
"Show SOCI build configuration summary"
VERBATIM
)

View File

@@ -95,6 +95,8 @@ When it comes to enabling specific backends, SOCI supports three distinct option
SQLite backend is special, as it may use the built-in SQLite library if the system version is not found, see its documentation below for more details.
SOCI outputs the summary of its build configuration at the end of the CMake configuration step, so you can easily see which backends are effectively enabled. It is also possible to show the build configuration at any later time by running `cmake --build $builddir --target show_config` where `builddir` is the build directory.
#### Empty (sample backend)
* `SOCI_EMPTY` - Enabler - Enables the [sample backend](backends/index.md) called Empty. Always ON by default.