--- a/json-fortran.pc.cmake.in
+++ b/json-fortran.pc.cmake.in
@@ -1,5 +1,6 @@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
 
 Name: json-fortran
 Description: @PROJECT_DESCRIPTION@
