BlueBrain / MorphIO

A python and C++ library for reading and writing neuronal morphologies
https://morphio.readthedocs.io
Apache License 2.0
26 stars 22 forks source link

How to make use of external `ghc_filesystem` library #474

Open penguinpee opened 11 months ago

penguinpee commented 11 months ago

I'm trying to update MorphIO to the latest release in Fedora. Since we already have ghc_filesystem packaged as gulrak-filesystem (different name to avoid clashes with Haskell packages), I would like to use that.

I followed the example of HighFive which allows for either using the external library or the bundled (git submodule) version. Please see my fork for details of the patch.

With that patch applied the build fails with:

CMake Error at src/CMakeLists.txt:64 (target_include_directories):
  Error evaluating generator expression:

    $<TARGET_PROPERTY:ghc_filesystem,INTERFACE_INCLUDE_DIRECTORIES>

  Target "ghc_filesystem" not found.

This is where my knowledge of cmake ends. What else do I need to change to make MorphIO / cmake use the library available locally?

I've run cmake with --debug-find-pkg=ghc_filesystem and that told me the package was found:

  find_package considered the following locations for ghc_filesystem's Config
  module:

    /builddir/build/BUILD/MorphIO-3.3.6/redhat-linux-build/CMakeFiles/pkgRedirects/ghc_filesystemConfig.cmake
    /builddir/build/BUILD/MorphIO-3.3.6/redhat-linux-build/CMakeFiles/pkgRedirects/ghc_filesystem-config.cmake
    /usr/ghc_filesystemConfig.cmake
    /usr/ghc_filesystem-config.cmake
    /usr/lib64/cmake/ghc_filesystem/ghc_filesystemConfig.cmake
    /usr/lib64/cmake/ghc_filesystem/ghc_filesystem-config.cmake

  The file was found at

    /usr/lib64/cmake/ghc_filesystem/ghc_filesystem-config.cmake
penguinpee commented 11 months ago

I've got it building by removing the "offending" line (and the one preceding it) from src/CMakeLists.txt.