GMP& cmake找不到MPFR,但已安装

时间:2015-10-12 09:30:20

标签: macos boost cmake gmp mpfr

我试图在mac os X 10.11上编译需要boost,GMP和MPFR的plll库。

我已经通过自制软件安装了boost,GMP和MPFR,然后我在plll的dir构建中启动了cmake,但是我得到了这个错误:

 By not providing "FindMPFR.cmake" in CMAKE_MODULE_PATH this project has
 asked CMake to find a package configuration file provided by "MPFR", but
 CMake did not find one.

 Could not find a package configuration file provided by "MPFR" with any of
the following names:

MPFRConfig.cmake
mpfr-config.cmake

Add the installation prefix of "MPFR" to CMAKE_PREFIX_PATH or set
"MPFR_DIR" to a directory containing one of the above files.  If "MPFR"
provides a separate development package or SDK, be sure it has been
installed.

如果我在cmake使用的Librairies.txt中更改GMP和MPFR的顺序,GMP也是如此。

之后我手动安装了库,他们在/ usr / local / include中。 GMP的make检查是完美的,所以我猜安装没问题。

但仍然是相同的错误消息。我还试图添加一个FindMPFR.cmake文件,但根本没有变化。

以下是Libraries.txt的一部分:

find_package(MPFR REQUIRED)
include_directories(${MPFR_INCLUDES})
if(NOT MPFR_FOUND)
    message(FATAL_ERROR "Could not find MPFR!")
endif(NOT MPFR_FOUND)
set(libraries ${libraries} ${MPFR_LIBRARIES})
set(libraries_shared ${libraries_shared} ${MPFR_LIBRARIES})

find_package(GMP REQUIRED)
include_directories(${GMP_INCLUDE_DIR})
if(NOT (GMP_INCLUDE_DIR AND GMP_LIBRARIES))
    message(FATAL_ERROR "Could not find GMP!")
endif(NOT (GMP_INCLUDE_DIR AND GMP_LIBRARIES))
set(libraries ${libraries} ${GMP_LIBRARIES})
set(libraries_shared ${libraries_shared} ${GMP_LIBRARIES})

奇怪的是,我对Boost没有任何问题......

0 个答案:

没有答案