我试图从源代码编译这个项目:https://github.com/computationalpathologygroup/ASAP.git。Pugixml是一个依赖项。
我已经从源代码构建了pugixml,并设置了PugiXML_DIR和PUGIXML_INCLUDE_DIR,它仍然给我带来了错误:"CMake错误:在这个项目中使用了以下变量,但是它们被设置为NOTFOUND。“
我试过的东西
,这是我得到的错误
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
cpp/ASAP/annotation/PUGIXML_INCLUDE_DIR
used as include directory in directory
/cpp/ASAP/annotation
cpp/ASAP/multiresolutionimageinterface/PUGIXML_INCLUDE_DIR
used as include directory in directory cpp/ASAP/multiresolutionimageinterface其他信息:设置PugiXML_DIR是必需的,cmake将在该目录中查找名为"pugixml-config.cmake“的文件。配置cmake文件应该指向已编译的lib文件。但是当它找不到时,我只是将我编译的lib文件复制到pugixml-config.cmake所指向的位置。
发布于 2019-05-06 11:48:10
在4.04.2019之前的ASAP版本中,他们玩肮脏的游戏,从导入的目标中提取包含目录。注释/CMakeLists.txt:30
get_target_property(PUGIXML_INCLUDE_DIR pugixml INTERFACE_INCLUDE_DIRECTORIES)在某些情况下,这会导致将PUGIXML_INCLUDE_DIR变量设置为"-NOTFOUND",从而从CMake获得相应的错误消息。
在提交36d8bd75中,他们添加了FindPugiXML.cmake脚本,它处理find_package(PugiXML)调用,而不是PugiXML附带的配置脚本。在这个查找脚本中,他们使用find_path获得了包含目录,它看起来更自然一些:
find_path(PugiXML_INCLUDE_DIR pugixml.hpp)因为在较新的pugixml-config.cmake版本中不再使用PugiXML附带的配置脚本( PugiXML ),所以不能用PugiXML_DIR或PugiXML_ROOT提示PugiXML的位置。如果PugiXML安装到非系统默认位置,可以简单地将PugiXML_INCLUDE_DIR变量设置为PugiXML包含目录。
https://stackoverflow.com/questions/55955889
复制相似问题