summaryrefslogtreecommitdiff
path: root/cmake/mysql_version.cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-12-17 14:41:50 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-12-17 14:41:50 +0100
commiteb3c44030bf398ddaf033be1a3b1b163faa9bce3 (patch)
treeb9698e003a32f65faf28d6032f377916cf93b648 /cmake/mysql_version.cmake
parent07bfd2617db894f9a6a4ad5998941d3517974bb7 (diff)
downloadmariadb-git-eb3c44030bf398ddaf033be1a3b1b163faa9bce3.tar.gz
Replace ADD_EXECUTABLE with MYSQL_ADD_EXECUTABLE for binaries that are installed.
MYSQL_ADD_EXECUTABLE will instructs CPack where to install the exe. On Windows, it also adds version resource and if -DSIGNCODE was given, will sign the exe in packaging step.
Diffstat (limited to 'cmake/mysql_version.cmake')
-rw-r--r--cmake/mysql_version.cmake44
1 files changed, 5 insertions, 39 deletions
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index b0a77b0bbc9..d8677e6c3ad 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -55,9 +55,10 @@ MACRO(GET_MYSQL_VERSION)
SET(VERSION ${VERSION_STRING})
- STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+[^ ]+" "\\1" MAJOR_VERSION "${VERSION_STRING}")
- STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+[^ ]+" "\\1" MINOR_VERSION "${VERSION_STRING}")
- STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)[^ ]+" "\\1" PATCH "${VERSION_STRING}")
+ STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" MAJOR_VERSION "${VERSION_STRING}")
+ STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" MINOR_VERSION "${VERSION_STRING}")
+ STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" PATCH "${VERSION_STRING}")
+
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}")
MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH}")
@@ -150,39 +151,4 @@ SET(CPACK_SOURCE_IGNORE_FILES
SET(PRODUCTNAME "MySQL Server")
SET(COMPANYNAME ${CPACK_PACKAGE_VENDOR})
-# Function to embed version info into executables/dlls on Windows
-# Refer http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
-# for more information
-FUNCTION(WIN32_ADD_VERSION_INFO SOURCES)
- IF(NOT WIN32)
- RETURN()
- ENDIF()
- IF(NOT CMAKE_RC_COMPILER)
- RETURN()
- ENDIF()
-
- IF(NOT FILETYPE)
- SET(FILETYPE VFT_APP)
- ENDIF()
-
- IF(NOT MAJOR_VERSION)
- MESSAGE(FATAL_ERROR "MAJOR_VERSION is not defined")
- ENDIF()
- IF(NOT MINOR_VERSION)
- MESSAGE(FATAL_ERROR "MINOR_VERSION is not defined")
- ENDIF()
- IF(NOT PATCH)
- SET(PATCH 0)
- ENDIF()
-
- GET_TARGET_PROPERTY(target_location ${target} LOCATION)
- GET_FILENAME_COMPONENT(INTERNALNAME ${target_location} NAME_WE)
- IF(NOT FILEDESCRIPTION)
- SET(FILEDESCRIPTION ${INTERNALNAME})
- ENDIF()
- GET_FILENAME_COMPONENT(ORIGINALFILENAME ${target_location} NAME)
-
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/versioninfo.rc.in
- ${CMAKE_CURRENT_BINARY_DIR}/${target}_versioninfo.rc)
- LIST(APPEND ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/${target}_versioninfo.rc)
-ENDFUNCTION()
+