@@ -28,13 +28,14 @@ INCLUDE(CMakeParseArguments)
28
28
# [STATIC_OUTPUT_NAME static_name]
29
29
# [COMPONENT component]
30
30
# [CONFIG cnf_file_name]
31
+ # [VERSION version_string]
31
32
# [LINK_LIBRARIES lib1...libN]
32
33
# [DEPENDENCIES target1...targetN]
33
34
34
35
MACRO (MYSQL_ADD_PLUGIN )
35
36
CMAKE_PARSE_ARGUMENTS (ARG
36
37
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT"
37
- "MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
38
+ "MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG;VERSION "
38
39
"LINK_LIBRARIES;DEPENDENCIES"
39
40
${ARGN}
40
41
)
@@ -117,6 +118,10 @@ MACRO(MYSQL_ADD_PLUGIN)
117
118
IF (NOT ARG_DEPENDENCIES )
118
119
SET (ARG_DEPENDENCIES )
119
120
ENDIF ()
121
+
122
+ IF (ARG_VERSION )
123
+ SET (version_string ";PLUGIN_${plugin} _VERSION=\" ${ARG_VERSION} \" " )
124
+ ENDIF ()
120
125
121
126
IF (NOT ARG_MODULE_OUTPUT_NAME )
122
127
IF (ARG_STORAGE_ENGINE )
@@ -153,7 +158,7 @@ MACRO(MYSQL_ADD_PLUGIN)
153
158
DTRACE_INSTRUMENT (${target} _embedded )
154
159
IF (ARG_RECOMPILE_FOR_EMBEDDED )
155
160
SET_TARGET_PROPERTIES (${target} _embedded
156
- PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY" )
161
+ PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY${version_string} " )
157
162
ENDIF ()
158
163
ADD_DEPENDENCIES (${target} _embedded GenError )
159
164
ENDIF ()
@@ -204,7 +209,7 @@ MACRO(MYSQL_ADD_PLUGIN)
204
209
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "" )
205
210
IF (NOT ARG_CLIENT )
206
211
SET_TARGET_PROPERTIES (${target} PROPERTIES
207
- COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN" )
212
+ COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN${version_string} " )
208
213
ENDIF ()
209
214
210
215
TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES} )
0 commit comments