 +foreach(exe ${examples})
 +  add_executable(${exe} ${exe}.c)
 +  target_link_libraries(${exe} libstrophe expat resolv) # TODO library dependencies
++  set_property(TARGET ${exe} PROPERTY FOLDER examples)
 +endforeach()
 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
 new file mode 100644

+  test_string
+  )
+foreach(exe ${tests})
+  if(EXISTS ${exe}.c) # there are some tests only in repo, not in download
+    add_executable(${exe} ${exe}.c)
+    target_link_libraries(${exe} testlib)
+    add_test(NAME ${exe} COMMAND ${exe})
+  endif()
+endforeach()

+install(FILES strophe.h DESTINATION include${verDir}/${PROJECT_NAME})
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 0000000..fa052a0
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(examples
+  active
+  basic
