You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.2 KiB

  1. # Copyright (c) 2011, Codership Oy <info@codership.com>.
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; version 2 of the License.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. # We need to generate a proper spec file even without --with-wsrep flag,
  16. # so WSREP_VERSION is produced regardless
  17. # Set the patch version
  18. SET(WSREP_PATCH_VERSION "7.5")
  19. # Obtain patch revision number
  20. SET(WSREP_PATCH_REVNO $ENV{WSREP_REV})
  21. IF(NOT WSREP_PATCH_REVNO)
  22. EXECUTE_PROCESS(
  23. COMMAND bzr revno
  24. OUTPUT_VARIABLE WSREP_PATCH_REVNO
  25. RESULT_VARIABLE RESULT
  26. )
  27. STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_PATCH_REVNO "${WSREP_PATCH_REVNO}")
  28. #FILE(WRITE "wsrep_config" "Debug: WSREP_PATCH_REVNO result: ${RESULT}\n")
  29. ENDIF()
  30. IF(NOT WSREP_PATCH_REVNO)
  31. SET(WSREP_PATCH_REVNO "XXXX")
  32. ENDIF()
  33. # Obtain wsrep API version
  34. EXECUTE_PROCESS(
  35. COMMAND sh -c "grep WSREP_INTERFACE_VERSION ${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h | cut -d '\"' -f 2"
  36. OUTPUT_VARIABLE WSREP_API_VERSION
  37. RESULT_VARIABLE RESULT
  38. )
  39. #FILE(WRITE "wsrep_config" "Debug: WSREP_API_VERSION result: ${RESULT}\n")
  40. STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_API_VERSION "${WSREP_API_VERSION}")
  41. SET(WSREP_VERSION
  42. "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}.r${WSREP_PATCH_REVNO}"
  43. )
  44. OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ON)
  45. IF (WITH_WSREP)
  46. SET(WSREP_C_FLAGS "-DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048")
  47. SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WSREP_C_FLAGS}")
  48. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WSREP_C_FLAGS}")
  49. SET(COMPILATION_COMMENT "${COMPILATION_COMMENT}, wsrep_${WSREP_VERSION}")
  50. SET(WITH_EMBEDDED_SERVER OFF CACHE INTERNAL "" FORCE)
  51. ENDIF()
  52. #