提示:在
syntax-highlight分支上
我在我的项目中使用了KSyntaxHighlighting。这取决于ExtraCMakeModule。但是CMake提醒我他找不到ECM。
提示:我的项目的
KSyntaxHighlightingin 这里
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是因为我在上面的日志上看到了日志:
提示:
ECMin 这里
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)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)
......发布于 2020-05-10 09:39:17

伙计们,我现在有答案了。谢谢!
https://stackoverflow.com/questions/61706157
复制相似问题