Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
37b1efb9
Commit
37b1efb9
authored
Dec 16, 2009
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add version resource to windows executables
parent
9051d1c0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
27 deletions
+131
-27
cmake/Makefile.am
cmake/Makefile.am
+2
-1
cmake/install_macros.cmake
cmake/install_macros.cmake
+6
-0
cmake/mysql_version.cmake
cmake/mysql_version.cmake
+98
-26
cmake/versioninfo.rc.in
cmake/versioninfo.rc.in
+25
-0
No files found.
cmake/Makefile.am
View file @
37b1efb9
...
@@ -19,4 +19,5 @@ EXTRA_DIST = \
...
@@ -19,4 +19,5 @@ EXTRA_DIST = \
stack_direction.c
\
stack_direction.c
\
do_abi_check.cmake
\
do_abi_check.cmake
\
merge_archives_unix.cmake.in
\
merge_archives_unix.cmake.in
\
dtrace_prelink.cmake
dtrace_prelink.cmake
\
versioninfo.rc.in
cmake/install_macros.cmake
View file @
37b1efb9
...
@@ -134,6 +134,12 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
...
@@ -134,6 +134,12 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
ENDFOREACH
()
ENDFOREACH
()
ENDIF
()
ENDIF
()
IF
(
WIN32
)
FOREACH
(
target
${
TARGETS
}
)
EMBED_VERSION_INFO
(
${
target
}
)
ENDFOREACH
()
ENDIF
()
INSTALL
(
TARGETS
${
TARGETS
}
DESTINATION
${
ARG_DESTINATION
}
)
INSTALL
(
TARGETS
${
TARGETS
}
DESTINATION
${
ARG_DESTINATION
}
)
SET
(
INSTALL_LOCATION
${
ARG_DESTINATION
}
)
SET
(
INSTALL_LOCATION
${
ARG_DESTINATION
}
)
INSTALL_DEBUG_SYMBOLS
(
"
${
TARGETS
}
"
)
INSTALL_DEBUG_SYMBOLS
(
"
${
TARGETS
}
"
)
...
...
cmake/mysql_version.cmake
View file @
37b1efb9
...
@@ -125,10 +125,11 @@ IF(NOT CPACK_PACKAGE_FILE_NAME)
...
@@ -125,10 +125,11 @@ IF(NOT CPACK_PACKAGE_FILE_NAME)
SET
(
CPACK_PACKAGE_FILE_NAME
${
package_name
}
)
SET
(
CPACK_PACKAGE_FILE_NAME
${
package_name
}
)
ENDIF
()
ENDIF
()
IF
(
NOT CPACK_SOURCE_PACKAGE_FILE_NAME
)
IF
(
NOT CPACK_SOURCE_PACKAGE_FILE_NAME
)
SET
(
CPACK_SOURCE_PACKAGE_FILE_NAME
"mysql-
${
VERSION
}
"
)
SET
(
CPACK_SOURCE_PACKAGE_FILE_NAME
"mysql-
${
VERSION
}
"
)
ENDIF
()
ENDIF
()
SET
(
CPACK_PACKAGE_VENDOR
"Sun Microsystems"
)
SET
(
CPACK_PACKAGE_VENDOR
"Sun Microsystems
, Inc
"
)
SET
(
CPACK_SOURCE_GENERATOR
"TGZ"
)
SET
(
CPACK_SOURCE_GENERATOR
"TGZ"
)
SET
(
CPACK_SOURCE_IGNORE_FILES
SET
(
CPACK_SOURCE_IGNORE_FILES
\\\\.bzr/
\\\\.bzr/
...
@@ -136,7 +137,78 @@ SET(CPACK_SOURCE_IGNORE_FILES
...
@@ -136,7 +137,78 @@ SET(CPACK_SOURCE_IGNORE_FILES
.bzrignore
.bzrignore
CMakeCache.txt
CMakeCache.txt
/CMakeFiles/
/CMakeFiles/
/version_resources/
/_CPack_Packages/
/_CPack_Packages/
$.gz
$.gz
$.zip
$.zip
)
)
# Defintions for windows version resources
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
(
EMBED_VERSION_INFO target
)
IF
(
NOT WIN32
)
RETURN
()
ENDIF
()
IF
(
NOT CMAKE_RC_COMPILER
)
RETURN
()
ENDIF
()
GET_TARGET_PROPERTY
(
target_type
${
target
}
TYPE
)
IF
(
target_type MATCHES
"STATIC"
)
RETURN
()
ENDIF
()
IF
(
TARGET_TYPE MATCHES
"EXE"
)
SET
(
FILETYPE VFT_APP
)
ELSE
()
SET
(
FILETYPE VFT_DLL
)
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
)
# Directory where we have resouce script and compiled .res file
SET
(
RES_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
/version_resources
)
# Create resource script (.rc)
CONFIGURE_FILE
(
${
CMAKE_SOURCE_DIR
}
/cmake/versioninfo.rc.in
${
RES_DIR
}
/
${
target
}
_versioninfo.rc
)
# Compile resource script to object if required
IF
(
EXISTS
${
RES_DIR
}
/
${
target
}
_versioninfo.res
)
IF
(
${
RES_DIR
}
/
${
target
}
_versioninfo.rc IS_NEWER_THAN
${
RES_DIR
}
/
${
target
}
_versioninfo.res
)
SET
(
RUN_RC 1
)
ENDIF
()
ELSE
()
SET
(
RUN_RC 1
)
ENDIF
()
IF
(
RUN_RC
)
# Run resource compiler
EXECUTE_PROCESS
(
COMMAND
${
CMAKE_RC_COMPILER
}
/nologo /fo
${
target
}
_versioninfo.res
${
target
}
_versioninfo.rc
WORKING_DIRECTORY
${
RES_DIR
}
)
ENDIF
()
TARGET_LINK_LIBRARIES
(
${
target
}
${
RES_DIR
}
/
${
target
}
_versioninfo.res
)
ENDFUNCTION
()
cmake/versioninfo.rc.in
0 → 100644
View file @
37b1efb9
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0
PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS__WINDOWS32
FILETYPE @FILETYPE@
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "@FILEDESCRIPTION@\0"
VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@\0"
VALUE "InternalName", "@INTERNALNAME@\0"
VALUE "OriginalFilename", "@ORIGINALFILENAME@\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment