-
Notifications
You must be signed in to change notification settings - Fork 85
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
CMake installs under unexpected package name #579
Comments
this will be good, I do some TOLOWER shenanigans to link to json-fortran in my cmake project, thanks for this! |
Some thoughts on this and questions:
|
I think this is optional. It could be a breaking change or the documented name could be introduced as an alias. If it is an alias then both names would co-exist allowing users to choose whichever name is easier.
This should still be possible. I am suggesting that you keep the command:
which looks for a Currently your documentation claims that you no longer differentiate after locating the package but the implementation doesn't match the documentation and there are no existing CMake variables that make it easy to get the name of the loaded library. Hence the workaround (which is equivalent to what I am suggesting adding to jsonfortran directly)
I am not familiar with conda packages but I had a look through. I don't think anything would need to be changed there. This change should only affect users it will not affect which files are generated by json-fortran or how they are generated. It will just add a line to one of those files
Every other library that I have worked with (eg. MPI/HDF5) uses a library name like
seems like a good one to me. It is just strange to then have this affect the rest of the code. |
According to the README json-fortran can be used in a CMake project by linking the library
jsonfortran::jsonfortran
orjsonfortran::jsonfortran-static
:json-fortran/README.md
Line 151 in cde2620
However the installation means that a different name library name is used for every installation. This comes from here:
json-fortran/CMakeLists.txt
Lines 111 to 114 in cde2620
The library names are therefore actually more like:
jsonfortran-nvhpc::jsonfortran
. This is particularly cumbersome as the compiler id in CMake is uppercase but the library uses lowercase.As a workaround it is possible to use the documented name by doing:
however it would be simpler if jsonfortran simply installed itself with the documented name
The text was updated successfully, but these errors were encountered: