--- a/cmake/spglib.pc.in
+++ b/cmake/spglib.pc.in
@@ -1,5 +1,6 @@
+prefix=@CMAKE_INSTALL_PREFIX@
 Name: @PROJECT_NAME@
 Description: The spglib library
 Version: @PROJECT_VERSION@
-Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lsymspg
-Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@
+Libs: -L${prefix}/@CMAKE_INSTALL_LIBDIR@ -lsymspg
+Cflags: -I${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
--- a/fortran/spglib_f08.pc.in
+++ b/fortran/spglib_f08.pc.in
@@ -1,7 +1,8 @@
+prefix=@CMAKE_INSTALL_PREFIX@
 Name: @PROJECT_NAME@
 Description: The spglib f08 library
 Version: @PROJECT_VERSION@
 
 Requires: spglib
-Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lspglib_f08 -lsymspg
-Cflags: -I@CMAKE_INSTALL_FULL_MODULEDIR@
+Libs: -L${prefix}/@CMAKE_INSTALL_LIBDIR@ -lspglib_f08 -lsymspg
+Cflags: -I${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
