mysql5/mysql-5.7.27/storage/ndb/cmake/ndb_get_config_value.cmake

15 lines
402 B
CMake

MACRO(NDB_GET_CONFIG_VALUE keyword var)
IF(NOT ${var})
# Read the line which contains the keyword
FILE (STRINGS ${NDB_SOURCE_DIR}/VERSION str
REGEX "^[ ]*${keyword}=")
IF(str)
# Remove the keyword=
STRING(REPLACE "${keyword}=" "" str ${str})
# Remove whitespace
STRING(REGEX REPLACE "[ ].*" "" str "${str}")
SET(${var} ${str})
ENDIF()
ENDIF()
ENDMACRO()