Open
Description
According to the README json-fortran can be used in a CMake project by linking the library jsonfortran::jsonfortran
or jsonfortran::jsonfortran-static
:
Line 151 in cde2620
However the installation means that a different name library name is used for every installation. This comes from here:
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:
# Get compiler dependent name
string(TOLOWER "jsonfortran-${CMAKE_Fortran_COMPILER_ID}" jsonlibname)
# Create alias
add_library(jsonfortran::jsonfortran ALIAS ${jsonlibname}::jsonfortran)
however it would be simpler if jsonfortran simply installed itself with the documented name