diff options
author | Magnus Blåudd <magnus.blaudd@sun.com> | 2010-11-24 11:37:59 +0100 |
---|---|---|
committer | Magnus Blåudd <magnus.blaudd@sun.com> | 2010-11-24 11:37:59 +0100 |
commit | 41cab3211134e7d9ee46f261695f727089884f98 (patch) | |
tree | 8c7c6aad88185a79379902a06c83e997c2f159cc /cmake/mysql_version.cmake | |
parent | 7bf81b15c61ac9c81c5cb59629aeba9ffe97006e (diff) | |
download | mariadb-git-41cab3211134e7d9ee46f261695f727089884f98.tar.gz |
WL#5665: Removal of the autotools-based build system
- Make the cmake files depend on VERSION, causing
cmake rerun when VERSION changes
Diffstat (limited to 'cmake/mysql_version.cmake')
-rw-r--r-- | cmake/mysql_version.cmake | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index b4be85ff657..3ed93020e8a 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -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() |