diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06ba472..6dc7988 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,12 @@ file(GLOB SrcMacOSX    "src/macosx/*.c"
 file(GLOB SrcWayland   "src/wayland/*.c")
 file(GLOB SrcX11       "src/x11/*.c")
 
+file(GLOB HEADERS       "include/*.h")
+file(GLOB HeaderWindows "src/windows/*.h")
+file(GLOB HeaderMacOSX  "src/macosx/*.h")
+file(GLOB HeaderWayland "src/wayland/*.h")
+file(GLOB HeaderX11     "src/x11/*.h")
+
 if (NOT MSVC)
     set (CMAKE_C_FLAGS "-g -Wall -Wextra -pedantic -Wno-switch -Wno-unused-function")
     set (CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11")
@@ -34,19 +40,24 @@ if (MSVC)
     add_definitions(-D_CRT_SECURE_NO_WARNINGS)
     add_definitions(-D_WIN32_WINNT=0x0600)
     list (APPEND SrcLib ${SrcWindows})
+    list (APPEND HEADERS ${HeaderWindows})
 elseif (MINGW)
     add_definitions(-D_WIN32_WINNT=0x0600)
     list(APPEND SrcLib ${SrcWindows})
+    list (APPEND HEADERS ${HeaderWindows})
 elseif (APPLE)
     if(USE_METAL_API)
         add_definitions(-DUSE_METAL_API)
     endif()
     list(APPEND SrcLib ${SrcMacOSX})
+    list (APPEND HEADERS ${HeaderMacOSX})
 elseif (UNIX)
     if(USE_WAYLAND_API)
         list(APPEND SrcLib ${SrcWayland})
+        list (APPEND HEADERS ${HeaderWayland})
     else()
         list(APPEND SrcLib ${SrcX11})
+        list (APPEND HEADERS ${HeaderX11}) 
     endif()
 endif()
 
@@ -112,3 +123,11 @@ elseif (UNIX)
         target_link_libraries(multiple_windows -lX11)
     endif()
 endif()
+
+install(TARGETS minifb
+   RUNTIME DESTINATION bin
+   LIBRARY DESTINATION lib
+   ARCHIVE DESTINATION lib
+ )
+ 
+install(FILES ${HEADERS} DESTINATION include)
