 diff --git a/CMakeLists.txt b/CMakeLists.txt
 new file mode 100644
-index 0000000..80ca3f8
+index 0000000..eeab699
 --- /dev/null
 +++ b/CMakeLists.txt
-@@ -0,0 +1,57 @@
+@@ -0,0 +1,64 @@
 +cmake_minimum_required(VERSION 3.0)
 +project(libstrophe)
 +include(flags OPTIONAL)

+  sock.c
+  sock.h
+  stanza.c
+  tls_dummy.c
+  #tls_gnutls.c # tls_openssl instead
+  tls.h
+  tls_openssl.c

+########################################
+# library
+add_library(${lib_name} STATIC ${${lib_name}_libsrcs})
+target_link_libraries(${lib_name} ${EXPAT_LIBRARIES} ${OPENSSL_LIBRARIES} ${SYS_LIBS})
+target_include_directories(${lib_name} PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
+  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+  PRIVATE
+  $<BUILD_INTERFACE:${EXPAT_INCLUDE_DIRS}>
+  $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>
+  )
+set_target_properties(${lib_name} PROPERTIES
+  OUTPUT_NAME ${lib_name}${ver}
