diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f7fc27..6062da7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,11 +84,20 @@ set(SOURCE_FILES
 source_group(include FILES ${INCLUDE_FILES})
 source_group(source FILES ${SOURCE_FILES})
 
-add_library(enet STATIC
+add_library(enet
     ${INCLUDE_FILES}
     ${SOURCE_FILES}
 )
 
-if (MINGW)
+if (WIN32)
+    if (BUILD_SHARED_LIBS)
+        add_definitions(-DENET_DLL=1)
+    endif()
+
     target_link_libraries(enet winmm ws2_32)
 endif()
+
+install(FILES ${INCLUDE_FILES} DESTINATION ${INCLUDE_FILES_PREFIX})
+install(TARGETS enet RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+                     LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+                     ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
