diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d8e0c7..ca6e020 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,14 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
 set(CMAKE_BUILD_TYPE Release)
 
-set(mstch_VERSION 1.0.1)
+set(mstch_VERSION 1.0.2)
+
+string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" mstch_VERSION_MATCH "${mstch_VERSION}")
+set(mstch_VERSION_MAJOR "${CMAKE_MATCH_1}")
+set(mstch_VERSION_MINOR "${CMAKE_MATCH_2}")
+set(mstch_VERSION_PATCH "${CMAKE_MATCH_3}")
+set(mstch_SOVERSION "${mstch_VERSION_MAJOR}.${mstch_VERSION_MINOR}")
+unset(mstch_VERSION_MATCH)
 
 if(NOT MSVC)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -O3")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6517fc4..dd0dcbe 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -22,9 +22,9 @@ set(SRC
     token.cpp
     utils.cpp)
 
-add_library(mstch STATIC ${SRC})
+add_library(mstch ${SRC})
 
-set_property(TARGET mstch PROPERTY VERSION ${mstch_VERSION})
+set_property(TARGET mstch PROPERTY SOVERSION ${mstch_VERSION})
 
 install(
     TARGETS mstch EXPORT mstchTargets
