--- a/src/gromacs/InstallLibInfo.cmake
+++ b/src/gromacs/InstallLibInfo.cmake
@@ -37,7 +37,7 @@
         if (IS_ABSOLUTE ${_dir})
             set(PKG_CFLAGS "${PKG_CFLAGS} -I${_dir}")
         else()
-            set(PKG_CFLAGS "${PKG_CFLAGS} -I${CMAKE_INSTALL_PREFIX}/${_dir}")
+            set(PKG_CFLAGS "${PKG_CFLAGS} -I\$\{prefix\}/${_dir}")
         endif()
     endforeach()
     if (INSTALLED_HEADER_DEFINITIONS)
