Skip to content

Commit 78c7d50

Browse files
committed
Fix cmake warning caused by 751ebe4
CMake Warning (dev) at cmake/plugin.cmake:288 (GET_TARGET_PROPERTY): Policy CMP0045 is not set: Error on non-existent target... Also, fix condition argument in ADD_FEATURE_INFO. It is not a string but boolean
1 parent 1add892 commit 78c7d50

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

cmake/plugin.cmake

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,20 @@ MACRO(MYSQL_ADD_PLUGIN)
285285
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}")
286286
ENDIF()
287287

288-
GET_TARGET_PROPERTY(plugin_type ${target} TYPE)
289-
STRING(REGEX REPLACE "_LIBRARY$" "" plugin_type ${plugin_type})
290-
STRING(REGEX REPLACE "^NO$" "" plugin_type ${plugin_type})
288+
IF(TARGET ${target})
289+
GET_TARGET_PROPERTY(plugin_type ${target} TYPE)
290+
STRING(REPLACE "_LIBRARY" "" plugin_type ${plugin_type})
291+
SET(have_target 1)
292+
ELSE()
293+
SET(plugin_type)
294+
SET(have_target 0)
295+
ENDIF()
291296
IF(ARG_STORAGE_ENGINE)
292-
ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Storage Engine ${plugin_type}")
297+
ADD_FEATURE_INFO(${plugin} ${have_target} "Storage Engine ${plugin_type}")
293298
ELSEIF(ARG_CLIENT)
294-
ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Client plugin ${plugin_type}")
299+
ADD_FEATURE_INFO(${plugin} ${have_target} "Client plugin ${plugin_type}")
295300
ELSE()
296-
ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Server plugin ${plugin_type}")
301+
ADD_FEATURE_INFO(${plugin} ${have_target} "Server plugin ${plugin_type}")
297302
ENDIF()
298303
ENDIF(NOT WITHOUT_SERVER OR ARG_CLIENT)
299304
ENDMACRO()

0 commit comments

Comments
 (0)