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
27c0d595
Commit
27c0d595
authored
Dec 18, 2009
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify embedding version info into executables with ADD_VERSION_INFO
parent
c7d19dab
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
71 deletions
+65
-71
CMakeLists.txt
CMakeLists.txt
+9
-9
cmake/install_macros.cmake
cmake/install_macros.cmake
+5
-5
cmake/libutils.cmake
cmake/libutils.cmake
+0
-3
cmake/mysql_add_executable.cmake
cmake/mysql_add_executable.cmake
+1
-44
cmake/mysql_version.cmake
cmake/mysql_version.cmake
+44
-1
cmake/plugin.cmake
cmake/plugin.cmake
+2
-4
cmake/versioninfo.rc.in
cmake/versioninfo.rc.in
+1
-3
sql/CMakeLists.txt
sql/CMakeLists.txt
+3
-2
No files found.
CMakeLists.txt
View file @
27c0d595
...
...
@@ -62,15 +62,15 @@ ELSE()
ENDIF
()
# Add macros
INCLUDE
(
c
make/character_sets.cmake
)
INCLUDE
(
cmake/zlib.cmake
)
INCLUDE
(
cmake/ssl.cmake
)
INCLUDE
(
cmake/readline.cmak
e
)
INCLUDE
(
cmake/mysql_version.cmake
)
INCLUDE
(
cmake/libutils.cmake
)
INCLUDE
(
cmake/dtrace.cmak
e
)
INCLUDE
(
cmake/plugin.cmake
)
INCLUDE
(
cmake/install_macros.cmake
)
INCLUDE
(
c
haracter_sets
)
INCLUDE
(
zlib
)
INCLUDE
(
ssl
)
INCLUDE
(
readlin
e
)
INCLUDE
(
mysql_version
)
INCLUDE
(
libutils
)
INCLUDE
(
dtrac
e
)
INCLUDE
(
plugin
)
INCLUDE
(
install_macros
)
INCLUDE
(
mysql_add_executable
)
# Handle options
...
...
cmake/install_macros.cmake
View file @
27c0d595
...
...
@@ -130,12 +130,12 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
ENDIF
()
# If signing is required, sign executables before installing
IF
(
SIGNCODE
)
FOREACH
(
target
${
TARGETS
}
)
FOREACH
(
target
${
TARGETS
}
)
IF
(
SIGNCODE
)
SIGN_TARGET
(
${
target
}
)
END
FOREACH
()
ENDIF
(
)
END
IF
()
ADD_VERSION_INFO
(
${
target
}
)
ENDFOREACH
()
INSTALL
(
TARGETS
${
TARGETS
}
DESTINATION
${
ARG_DESTINATION
}
)
SET
(
INSTALL_LOCATION
${
ARG_DESTINATION
}
)
...
...
cmake/libutils.cmake
View file @
27c0d595
...
...
@@ -248,9 +248,6 @@ MACRO(MERGE_LIBRARIES)
ENDFOREACH
()
ENDIF
()
CREATE_EXPORT_FILE
(
SRC
${
TARGET
}
"
${
ARG_EXPORTS
}
"
)
IF
(
WIN32 AND NOT ARG_NOINSTALL
)
ADD_VERSION_INFO
(
${
TARGET
}
VFT_DLL SRC
)
ENDIF
()
ADD_LIBRARY
(
${
TARGET
}
${
LIBTYPE
}
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
${
TARGET
}
${
LIBS
}
)
IF
(
ARG_OUTPUT_NAME
)
...
...
cmake/mysql_add_executable.cmake
View file @
27c0d595
...
...
@@ -37,53 +37,10 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
LIST
(
REMOVE_AT ARG_DEFAULT_ARGS 0
)
SET
(
sources
${
ARG_DEFAULT_ARGS
}
)
IF
(
WIN32
)
ADD_VERSION_INFO
(
${
target
}
VFT_APP sources
)
ENDIF
()
ADD_EXECUTABLE
(
${
target
}
${
ARG_WIN32
}
${
ARG_MACOSX_BUNDLE
}
${
ARG_EXCLUDE_FROM_ALL
}
${
sources
}
)
# tell CPack where to install
IF
(
NOT ARG_EXCLUDE_FROM_ALL
)
MYSQL_INSTALL_TARGETS
(
${
target
}
DESTINATION bin
)
ENDIF
()
ENDFUNCTION
()
# 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
MACRO
(
ADD_VERSION_INFO target filetype sources
)
SET
(
HAVE_RC_FILE
)
FOREACH
(
src
${
sources
}
)
IF
(
"
${
src
}
"
MATCHES
"
\\
.rc$"
)
SET
(
HAVE_RC_FILE 1
)
BREAK
()
ENDIF
()
ENDFOREACH
()
IF
(
NOT HAVE_RC_FILE
)
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
()
SET
(
FILETYPE
${
filetype
}
)
SET
(
INTERNALNAME
${
target
}
)
IF
(
FILETYPE STREQUAL VFT_APP
)
SET
(
ORIGINALFILENAME
${
target
}
.exe
)
ELSE
()
SET
(
ORIGINALFILENAME
${
target
}
.dll
)
ENDIF
()
SET
(
FILEDESCRIPTION
${
target
}
)
FIND_FILE
(
VERINFO_IN versioninfo.rc.in
${
CMAKE_MODULE_PATH
}
)
IF
(
NOT VERINFO_IN
)
MESSAGE
(
FATAL_ERROR
"cannot find version info template"
)
ENDIF
()
CONFIGURE_FILE
(
${
VERINFO_IN
}
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
target
}
.rc
)
LIST
(
APPEND
${
sources
}
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
target
}
.rc
)
ENDIF
()
ENDMACRO
()
\ No newline at end of file
ENDFUNCTION
()
\ No newline at end of file
cmake/mysql_version.cmake
View file @
27c0d595
...
...
@@ -151,4 +151,47 @@ SET(CPACK_SOURCE_IGNORE_FILES
SET
(
PRODUCTNAME
"MySQL Server"
)
SET
(
COMPANYNAME
${
CPACK_PACKAGE_VENDOR
}
)
# Add version information to the exe and dll files
# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
# for more info.
IF
(
MSVC
)
GET_TARGET_PROPERTY
(
location gen_versioninfo LOCATION
)
IF
(
NOT location
)
GET_FILENAME_COMPONENT
(
MYSQL_CMAKE_SCRIPT_DIR
${
CMAKE_CURRENT_LIST_FILE
}
PATH
)
SET
(
FILETYPE VFT_APP
)
CONFIGURE_FILE
(
${
MYSQL_CMAKE_SCRIPT_DIR
}
/versioninfo.rc.in
${
CMAKE_BINARY_DIR
}
/versioninfo_exe.rc
)
SET
(
FILETYPE VFT_DLL
)
CONFIGURE_FILE
(
${
MYSQL_CMAKE_SCRIPT_DIR
}
/versioninfo.rc.in
${
CMAKE_BINARY_DIR
}
/versioninfo_dll.rc
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
CMAKE_BINARY_DIR
}
/versioninfo_exe.res
${
CMAKE_BINARY_DIR
}
/versioninfo_dll.res
COMMAND
${
CMAKE_RC_COMPILER
}
versioninfo_exe.rc
COMMAND
${
CMAKE_RC_COMPILER
}
versioninfo_dll.rc
WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
)
ADD_CUSTOM_TARGET
(
gen_versioninfo
DEPENDS
${
CMAKE_BINARY_DIR
}
/versioninfo_exe.res
${
CMAKE_BINARY_DIR
}
/versioninfo_dll.res
)
ENDIF
()
FUNCTION
(
ADD_VERSION_INFO target
)
GET_TARGET_PROPERTY
(
target_type
${
target
}
TYPE
)
ADD_DEPENDENCIES
(
${
target
}
gen_versioninfo
)
IF
(
target_type MATCHES
"SHARED"
OR target_type MATCHES
"MODULE"
)
SET_PROPERTY
(
TARGET
${
target
}
APPEND PROPERTY LINK_FLAGS
"
\"
${
CMAKE_BINARY_DIR
}
/versioninfo_dll.res
\"
"
)
ELSEIF
(
target_type MATCHES
"EXE"
)
SET_PROPERTY
(
TARGET
${
target
}
APPEND PROPERTY LINK_FLAGS
"
${
target_link_flags
}
\"
${
CMAKE_BINARY_DIR
}
/versioninfo_exe.res
\"
"
)
ENDIF
()
ENDFUNCTION
()
ELSE
()
FUNCTION
(
ADD_VERSION_INFO
)
ENDFUNCTION
()
ENDIF
()
cmake/plugin.cmake
View file @
27c0d595
...
...
@@ -127,10 +127,8 @@ MACRO(MYSQL_ADD_PLUGIN)
SET
(
ARG_MODULE_OUTPUT_NAME
"
${
target
}
"
)
ENDIF
()
ENDIF
()
IF
(
WIN32
)
ADD_VERSION_INFO
(
${
ARG_MODULE_OUTPUT_NAME
}
VFT_DLL SOURCES
)
ENDIF
()
ADD_LIBRARY
(
${
target
}
MODULE
${
SOURCES
}
)
ADD_LIBRARY
(
${
target
}
MODULE
${
SOURCES
}
)
DTRACE_INSTRUMENT
(
${
target
}
)
SET_TARGET_PROPERTIES
(
${
target
}
PROPERTIES PREFIX
""
COMPILE_DEFINITIONS
"MYSQL_DYNAMIC_PLUGIN"
)
...
...
cmake/versioninfo.rc.in
View file @
27c0d595
...
...
@@ -12,10 +12,8 @@ BEGIN
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "@FILEDESCRIPTION@\0"
VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0"
VALUE "InternalName", "@INTERNALNAME@\0"
VALUE "OriginalFilename", "@ORIGINALFILENAME@\0"
VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0"
END
END
BLOCK "VarFileInfo"
...
...
sql/CMakeLists.txt
View file @
27c0d595
...
...
@@ -103,13 +103,14 @@ MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE})
IF
(
NOT WITHOUT_DYNAMIC_PLUGINS
)
SET_TARGET_PROPERTIES
(
mysqld PROPERTIES ENABLE_EXPORTS TRUE
)
GET_TARGET_PROPERTY
(
mysqld_link_flags mysqld LINK_FLAGS
)
IF
(
MINGW OR CYGWIN
)
SET_TARGET_PROPERTIES
(
mysqld PROPERTIES LINK_FLAGS
"-Wl,--export-all-symbols"
)
SET_TARGET_PROPERTIES
(
mysqld PROPERTIES LINK_FLAGS
"
{mysqld_link_flags}
-Wl,--export-all-symbols"
)
ENDIF
()
IF
(
MSVC
)
# Set module definition file. Also use non-incremental linker,
# incremental appears to crash from time to time,if used with /DEF option
SET_TARGET_PROPERTIES
(
mysqld PROPERTIES LINK_FLAGS
"/DEF:mysqld.def /INCREMENTAL:NO"
)
SET_TARGET_PROPERTIES
(
mysqld PROPERTIES LINK_FLAGS
"
${
mysqld_link_flags
}
/DEF:mysqld.def /INCREMENTAL:NO"
)
FOREACH
(
CORELIB sql mysys dbug strings
)
GET_TARGET_PROPERTY
(
LOC
${
CORELIB
}
LOCATION
)
...
...
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