我通过尝试两种安装方式来安装愚蠢。
brew install folly
./build/bootstrap-osx-homebrew.sh
我已验证它已正确安装在该位置/usr/local/Cellar/folly/2017.10.23.00
。
现在我正在尝试在CLion
. 这是我的CMakeLists.txt
文件。
cmake_minimum_required(VERSION 3.7)
project(HelloWorld)
message(STATUS "start running cmake....")
set(folly_DIR /usr/local/Cellar/folly/2017.10.23.00)
find_package(Boost 1.66)
find_package(folly 2017.10.23.00)
set(CMAKE_CXX_STANDARD 14)
if(Boost_FOUND)
message(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}")
message(STATUS "Boost_VERSION: ${Boost_VERSION}")
include_directories(${Boost_INCLUDE_DIRS})
endif()
if(folly_FOUND)
message(STATUS "folly_INCLUDE_DIRS: ${folly_INCLUDE_DIRS}")
message(STATUS "folly_LIBRARIES: ${folly_LIBRARIES}")
message(STATUS "folly_VERSION: ${folly_VERSION}")
include_directories(${folly_INCLUDE_DIRS})
endif()
set(SOURCE_FILES main.cpp)
add_executable(HelloWorld ${SOURCE_FILES})
if(Boost_FOUND)
target_link_libraries(HelloWorld ${Boost_LIBRARIES})
endif()
if(folly_FOUND)
target_link_libraries(HelloWorld ${folly_LIBRARIES})
endif()
我得到的错误是:
By not providing "Findfolly.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "folly", but
CMake did not find one.
Could not find a package configuration file provided by "folly" (requested
version 2017.10.23.00) with any of the following names:
follyConfig.cmake
folly-config.cmake
Add the installation prefix of "folly" to CMAKE_PREFIX_PATH or set
"folly_DIR" to a directory containing one of the above files. If "folly"
provides a separate development package or SDK, be sure it has been
installed.
我设置folly_DIR
在顶部,但仍然无法找到。我究竟做错了什么?