diff --git a/CMakeLists.txt b/CMakeLists.txt
index acbb99792..52423b3ef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,14 +71,6 @@ else()
 endif()
 set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
 
-# Make relative paths absolute (needed later on)
-foreach(p LIB BIN INCLUDE CMAKE)
-  set(var INSTALL_${p}_DIR)
-  if(NOT IS_ABSOLUTE "${${var}}")
-    set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
-  endif()
-endforeach()
-
 macro (ms_link_libraries)
   if(BUILD_DYNAMIC)
     target_link_libraries(mapserver ${ARGV})
@@ -1019,6 +1011,7 @@ endif(BUILD_STATIC)
 if(BUILD_DYNAMIC)
    INSTALL(TARGETS mapserver
            EXPORT mapserverTargets
+           RUNTIME DESTINATION ${INSTALL_BIN_DIR} COMPONENT shlib
            ARCHIVE DESTINATION ${INSTALL_LIB_DIR} COMPONENT shlib
            LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT shlib
            PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR}/mapserver COMPONENT dev
