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:
Magnus Blåudd 2010-11-24 11:37:59 +01:00
parent ee2b93944b
commit f9c3be71d1

View file

@ -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()