首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CMake错误:找不到ExtraCMakeModule

CMake错误:找不到ExtraCMakeModule
EN

Stack Overflow用户
提问于 2020-05-10 01:45:26
回答 1查看 691关注 0票数 1

提示:在syntax-highlight分支上

我在我的项目中使用了KSyntaxHighlighting。这取决于ExtraCMakeModule。但是CMake提醒我他找不到ECM

提示:我的项目的KSyntaxHighlighting in 这里

代码语言:javascript
复制
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 in 这里

代码语言:javascript
复制
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误差日志中看到完整的日志

文件结构如下:

代码语言:javascript
复制
.
└── src
    ├── 3rdparty
    │   └── syntax-highlighting
    │       ├── extra-cmake-modules

这是这个项目的CMakeLists.txt

代码语言:javascript
复制
# 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)

The K型合成高亮度CMakeLists.txt

代码语言:javascript
复制
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)
......
EN

回答 1

Stack Overflow用户

发布于 2020-05-10 09:39:17

伙计们,我现在有答案了。谢谢!

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61706157

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档