 +  ARCHIVE DESTINATION lib
 +  )
 +install(EXPORT ${targetsFile} DESTINATION lib/cmake)
+diff --git a/src/tls_openssl.c b/src/tls_openssl.c
+index 0e440c1..04f379e 100644
+--- a/src/tls_openssl.c
++++ b/src/tls_openssl.c
+@@ -49,8 +49,12 @@ static void _tls_log_error(xmpp_ctx_t *ctx);
+ 
+ void tls_initialize(void)
+ {
++#if OPENSSL_API_COMPAT < 0x10100000L
+     SSL_library_init();
+     SSL_load_error_strings();
++#else
++    OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
++#endif
+ }
+ 
+ void tls_shutdown(void)
 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
 new file mode 100644
-index 0000000..5bf5a5f
+index 0000000..dabc2ae
 --- /dev/null
 +++ b/tests/CMakeLists.txt
 @@ -0,0 +1,28 @@
 +add_library(testlib STATIC test.c test.h)
-+target_link_libraries(testlib libstrophe)
++target_link_libraries(testlib PUBLIC libstrophe)
 +set_property(TARGET testlib PROPERTY FOLDER tests)
 +set(tests
 +  check_parser

+  PREFIX "" # strip off the "lib" prefix, since it's already libstrophe
+  )
+########################################
+# install
+set(targetsFile ${PROJECT_NAME}${ver}-targets)
+install(TARGETS ${lib_name} EXPORT ${targetsFile}
+  RUNTIME DESTINATION bin

+  )
+source_group("" FILES ${${lib_name}_libsrcs})
+########################################
+add_library(${lib_name} STATIC ${${lib_name}_libsrcs})
+target_link_libraries(${lib_name} PRIVATE ${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}>
+  )
+if(DEFINED EXPAT_DEFINITIONS)
+  target_compile_definitions(${lib_name} PUBLIC ${EXPAT_DEFINITIONS})
