diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ad84af5eecfb71327f9a7f50e14c86b2af58e43..71660a05516ec846b44a143628c4f2360d194098 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,7 +49,7 @@ GENERATE_CONFIGURATION_HEADER(
 
 # FIXME: to be changed into lib/dynamic-graph
 # to avoid name collision when installing dynamic-graph in /usr.
-SET(PLUGINDIR "lib/plugin")
+SET(PLUGINDIR "${CMAKE_INSTALL_LIBDIR}/plugin")
 
 # Add extra keys to pkg-config file to export the location of the
 # plug-in directory in a robust manner.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c912f908c556fd7e2c434e0fcd8a5e9359d136d5..de7b7f88dfc69b98ea27f497c38210b79a8c88f7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -63,7 +63,7 @@ IF (UNIX AND NOT APPLE)
 ENDIF (UNIX AND NOT APPLE)
 
 INSTALL(TARGETS ${LIBRARY_NAME}
-  DESTINATION lib)
+  DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
 ####################################
 ### Plugins