title: Compile project using Poco(with Crypto/NetSSL enabled) on Windows and crosscompile it on Linux ARM
body: <p><strong>Overview:</strong>
  I am working on commandline server application (C++) which is using POCO libraries. We had working CI on gitlab compiling this project on Windows x64, Linux x64&amp;x86, Linux arm 32b. We ran client and server on the same machine before, but they want us to make it run over the internet. Due to Poco TCP server utilization it is already possible but I need to integrate encryption( SSL).</p>
  
  <p>After I turned on encryption parts in POCO library project became uncompilable on Windows and ARM because of the OpenSSL dependency. On Linux TCP Server with encryption works fine.</p>
  
  <p><strong>Windows problems:</strong>
  I tried install openSSL in various ways and to different folders, cmake finds it but in the end of compilation there are some files missing. I found on forums that there are changes needed to be made to make POCO run with standard OpenSSL, I do not know what changes (If I knew I would try to do it). I tried to use precompiled OpenSSL from poco library but it throws lot of errors (missing files) during isntallation.
  Here is the link on standard OpenSSL I used(not light version, installed both 32 a 64b): <a href="https://slproweb.com/products/Win32OpenSSL.html" rel="nofollow noreferrer">https://slproweb.com/products/Win32OpenSSL.html</a></p>
  
  <p><strong>Linux ARM crosscompilation problems:</strong>
  This ends up on OpenSSL too (so I decided to write it all in one post despite platform differences). I succesfully compile OpenSSL on ARM platfom from the authors gitlab repo but cmake is unable to find it, even when I am setting cmake system variable to right path. OpenSSL is also installed on the machine (but this hardly helps because it is not arm machine).</p>
  
  <p>EDIT: Problem is possible caused by includes I have all encryption related stuff in one class, includes from .h file:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include "Poco/Net/SocketReactor.h"
  #include "Poco/Net/SocketAcceptor.h"
  #include "Poco/Net/SocketNotification.h"
  #include "Poco/Net/SecureServerSocket.h"
  #include "Poco/NObserver.h"
  #include "Poco/Exception.h"
  #include "Poco/Thread.h"
  #include "Poco/FIFOBuffer.h"
  #include "Poco/Delegate.h"
  #include "Poco/Util/ServerApplication.h"
  #include "Poco/Util/Option.h"
  #include "Poco/Util/OptionSet.h"
  #include "Poco/Util/HelpFormatter.h"
  #include &lt;iostream&gt;
  #include "ProcessUtils.h"
  #include "ServiceHandler.h"
  </code></pre>
  
  <p>.cpp:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include "Poco/Net/Context.h"
  #include &lt;iostream&gt;
  #include &lt;signal.h&gt;
  #include &lt;thread&gt;
  #include &lt;Sleep.h&gt;
  #include &lt;common/Version.h&gt;
  #include &lt;AppConfig.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;SecuredServerRuntime.h&gt;
  </code></pre>
  
  <p>How I am using it:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>Poco::Net::Context secureContext(Poco::Net::Context::SERVER_USE, key, certificate, "", Poco::Net::Context::VERIFY_RELAXED, 9, false);
              Poco::Util::Application::instance().logger().information("Listening on IP address %s:%d", this-&gt;address, (int)port);
              SecureServerSocket svs(sa, 64, &amp;secureContext);
              SocketReactor reactor;
              SocketAcceptor&lt;ServiceHandler&gt; acceptor(svs, reactor);
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <p>Cmake:</p>
  
  <pre><code>list(APPEND LIBRARIES )
  
  #region POCO setup
  # list all enabled libraries and set include paths
  foreach (POCOLIB Foundation XML Util Net NetSSL Crypto JSON)
          list(APPEND LIBRARIES Poco${POCOLIB})
          target_include_directories(${PROJECT_NAME} PRIVATE lib/Poco/${POCOLIB}/include)
  endforeach ()
  target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
  </code></pre>
  
  <p>in cmake list in dependecies folder is line "include(Poco.cmake)"</p>
  
  <p>Poco.cmake:</p>
  
  <pre><code>get_filename_component(THIS_FILE ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
  message(STATUS "Configuring ${THIS_FILE}")
  
  # and set the options for POCO
  set(ENABLE_CPPUNIT OFF CACHE BOOL "Enable the CppUnit" FORCE)
  set(ENABLE_XML ON CACHE BOOL "Enable the XML" FORCE)
  set(ENABLE_JSON ON CACHE BOOL "Enable the JSON" FORCE)
  set(ENABLE_MONGODB OFF CACHE BOOL "Enable MongoDB" FORCE)
  set(ENABLE_PDF OFF CACHE BOOL "Enable PDF" FORCE)
  set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE)
  set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE)
  set(ENABLE_NETSSL ON CACHE BOOL "Enable NetSSL" FORCE)
  set(ENABLE_NETSSL_WIN ON CACHE BOOL "Enable NetSSL Windows" FORCE)
  set(ENABLE_CRYPTO ON CACHE BOOL "Enable Crypto" FORCE)
  set(ENABLE_DATA OFF CACHE BOOL "Enable Data" FORCE)
  set(ENABLE_DATA_SQLITE OFF CACHE BOOL "Enable Data SQlite" FORCE)
  set(ENABLE_DATA_MYSQL OFF CACHE BOOL "Enable Data MySQL" FORCE)
  set(ENABLE_DATA_POSTGRESQL OFF CACHE BOOL "Enable Data PosgreSQL" FORCE)
  set(ENABLE_DATA_ODBC OFF CACHE BOOL "Enable Data ODBC" FORCE)
  set(ENABLE_SEVENZIP OFF CACHE BOOL "Enable SevenZip" FORCE)
  set(ENABLE_ZIP OFF CACHE BOOL "Enable Zip" FORCE)
  set(ENABLE_APACHECONNECTOR OFF CACHE BOOL "Enable ApacheConnector" FORCE)
  set(ENABLE_CPPPARSER OFF CACHE BOOL "Enable C++ parser" FORCE)
  set(ENABLE_POCODOC OFF CACHE BOOL "Enable Poco Documentation Generator" FORCE)
  set(ENABLE_PAGECOMPILER OFF CACHE BOOL "Enable PageCompiler" FORCE)
  set(ENABLE_PAGECOMPILER_FILE2PAGE OFF CACHE BOOL "Enable File2Page" FORCE)
  set(ENABLE_REDIS OFF CACHE BOOL "Enable Redis" FORCE)
  
  # build static
  set(POCO_STATIC ${STATIC_LINKING} CACHE BOOL "Set to OFF|ON (default is OFF) to control build of POCO as STATIC library" FORCE)
  set(POCO_MT OFF CACHE BOOL "Set to OFF|ON (default is OFF) to control build of POCO as /MT instead of /MD" FORCE)
  
  message(STATUS "POCO static = ${POCO_STATIC}")
  
  # parallel build
  #set(ENABLE_MSVC_MP ${${PROJECT_NAME}_PARALLEL_BUILD} CACHE BOOL "Set to OFF|ON (default is OFF) to control parallel build with MSVC" FORCE)
  
  if (NOT TARGET Foundation)
      add_subdirectory(Poco)
  endif ()
  
  </code></pre>