我想为mysql编写一个信息模式插件,首先我试图编译示例插件,但出现了一些错误。cmakelist.txt如下:
MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc
MODULE_ONLY TEST_ONLY MODULE_OUTPUT_NAME "libdaemon_example")
INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Test)
据说未知的cmake命令“mysql\u add\u plugin”,
Selecting Windows SDK version 10.0.16299.0 to target Windows 6.1.7601.
The C compiler identification is MSVC 19.11.25547.0
The CXX compiler identification is MSVC 19.11.25547.0
Check for working C compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe
Check for working C compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe
Check for working CXX compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:16 (MYSQL_ADD_PLUGIN):
Unknown CMake command "MYSQL_ADD_PLUGIN".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.11)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
此警告适用于项目开发人员。使用-wno dev来抑制它。
Configuring incomplete, errors occurred!
See also "C:/Program Files/CMake/bin/CMakeFiles/CMakeOutput.log".
我发现这个函数在mysql server\cmake文件中,
MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;CLIENT_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_FOR_EMBEDDED;RECOMPILE_FOR_EMBEDDED;TEST_ONLY"
${ARGN}
)
我想知道如何修复它并使编译成功?错误图像
暂无答案!
目前还没有任何答案,快来回答吧!