c++ - CMake 错误:找不到 ExtraCMakeModule
问题描述
提示:在
syntax-highlight
树枝上
我KSyntaxHighlighting
在我的项目中使用过。这取决于ExtraCMakeModule
. 但是 CMake 提示我他找不到ECM
.
提示:我的项目
KSyntaxHighlighting
在这里
CMake Error at src/3rdparty/syntax-highlighting/CMakeLists.txt:8 (find_package):
Could not find a package configuration file provided by "ECM" with any of
the following names:
ECMConfig.cmake
ecm-config.cmake
...
但我认为ECM
是执行的,因为我看到了上面的日志上面的日志:
提示:
ECM
在这里
CMake Warning (dev) at src/3rdparty/syntax-highlighting/extra-cmake-modules/docs/CMakeLists.txt:41 (find_package):
FindQCollectionGenerator.cmake must either be part of this project itself,
in this case adjust CMAKE_MODULE_PATH so that it points to the correct
location inside its source tree.
提示:您可以在CMake 错误日志中看到完整的日志
文件结构是这样的:
.
└── src
├── 3rdparty
│ └── syntax-highlighting
│ ├── extra-cmake-modules
这是项目的CMakeLists.txt:
# CMakeLists.txt
cmake_minimum_required(VERSION 3.1.0)
project(notepanda)
list(GET VERSION_LIST 0 CMAKE_PROJECT_VERSION_MAJOR)
list(GET VERSION_LIST 1 CMAKE_PROJECT_VERSION_MINOR)
list(GET VERSION_LIST 2 CPACK_PACKAGE_VERSION_PATCH)
add_definitions(-DVERSION_STRING="${VERSION_STRING}")
add_definitions(-DXTOSTRUCT_QT)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
add_subdirectory(src/3rdparty/syntax-highlighting)
add_subdirectory(src/3rdparty/syntax-highlighting/extra-cmake-modules)
find_package(Qt5 COMPONENTS Widgets Svg REQUIRED)
find_package(KF5SyntaxHighlighting)
find_package(ECM)
KSyntaxHighlighting的 CMakeLists.txt:
cmake_minimum_required(VERSION 3.5)
add_subdirectory(extra-cmake-modules)
set(KF5_VERSION "5.70.0")
project(KSyntaxHighlighting VERSION ${KF5_VERSION})
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
include(KDEInstallDirs)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
......
解决方案
推荐阅读
- css - 查找宽度最大的元素的方法
- caching - 临时 Lucene 异常“字段“xyz”中的术语多于文档,但无法对标记化字段进行排序”
- python - 如果我们使用 Scikit-Learn 库的 RandomForestRegressor 有多个输出,如何计算拆分的杂质减少
- openvswitch - OpenFlow set_tunnel 使用 OVS 发送原始流量
- dynamics-crm - 自动导入作业动态 CRM 365
- vba - Vba:将Excel工作表打印到多个pdf页面
- reactjs - 通过使用语义反应输入。如何使用 redux 在 store/state 中存储值/信息?
- xml - sparql xml如何提取这个元素?
- botframework - Bot Framework Adpative Forms - 提交操作不起作用
- sql-server - 从 SELECT 创建数据库名称