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

[package] ghc-filesystem/1.5.8: incorrect name of [pakcage]config.cmake on linux and windows #9357

Closed
sxsong1207 opened this issue Feb 12, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@sxsong1207
Copy link

sxsong1207 commented Feb 12, 2022

The config.cmake file generated on Linux and Windows have different names, which is supposed to be consistent.
The package ghc-filesystem/1.5.8 generates FindghcFilesystem.cmake on Linux, but generates Findghc-filesystem.cmake on windows, which makes the cmake failed to find the package.

The issue is supposed to be minor.

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: name
  • Operating System+version: Linux Ubuntu 20.04 and Win10 x64
  • Compiler+version: GCC 9.3 + **Visual Studio 19 **
  • Conan version: conan 1.45.0

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

Steps to reproduce (Include if Applicable)

no specific reproduce.

@sxsong1207 sxsong1207 added the bug Something isn't working label Feb 12, 2022
@SpaceIm
Copy link
Contributor

SpaceIm commented Feb 12, 2022

Steps to reproduce is important. Basically I don't reproduce this issue.

@sxsong1207
Copy link
Author

Hi, I found a test code you wrote for ghcFilesystem. This is what I am facing, seems you have aware of that.

if(GHC_FILESYSTEM_VERSION VERSION_LESS "1.5.2")
    find_package(ghcFilesystem REQUIRED CONFIG)
else()
    find_package(ghc_filesystem REQUIRED CONFIG)
endif()

I think the difference is caused by the difference in operating systems. Since I required exactly the same version of ghc_filesystem.

I use Linux Mint 20.3 ( equivalent to Ubuntu 20.04) and Windows 10 ( vs2019 build tools). The following code is what I used to solve the dependencies. As you noticed, an If statement is used to determine the name of ghc-filesystem. The code works but I suppose the generated name should be consistent regarding different operating systems.

conan_cmake_configure(
        REQUIRES
        ghc-filesystem/1.5.8
        GENERATORS cmake_find_package
        OPTIONS ${CONAN_CMAKE_OPTIONS}
)

conan_cmake_autodetect(settings)

conan_cmake_install(PATH_OR_REFERENCE .
        BUILD missing
        REMOTE conancenter
        SETTINGS ${settings})

if(WIN32)
    find_package(ghc_filesystem REQUIRED)
else()
    find_package(ghcFilesystem REQUIRED)
endif()

@SpaceIm
Copy link
Contributor

SpaceIm commented Feb 14, 2022

I'm a bit confused.
First you said that FindghcFilesystem.cmake was generated on Linux, and Findghc-filesystem.cmake on Windows. And now you say it's Findghc_filesystem.cmake on Windows.

What I can say is:

  • upstream author has fixed config file in 1.5.2, see Fix config installation gulrak/filesystem#93 (nothing was generated, and now it's ghc_filesystem-config.cmake).
  • since conan-center mimics upstream config files, therefore I've fixed the config file name for versions greater or equal than 1.5.2 in ghc-filesystem: modernize #9238. Since it was broken before 1.5.2, maybe I should have just set ghc_filesystem as config file name regardless of the version.

Now I guess that on Linux, you have the old revision of ghc-filesystem recipe, still generating FindghcFilesystem.cmake for 1.5.8. But on Windows you have the latest revision of this recipe. Use the latest revision on both OS, and you won't need anymore this OS branching in your CMakeLists, it will be find_package(ghc_filesystem REQUIRED).

@SpaceIm
Copy link
Contributor

SpaceIm commented Feb 14, 2022

since conan-center mimics upstream config files, therefore I've fixed the config file name for versions greater or equal than 1.5.2 in #9238. Since it was broken before 1.5.2, maybe I should have just set ghc_filesystem as config file name regardless of the version.

I've submitted #9383 to make things simpler and avoid confusion: only one config file name regardless of the version,ghc_filesystem-config.cmake.

@sxsong1207
Copy link
Author

Thank you so much, that was great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants