title: CMake - Compile in Linux, Execute in Windows
body: <p>I have a large codebase with Linux dependencies, and I would like to use CMake to compile my code into an executable that can be run on Windows, i.e. I want CMake to produce an &quot;.exe&quot; file or something of that nature.</p>
  <p>I have tried using the solution provided on the CMake website: <a href="https://cmake.org/cmake/help/v3.4/manual/cmake-toolchains.7.html#cross-compiling" rel="nofollow noreferrer">https://cmake.org/cmake/help/v3.4/manual/cmake-toolchains.7.html#cross-compiling</a>
  however it has not worked...</p>
  <p>Here is my CMakeLists.txt</p>
  <pre><code>cmake_minimum_required(VERSION 3.10)
  project(myProject VERSION 1.0 LANGUAGES C CXX)
  set(CMAKE_CROSSCOMPILING true)
  set(CMAKE_SYSTEM_NAME Windows)
  set(CMAKE_SYSTEM_VERSION 10.0)
  set(CMAKE_SYSTEM_PROCESSOR arm)
  find_package(... *all my required packages* REQUIRED)
  include(... *required include files*)
  add_executable(${PROJECT_NAME} ...)
  target_link_libraries(${PROJECT_NAME} ...)
  </code></pre>
  <p>It compiles and will execute on Linux, however I want it to produce a Windows compatible executable.</p>