diff --git a/BLAKE3Config.cmake.in b/BLAKE3Config.cmake.in
new file mode 100644
index 0000000..5a8919d
--- /dev/null
+++ b/BLAKE3Config.cmake.in
@@ -0,0 +1,4 @@
+@PACKAGE_INIT@
+
+set_and_check(BLAKE3_INCLUDE_DIR "@PACKAGE_INCLUDE_DIR@")
+include("${CMAKE_CURRENT_LIST_DIR}/BLAKE3Targets.cmake")
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..171554b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,81 @@
+cmake_minimum_required(VERSION 3.12)
+cmake_policy(VERSION ${CMAKE_VERSION})
+
+project(BLAKE3
+	VERSION 1.3.3
+	DESCRIPTION "BLAKE3 C implementation"
+	HOMEPAGE_URL "https://github.com/BLAKE3-team/BLAKE3"
+	LANGUAGES C)
+
+include(GNUInstallDirs)
+
+add_library(blake3)
+
+set(INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH
+    "The subdirectory where header files should be installed")
+
+set_target_properties(blake3 PROPERTIES
+	PUBLIC_HEADER "blake3.h"
+	SOVERSION ${PROJECT_VERSION_MAJOR}
+	VERSION ${PROJECT_VERSION})
+
+target_sources(blake3 PRIVATE
+	blake3.c
+	blake3_dispatch.c
+	blake3_portable.c)
+
+if((CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64) OR (CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64))
+	enable_language(ASM)
+	if(MSVC)
+		enable_language(ASM_MASM)
+		set(SUFFIX "windows_msvc.asm")
+	elseif(WIN32)
+		enable_language(ASM)
+		set(SUFFIX "windows_gnu.S")
+	else()
+		enable_language(ASM)
+		set(SUFFIX "unix.S")
+	endif()
+	target_sources(blake3 PRIVATE
+		blake3_avx2_x86-64_${SUFFIX}
+		blake3_avx512_x86-64_${SUFFIX}
+		blake3_sse2_x86-64_${SUFFIX}
+		blake3_sse41_x86-64_${SUFFIX})
+elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL i686)
+	target_compile_options(blake3 PRIVATE
+		-mavx2
+		-mavx512f -mavx512vl
+		-msse2
+		-msse4.1)
+	target_sources(blake3 PRIVATE
+		blake3_avx2.c
+		blake3_avx512.c
+		blake3_sse2.c
+		blake3_sse41.c)
+elseif((CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) OR
+       (ANDROID_ABI STREQUAL armeabi-v7a))
+	target_compile_definitions(blake3 PRIVATE BLAKE3_USE_NEON)
+	target_compile_options(blake3 PRIVATE -mfpu=neon)
+	target_sources(blake3 PRIVATE blake3_neon.c)
+endif()
+
+install(TARGETS blake3
+        EXPORT blake3_targets
+        PUBLIC_HEADER)
+install(EXPORT blake3_targets
+        DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
+        FILE "${PROJECT_NAME}Targets.cmake"
+        NAMESPACE "${PROJECT_NAME}::")
+
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file(
+        "${PROJECT_NAME}ConfigVersion.cmake"
+        VERSION ${PROJECT_VERSION}
+        COMPATIBILITY AnyNewerVersion)
+configure_package_config_file(
+        ${PROJECT_NAME}Config.cmake.in
+        ${PROJECT_NAME}Config.cmake
+        INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
+        PATH_VARS INCLUDE_DIR)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
+        DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
