Files
mariadb-connector-cpp/cmake/SetValueMacro.cmake
Lawrin Novitsky eff5d647b9 Made all tests configurable via env variables
Tests connection credentials can be passed using env variables. All
tests use the same settings for that.

Added the link to the documentation to the README(.md)

Changed in SQLString all size_t to std::size_t(more like for
consictency).
Added npos constant there
2020-12-09 17:56:33 +01:00

12 lines
405 B
CMake

# Macro that checks if variable is defined, otherwise checks env for same name, otherwise uses default value
MACRO(SET_VALUE _variable _default_value _descr)
IF (NOT ${_variable})
IF(DEFINED ENV{${_variable}})
SET(${_variable} $ENV{${_variable}} CACHE STRING "${_descr}")
ELSE()
SET(${_variable} ${_default_value} CACHE STRING "${_descr}")
ENDIF()
ENDIF()
ENDMACRO(SET_VALUE)