只是试图创建我的第一个cmake项目。我有一个非常简单的设置,但似乎无法让find_package工作。我在Mac OS X 10.9.3上,并从dmg软件包(cmake 2.8.12.2版)中安装了cmake。我已经创建了一个非常简单的CMakeLists.txt如下:cmake find_package无法在Mac OS X上工作
cmake_minimum_required (VERSION 2.8)
project (Tutorial)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} “${CMAKE_SOURCE_DIR}/cmake/Modules”)
message(STATUS ${CMAKE_MODULE_PATH})
FIND_PACKAGE(GSL REQUIRED)
add_executable(Tutorial src/main.cpp)
,并放置在FindGSL.cmake文件中的cmake /模块的文件夹(下载)如由我的终端输出:
bash-3.2$ ls cmake/Modules/
FindGSL.cmake
然后,我从cmake得到以下输出:
bash-3.2$ cmake ../
-- “/Users/adam/repos/ctmc/cmake/Modules”
CMake Error at CMakeLists.txt:6 (FIND_PACKAGE):
By not providing "FindGSL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "GSL", but
CMake did not find one.
Could not find a package configuration file provided by "GSL" with any of
the following names:
GSLConfig.cmake
gsl-config.cmake
Add the installation prefix of "GSL" to CMAKE_PREFIX_PATH or set "GSL_DIR"
to a directory containing one of the above files. If "GSL" provides a
separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
See also "/Users/adam/repos/ctmc/build/CMakeFiles/CMakeOutput.log".
任何人都可以指出我做错了什么?
适合我。你确定存在'/ Users/adam/repos/ctmc/cmake/Modules/FindGSL.cmake'文件吗? –
奇怪的是,在发现者和命令行检查似乎没有找到它,想知道它是权限的文件或我需要设置一些环境变量!我将在另一台计算机上尝试返回 – madawilliams
我也在Linux机器上尝试过,并得到相同的错误。如果FindGSL.cmake文件中存在错误,它会提供此消息 – madawilliams