I installed folly by attempting both ways of installation.
brew install folly
./build/bootstrap-osx-homebrew.sh
I have verified that it's installed correctly at the location /usr/local/Cellar/folly/2017.10.23.00
.
Now I'm trying to use it in a HelloWorld project in CLion
. Here is my CMakeLists.txt
file.
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()
The error I get is:
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.
I'm setting folly_DIR
right at the top but it's still unable to find. What am I doing wrong?