mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
WL#5665: Removal of the autotools-based build system
- Make the cmake files depend on VERSION, causing cmake rerun when VERSION changes
This commit is contained in:
parent
ee2b93944b
commit
f9c3be71d1
1 changed files with 11 additions and 7 deletions
|
@ -21,17 +21,21 @@ SET(SHARED_LIB_MAJOR_VERSION "16")
|
|||
SET(PROTOCOL_VERSION "10")
|
||||
SET(DOT_FRM_VERSION "6")
|
||||
|
||||
# Generate "something" to trigger cmake rerun when VERSION changes
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_SOURCE_DIR}/VERSION
|
||||
${CMAKE_BINARY_DIR}/VERSION.dep
|
||||
)
|
||||
|
||||
# Read value for a variable from VERSION.
|
||||
|
||||
MACRO(MYSQL_GET_CONFIG_VALUE keyword var)
|
||||
IF(NOT ${var})
|
||||
IF (EXISTS ${CMAKE_SOURCE_DIR}/VERSION)
|
||||
FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=")
|
||||
IF(str)
|
||||
STRING(REPLACE "${keyword}=" "" str ${str})
|
||||
STRING(REGEX REPLACE "[ ].*" "" str "${str}")
|
||||
SET(${var} ${str})
|
||||
ENDIF()
|
||||
FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=")
|
||||
IF(str)
|
||||
STRING(REPLACE "${keyword}=" "" str ${str})
|
||||
STRING(REGEX REPLACE "[ ].*" "" str "${str}")
|
||||
SET(${var} ${str})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
|
Loading…
Reference in a new issue