我是 CMake 的新手,我不确定我在做什么
我通过 CMake 将 poppler 用作我的应用程序的库。我已将其作为子模块导入。
如果我在我的顶级 CMake 文件中包含 popper add_subdirectory(...),则会出现以下错误
[cmake] CMake Error at external/poppler/CMakeLists.txt:7 (include):
[cmake] include could not find requested file:
[cmake]
[cmake] PopplerDefaults
[cmake]
[cmake]
[cmake] CMake Error at external/poppler/CMakeLists.txt:8 (include):
这很可能是因为CMAKE_MODULE_PATH不正确。
经过一番挖掘,看起来 poppler 正在设置模块路径而不是附加到它。
https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/CMakeLists.txt#L5
所以我似乎无法真正覆盖它。
我的(可能过于复杂)设置在这里,poppler 行注释掉了。 https://github.com/bdurrani/cmake-test/blob/master/CMakeLists.txt#L69
如果我从 poppler 文件夹中运行 cmake,这可以正常工作。
有没有解决的办法?你如何处理这种情况?