是否可以使用cmake find_package()定位jupyter_notebook安装?
我尝试了
iOS
但是会错误
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!
答案 0 :(得分:1)
使用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笔记本电脑。
我建议花一些时间在find_package
的{{3}}上,因为它明确列出了CMake用于查找软件包的搜索路径(按顺序)。另外,请查看此documentation。