我是 C++ 的绝对初学者。我正在使用 Flutter 桌面插件。一切都很好,只是我无法正确配置本机代码编辑(智能感知、自动完成等),因为它只是充当纯文本。我的颤振项目中有一个linux
命名目录,它似乎是一个 C++ 项目。如何在完全 IDE 支持的情况下使用此代码?我试图linux
在 CLion 中打开命名文件夹并得到了这个。
CMake Error at CMakeLists.txt:12 (apply_standard_settings):
Unknown CMake command "apply_standard_settings".
-- Configuring incomplete, errors occurred!
这是CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME "desktop_practice")
project(${PROJECT_NAME} LANGUAGES CXX)
# This value is used when generating builds using this plugin, so it must
# not be changed
set(PLUGIN_NAME "desktop_practice_plugin")
add_library(${PLUGIN_NAME} SHARED
"desktop_practice_plugin.cc"
)
apply_standard_settings(${PLUGIN_NAME})
set_target_properties(${PLUGIN_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden)
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
target_include_directories(${PLUGIN_NAME} INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
# List of absolute paths to libraries that should be bundled with the plugin
set(desktop_practice_bundled_libraries
""
PARENT_SCOPE
)
即使我尝试在 VSCode 中打开项目,但我无法将其配置为正确的 C++ 项目。