Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find HanaConfig.cmake #39

Open
uknys opened this issue Dec 18, 2017 · 4 comments
Open

Cannot find HanaConfig.cmake #39

uknys opened this issue Dec 18, 2017 · 4 comments

Comments

@uknys
Copy link

uknys commented Dec 18, 2017

Hello,
I tried to use your library with my project but I have this error with CMake :

  CMake Error at CMakeLists.txt:17 (find_package):
  By not providing "FindHana.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Hana", but
  CMake did not find one.

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

    HanaConfig.cmake
    hana-config.cmake

I installed Boost 1.65.1 with Homebrew on macOS High Sierra, but it doesn't seem to have this file configured while I can add other Boost librairies in my CMake file.

@uknys uknys closed this as completed Dec 18, 2017
@uknys
Copy link
Author

uknys commented Dec 18, 2017

To make it work I used your script in the dependencies folder !

@ldionne
Copy link
Owner

ldionne commented Dec 19, 2017

Ahhh. Actually, I think this is a bug with the Boost distribution. When you install Boost, it should install a lib/cmake/Hana/HanaConfig.cmake file with it, but it doesn't. Reopening to keep track of this.

@ldionne ldionne reopened this Dec 19, 2017
@ldionne
Copy link
Owner

ldionne commented Jan 2, 2018

To make it work I used your script in the dependencies folder !

Make sure you're not using both that script AND a global installation of Boost, since that could cause problems.

@furkanusta
Copy link

For people experiencing the same problem and want to use a global installation of Boost, I've used:

find_package(Hana QUIET)
if (Hana_FOUND)
  target_link_libraries(dyno INTERFACE hana)
else()
  find_package(Boost 1.61)
  if (Boost_FOUND)
    target_link_libraries(dyno INTERFACE Boost::boost)
  else()
    message(SEND_ERROR "hana not found: either install stand-alone or use Boost>=1.61")
  endif()
endif()

Do the same for CallableTraits as well (but change the version to 1.64).

Also we need to change cmake/dyno-config.cmake file as well.

include(CMakeFindDependencyMacro)
find_package(Hana QUIET)
if (NOT Hana_FOUND)
  find_package(Boost 1.61 REQUIRED)
endif()

find_package(CallableTraits QUIET)
if (NOT CallableTraits_FOUND)
  find_package(Boost 1.64 REQUIRED)
endif()

# Below is the same
if(NOT TARGET Dyno::dyno)
  include("${CMAKE_CURRENT_LIST_DIR}/dyno-targets.cmake")
endif()

I am not sure whether this should be reported to Boost or packagers of my distribution but this is a workaround. I can send a PR but this feels like dirty hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants