有没有办法使用cmake find_package()来定位jupyter_notebook安装?
我试过了
FIND_PACKAGE(jupyter-notebook REQUIRED)但是它错误地输出了
CMake Error at CMakeLists.txt:15 (FIND_PACKAGE):
By not providing "Findjupyter-notebook.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"jupyter-notebook", but CMake did not find one.
Could not find a package configuration file provided by "jupyter-notebook"
with any of the following names:
jupyter-notebookConfig.cmake
jupyter-notebook-config.cmake
Add the installation prefix of "jupyter-notebook" to CMAKE_PREFIX_PATH or
set "jupyter-notebook_DIR" to a directory containing one of the above
files. If "jupyter-notebook" provides a separate development package or
SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!但是,它已被安装:
apt-cache show jupyter-notebook发布于 2019-04-25 10:42:58
使用find_package命令、MODULE和CONFIG时,有几个选项。对于这种情况,您可能需要CONFIG设置。错误消息试图在这里提供帮助。这些文件是否随jupyter-notebook安装一起提供?
jupyter-notebookConfig.cmake
jupyter-notebook-config.cmake如果是这样,请尝试将CMAKE_PREFIX_PATH或jupyter-notebook_DIR设置为jupyter-notebook的安装目录。因此,您可以尝试执行以下操作:
list(APPEND CMAKE_PREFIX_PATH /path/to/your/installation) # Try this one.
# SET(jupyter-notebook_DIR /path/to/your/installation) # Or try this one.
FIND_PACKAGE(jupyter-notebook CONFIG REQUIRED)如果您的安装似乎没有前面提到的CMake配置文件,也没有任何CMake支持文件( cmake目录等),那么find_program命令可能更适合jupyter-notebook。
我建议花一些时间使用find_package的documentation,因为它显式地列出了CMake用来查找包的搜索路径(按顺序)。另外,请查看此answer。
https://stackoverflow.com/questions/55839524
复制相似问题