summaryrefslogtreecommitdiff
path: root/cmake/plugin.cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-08-09 11:52:03 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2021-08-09 18:00:22 +0200
commitf725020ff7224f4d641cf0e11fe2a83f383e2e7b (patch)
tree658a4d9e875744847a61ae7394759bded09db75d /cmake/plugin.cmake
parent160d97a4aaacbefb7f91a7e30a79b4d7937468a8 (diff)
downloadmariadb-git-f725020ff7224f4d641cf0e11fe2a83f383e2e7b.tar.gz
Fix cmake warning caused by 751ebe44fda4deb715fc2235548517c287f2a559
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
Diffstat (limited to 'cmake/plugin.cmake')
-rw-r--r--cmake/plugin.cmake17
1 files changed, 11 insertions, 6 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 4184dc46648..8b050a808ab 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -257,15 +257,20 @@ MACRO(MYSQL_ADD_PLUGIN)
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}")
ENDIF()
- GET_TARGET_PROPERTY(plugin_type ${target} TYPE)
- STRING(REGEX REPLACE "_LIBRARY$" "" plugin_type ${plugin_type})
- STRING(REGEX REPLACE "^NO$" "" plugin_type ${plugin_type})
+ IF(TARGET ${target})
+ GET_TARGET_PROPERTY(plugin_type ${target} TYPE)
+ STRING(REPLACE "_LIBRARY" "" plugin_type ${plugin_type})
+ SET(have_target 1)
+ ELSE()
+ SET(plugin_type)
+ SET(have_target 0)
+ ENDIF()
IF(ARG_STORAGE_ENGINE)
- ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Storage Engine ${plugin_type}")
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Storage Engine ${plugin_type}")
ELSEIF(ARG_CLIENT)
- ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Client plugin ${plugin_type}")
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Client plugin ${plugin_type}")
ELSE()
- ADD_FEATURE_INFO(${plugin} PLUGIN_${plugin} "Server plugin ${plugin_type}")
+ ADD_FEATURE_INFO(${plugin} ${have_target} "Server plugin ${plugin_type}")
ENDIF()
ENDIF(NOT WITHOUT_SERVER OR ARG_CLIENT)
ENDMACRO()