- Notifications
You must be signed in to change notification settings - Fork15.2k
Compilation
here are theCMakeoption values available to adjust compilation (along with default values)The list is not updated regularily, so check theCMakeLists.txt files foroption andcmake_dependent_option values
WITH_DEBUG_URBDRCDump data send/received in URBDRC channelOFFBUILD_SHARED_LIBSBuild shared librariesONEXPORT_ALL_SYMBOLSExport all symbols form libraryOFFBUILD_TESTINGBuild library unit testsONWITH_LIBRARY_VERSIONINGUse library version tripletONWITH_SHADOWCompile with shadow serverONWITH_PROXYCompile with proxy serverONWITH_PLATFORM_SERVERCompile with platform serverONWITH_PROXY_EMULATE_SMARTCARDCompile proxy smartcard emulationOFFWITH_PROXY_APPCompile proxy applicationONWITH_PROXY_MODULESCompile proxy modulesONWITH_SMARTCARD_PCSCEnable smartcard PCSC backendONWITH_OPENSC_PKCS11_LINKEDDirectly link opensc-pkcs11OFFWITH_DEBUG_SCHANNELCompile support for SCHANNEL debugOFFWITH_KRB5Compile support for kerberos authentication. ${KRB5_DEFAULT}`WITH_KRB5_NO_NTLM_FALLBACKDo not fall back to NTLM if no kerberos ticket available OFFWITH_KRB5OFF`USE_UNWINDUse unwind.h to generate backtracesONWITH_LODEPNGbuild WinPR with PNG supportOFFWITH_LIBRARY_VERSIONINGUse library version tripletONBUILD_SHARED_LIBSBuild shared librariesONEXPORT_ALL_SYMBOLSExport all symbols form libraryOFFWITH_VERBOSE_WINPR_ASSERTCompile with verbose WINPR_ASSERT.ONWITH_WINPR_TOOLSBuild WinPR helper binariesONWITH_WINPR_DEPRECATEDBuild WinPR deprecated symbolsOFFWITH_DEBUG_THREADSPrint thread debug messages, enables handle dump ${DEFAULT_DEBUG_OPTION}`WITH_DEBUG_EVENTSPrint event debug messages, enables handle dump ${DEFAULT_DEBUG_OPTION}`WITH_DEBUG_SYMBOLSPack debug symbols to installerOFFWITH_NATIVE_SSPIUse native SSPI modules ${NATIVE_SSPI}`WITH_SMARTCARD_INSPECTEnable SmartCard API InspectorOFFWITH_DEBUG_MUTEXPrint mutex debug messages ${DEFAULT_DEBUG_OPTION}`WITH_INTERNAL_RC4Use compiled in rc4 functions instead of OpenSSL/MBedTLSOFFWITH_INTERNAL_MD4Use compiled in md4 hash functions instead of OpenSSL/MBedTLSOFFWITH_INTERNAL_MD5Use compiled in md5 hash functions instead of OpenSSL/MBedTLSOFFWITH_UNICODE_BUILTINUse built-in Unicode conversion (don't use system-provided librariesOFF`SSPI_DLLDefine and export SSPI API symbols for usage as a Windows SSPI DLL replacementOFFWITH_DEBUG_NTLMPrint NTLM debug messages ${DEFAULT_DEBUG_OPTION}`WITH_DEBUG_NLAPrint authentication related debug messages. ${DEFAULT_DEBUG_OPTION}`WITH_POLLCheck for and include poll.hONWITH_PKCS11encryption, certificate validation, hashing functions ${PKCS11_DEFAULT}`BUILD_SHARED_LIBSBuild shared librariesONEXPORT_ALL_SYMBOLSExport all symbols form libraryOFFBUILD_TESTINGBuild library unit testsONWITH_LIBRARY_VERSIONINGUse library version tripletONUWAC_HAVE_PIXMAN_REGIONUse PIXMAN or FreeRDP for region calculationsNOT FREERDP_UNIFIED_BUILDBUILD_TESTINGBuild automated tests.ONWITH_WEBVIEWBuild with WebView support for AAD login popup browserOFFWITH_WEBVIEW_QTBuild with QtWebEngine support for AAD login broweser popupOFFCMAKE_COLOR_MAKEFILEcolorful CMake makefileONCMAKE_VERBOSE_MAKEFILEverbose CMake makefileONCMAKE_POSITION_INDEPENDENT_CODEbuild with position independent code (-fPIC or -fPIEON`WITH_DEBUG_SDL_EVENTS[dangerous, not for release builds!] Debug SDL eventsOFFWITH_DEBUG_SDL_KBD_EVENTS[dangerous, not for release builds!] Debug SDL keyboard eventsOFFWITH_WIN_CONSOLEBuild ${PROJECT_NAME} with console supportONWITH_WINDOWS_CERT_STOREBuild ${MODULE_NAME} with additional certificate validation against windows certificate storeONWITH_WIN_CONSOLEBuild ${MODULE_NAME} with console supportOFFWITH_PROGRESS_BARBuild ${MODULE_NAME} with connect progress bar (Windows 7+ or 2008 R2+ON`CMAKE_COLOR_MAKEFILEcolorful CMake makefileONCMAKE_VERBOSE_MAKEFILEverbose CMake makefileONCMAKE_POSITION_INDEPENDENT_CODEbuild with position independent code (-fPIC or -fPIEON`CMAKE_COLOR_MAKEFILEcolorful CMake makefileONCMAKE_VERBOSE_MAKEFILEverbose CMake makefileONCMAKE_POSITION_INDEPENDENT_CODEbuild with position independent code (-fPIC or -fPIEON`WITH_XINERAMA[X11] enable xineramaONWITH_XEXT[X11] enable XextONWITH_XCURSOR[X11] enalbe XcursorONWITH_XV[X11] enable XvONWITH_XI[X11] enalbe XiONWITH_XRENDER[X11] enable XRenderONWITH_XRANDR[X11] enable XRandRONWITH_XFIXES[X11] enable XfixesONWITH_CLIENT_INTERFACEBuild clients as a library with an interfaceOFFWITH_CLIENT_MACBuild native mac clientONWITH_FUSEBuild clipboard with FUSE file copy support ${OPT_FUSE_DEFAULT}`CMAKE_COLOR_MAKEFILEcolorful CMake makefileONCMAKE_VERBOSE_MAKEFILEverbose CMake makefileONCMAKE_POSITION_INDEPENDENT_CODEbuild with position independent code (-fPIC or -fPIEON`WITH_X11build X11 client/server ${OPT_DEFAULT_VAL}`CMAKE_INTERPROCEDURAL_OPTIMIZATIONEnable LTO linking TRUE`WITH_SMARTCARD_EMULATEEmulate smartcards instead of redirecting readersOFFWITH_FREERDP_DEPRECATEDBuild FreeRDP deprecated symbolsOFFWITH_FREERDP_DEPRECATED_COMMANDLINEBuild FreeRDP deprecated command line optionsOFFBUILD_SHARED_LIBSBuild shared libraries ${LIB_DEFAULT}`EXPORT_ALL_SYMBOLSExport all symbols form libraryOFFWITH_AADCompile with support for Azure AD authenticationONWITH_OPENH264_LOADINGUse LoadLibrary to load openh264 at runtimeOFFWITH_VERBOSE_WINPR_ASSERTCompile with verbose WINPR_ASSERT.ONWITH_RDTKbuild rdtk toolkitON
- OpenSSL or MbedTLS for encryption/decryption
uriparserfor parsing clipboard urls (optional, linux only)libusbfor raw USB redirectionSound (microphone and playback) requires a encoder/decoder for various formats. That can be:
FFMPEGdoes all encoding/decoding- Use
gsm,faad2,faacforGSMandAACsupport - Use
soxrfor sound resampling
Video decoders (For GFX H264 and
/videoredirection support):H264can be supported thoughOpenH264(working only with1.8.0untilhttps://github.com/cisco/openh264/issues/3476 is resolved)FFMPEG
Image scalers (for
smart-sizingand some HighDPI features of RDP)swscalecairo
Old (Windows 7) style media redirection (deactivated by default) also requires:
- GStreamer (0.1 or 1.0)
Platform/feature dependent options:
- Android MediaCodec (h264)
- Windows MediaFramework (h264)
ALSA(sound)PULSE(sound)OSS(sound)CUPS(printing)FUSE(file clipboard)ICU(unicode)OPENSLES(sound)PCSC(smartcard)cJSON(AVD/AAD auth)libsdl2-ttf,libsdl2-imageandlibsdl2(SDL client)
RDP uses a couple of legacy algorithms deep within the protocol which might lead to problems at runtime.Ensure, that
rc4,md4andmd5are supported by yourSSLlibrary
- Also ensure you have the correct runtime configuration that allows these hashes
- Compile in
rc4,md4ormd5withWITH_INTERNAL_RC4,WITH_INTERNAL_MD4orWITH_INTERNAL_MD5
First, you'll need to get the dependencies and sources.Follow the next instructions step by step (unless the dependency is already installed on your system)
Seeoptions list of compilation options forFreeRDP.
- to build the library static add
no-sharedto theConfigureoptions - basic steps are similar on all OS, but the detailed
./Configureoptions might vary, checkhttps://wiki.openssl.org/index.php/Compilation_and_Installation for further details
git clone -b openssl-3.1.1 https://github.com/openssl/openssl.gitcd openssl./Configure mingw64 --cross-compile-prefix=x86_64-w64-mingw32- --prefix=<your install path> --libdir=<lib|lib64>make -j build_swmake -j install_swAs an alternative toOpenSSLLibreSSL can be used.Add-DWITH_LIBRESSL=ON to yourFreeRDP build to force detection ofLibreSSL
Build static or shared lib, set-DBUILD_SHARED_LIBS=ON|OFF accordingly
git clone -b v3.8.2 https://github.com/libressl/portable.git libresslcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B libressl-build \ -S libressl \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DLIBRESSL_APPS=OFF \ -DLIBRESSL_TESTS=OFFcmake --build libressl-buildcmake --install libressl-buildBuild static and shared lib
git clone --depth 1 -b v1.3 https://github.com/madler/zlib.gitcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B zlib-build \ -S zlib \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DLIBRESSL_APPS=OFF \ -DLIBRESSL_TESTS=OFF cmake --build zlib-buildcmake --install zlib-buildBuild static or shared lib, set-DBUILD_SHARED_LIBS=ON|OFF accordingly
git clone --depth 1 -b uriparser-0.9.7 https://github.com/uriparser/uriparser.gitcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B uriparser-build \ -S uriparser \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DURIPARSER_BUILD_DOCS=OFF \ -DURIPARSER_BUILD_TESTS=OFFcmake --build uriparser-buildcmake --install uriparser-buildBuild static and shared libs in one go
git clone --depth 1 -b v1.7.16 https://github.com/DaveGamble/cJSON.gitcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B cJSON-build \ -S cJSON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DENABLE_CJSON_TEST=OFF \ -DBUILD_SHARED_AND_STATIC_LIBS=ON cmake --build cJSON-buildcmake --install cJSON-buildBuild static and shared libs in one go
git clone --depth 1 -b release-2.28.1 https://github.com/libsdl-org/SDL.gitcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B SDL-build \ -S SDL \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DSDL_TEST=OFF \ -DSDL_TESTS=OFF \ -DSDL_STATIC_PIC=ON cmake --build SDL-buildcmake --install SDL-buildBuild static or shared lib, set-DBUILD_SHARED_LIBS=ON|OFF accordingly
git clone --depth 1 --shallow-submodules --recurse-submodules -b release-2.20.2 https://github.com/libsdl-org/SDL_ttf.gitcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B SDL_ttf-build \ -S SDL_ttf \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DSDL2TTF_HARFBUZZ=ON \ -DSDL2TTF_FREETYPE=ON \ -DSDL2TTF_VENDORED=ON \ -DFT_DISABLE_ZLIB=OFF \ -DSDL2TTF_SAMPLES=OFFcmake --build SDL_ttf-buildcmake --install SDL_ttf-buildBuild static or shared lib, set-DBUILD_SHARED_LIBS=ON|OFF accordingly
git clone --depth 1 --shallow-submodules --recurse-submodules -b release-2.8.1 https://github.com/libsdl-org/SDL_image.gitcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B SDL_image-build \ -S SDL_image \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DSDL2IMAGE_SAMPLES=OFF \ -DSDL2IMAGE_DEPS_SHARED=OFFcmake --build SDL_image-buildcmake --install SDL_image-buildBuild static or shared lib, set-DLIBUSB_BUILD_SHARED_LIBS=ON|OFF accordinglyNOTE: we're using a 3rd party repo here to build withCMake as that is easier to handle for cross compilation
git clone --depth 1 --shallow-submodules --recurse-submodules -b v1.0.26 https://github.com/libusb/libusb-cmake.gitcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B libusb-cmake-build \ -S libusb-cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DLIBUSB_BUILD_EXAMPLES=OFF \ -DLIBUSB_BUILD_TESTING=OFF \ -DLIBUSB_ENABLE_DEBUG_LOGGING=OFFcmake --build libusb-cmake-buildcmake --install libusb-cmake-buildseehttps://trac.ffmpeg.org/wiki/CompilationGuide/CrossCompilingForWindows for instructions
git clone --depth 1 -b n6.0 https://github.com/FFmpeg/FFmpeg.gitmkdir ffmpeg-buildcd ffmpeg-build../FFmpeg/configure --arch=x86_64 --target-os=mingw64 --cross-prefix=x86_64-w64-mingw32- --prefix=<your install dir>make -jmake -j installBuild static and shared libs in one go
https://mesonbuild.com/Cross-compilation.html
meson toolchain file
[binaries]c = 'x86_64-w64-mingw32-gcc'cpp = 'x86_64-w64-mingw32-g++'ar = 'x86_64-w64-mingw32-ar'strip = 'x86_64-w64-mingw32-strip'exe_wrapper = 'wine64'[host_machine]system = 'windows'cpu_family = 'x86_64'cpu = 'x86_64'endian = 'little'[properties]sysroot = '/usr/x86_64-w64-mingw32'git clone --depth 1 -b v2.3.1 https://github.com/cisco/openh264.gitmeson setup \ -Dprefix=<your install path> \ -Db_pie=true \ -Db_lto=true \ -Dbuildtype=release \ -Dpkgconfig.relocatable=true \ -Dtests=disabled \ -Ddefault_library=both \ openh264-build \ openh264ninja -C openh264-buildninja -C openh264-build install- Disable USB with
-DCHANNEL_URBDRC=OFF(libusb required forON) - Enable OpenH264 with
-DWITH_OPENH264=ON - Enable FFMPEG with
-DWITH_FFMPEG=ON -DWITH_SWSCALE=ON -DWITH_DSP_FFMPEG=ON - Build static binaris/libraries with
-DBUILD_SHARED_LIBS=OFFunless further instructions are available for dependency - Build fully static (including runtime) with
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded(windows)set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")(add to toolchain file, others)
NOTE: Check your c++ compiler/libs are up to date, the ones shipped with debian 12 might lack some features. In that case disable our C++ projecst with-DWITH_CLIENT_SDL=OFF -DWITH_PROXY_MODULES=OFF
git clone --depth 1 https://github.com/freerdp/freerdp.gitcmake -GNinja \ -DCMAKE_TOOLCHAIN_FILE=<full path to toolchain.cmake> \ -B freerdp-build \ -S freerdp \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \ -DCMAKE_INSTALL_PREFIX=<your install path> \ -DWITH_SERVER=ON \ -DWITH_SAMPLE=ON \ -DWITH_PLATFORM_SERVER=OFF \ -DUSE_UNWIND=OFF \ -DWITH_SWSCALE=OFF \ -DWITH_FFMPEG=OFF \ -DWITH_WEBVIEW=OFFcmake --build freerdp-buildcmake --install freerdp-build- Install
flatpakand configure "flathub.org":https://flatpak.org/setup/
- Run
flatpak-builder --repo=repo <build dir> packaging/flatpak/com.freerdp.FreeRDP.jsonfrom the checkout root - For a easy to install package run
flatpak build-bundle repo com.freerdp.FreeRDP.flatpak com.freerdp.FreeRDP --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
flatpak install com.freerdp.FreeRDP.flatpakfor bundle
sudo apt build-dep freerdp-x11 orsudo apt build-dep freerdp2-x11
ln -s packaging/deb/freerdp-nightly debiandpkg-buildpackage
debian based
- ensure you have enabled
contrib non-freeondebianin/etc/apt/sources.list - ensure you have enabled
universe multiverseonubuntuin/etc/apt/sources.list - the following installs all (even optional) libraries to build everything
FreeRDPis capable of supporting:
sudo apt-get install \ ninja-build \ build-essential \ git-core \ debhelper \ cdbs \ dpkg-dev \ cmake \ cmake-curses-gui \ clang-format \ ccache \ opencl-c-headers \ ocl-icd-opencl-dev \ libmp3lame-dev \ libopus-dev \ libsoxr-dev \ libpam0g-dev \ pkg-config \ xmlto \ libssl-dev \ docbook-xsl \ xsltproc \ libxkbfile-dev \ libx11-dev \ libwayland-dev \ libxrandr-dev \ libxi-dev \ libxrender-dev \ libxext-dev \ libxinerama-dev \ libxfixes-dev \ libxcursor-dev \ libxv-dev \ libxdamage-dev \ libxtst-dev \ libcups2-dev \ libpcsclite-dev \ libasound2-dev \ libpulse-dev \ libgsm1-dev \ libusb-1.0-0-dev \ uuid-dev \ libxml2-dev \ libfaad-dev \ libfaac-dev \ libsdl2-dev \ libsdl2-ttf-dev \ libcjson-dev \ libpkcs11-helper-dev \ liburiparser-dev \ libkrb5-dev \ libsystemd-dev \ libfuse3-dev \ libswscale-dev \ libcairo2-dev \ libavutil-dev \ libavcodec-dev \ libswresample-dev \ libwebkit2gtk-4.0-dev \ libpkcs11-helper1-devFedora 39 and close relatives
- ensure you have 3rdparty repositories enabled
- the following installs all required dependencies (even optional ones) to build
FreeRDP:
sudo dnf -y install \ ninja-build \ cups-devel \ systemd-devel \ libuuid-devel \ pulseaudio-libs-devel \ gcc-c++ libXrandr-devel \ gsm-devel \ gcc \ cmake \ ccache \ git-clang-format \ pam-devel \ fuse3-devel \ opus-devel \ lame-devel \ ocl-icd-devel \ docbook-style-xsl \ openssl-devel \ libX11-devel \ libXext-devel \ libXinerama-devel \ libXcursor-devel \ libXi-devel \ libXdamage-devel \ libXv-devel \ libxkbfile-devel \ alsa-lib-devel \ openh264-devel \ libavcodec-free-devel \ libavformat-free-devel \ libavutil-free-devel \ libswresample-free-devel \ libswscale-free-devel \ libusb1-devel \ uriparser-devel \ SDL2-devel \ SDL2_ttf-devel \ pkcs11-helper-devel \ webkit2gtk4.0-devel \ krb5-devel \ cjson-devel \ cairo-devel \ soxr-devel \ wayland-devel \ wayland-protocols-develcompilation & installation
proceed with the build as described inBuild FreeRDP
- Builds have been tested on linux hosts, so your mileage on MacOS and Windows may vary (please add additional instructions here if you are using such a build host)
- Android SDK and NDK need to be installed
To build first simply run:
./scripts/android-build-freerdp.sh \ --ndk <path_to_ndk> \ --sdk <path_to_sdk> \ --conf android-build-release.confthe script can be found in the repo:
configuration file examples atandroid-build.conf
for the native dependency build and then open the project in AndroidStudio / run./gradlew just like with any other android project.
If you're using MacPorts then just install FreeRDP port:
sudo port install FreeRDP
FreeRDP is now available as a homebrew recipe.
brew install freerdp
Use it likexfreerdp ...
- create a toolchain file for your system:
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"for a universal build (or just set the architecture if you only want one)-DCMAKE_OSX_DEPLOYMENT_TARGET=14to set-mmacosx-version-minto macOS 14 (or any other version you desire and is supported by your toolchain)
- with that toolchain then proceed with the build as described incommon
The following script downloads builds and installs FreeRDP on mac.
- It installs everything to
install/subdirectory of where the script is called from - It does not link external stuff from
breworports - It is build without
FFMPEG
- Visual Studio or Windows SDK
- "meson":https://mesonbuild.com/ (also contains 'ninja')
- "cmake":https://cmake.org/
- "nasm":https://www.nasm.us
- "perl":https://www.perl.org
- Start a visual studio command prompt (or windows sdk prompt) (
vcvars_all.bat)- Ensure the correct environment is used (32 or 64 bit)
- Ensure
meson,cmake,ninja,nasm,perlandgitare in yourPATH - from that prompt then proceed with the build as described incommon
- Install dependencies and compilers for mingw
- Create a toolchain file for
CMaketo pick up libraries/compilershttps://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html (fedora hasmingw64-cmakedoing that for you) cmake -GNinja -B<builddir> -S<sourcedir> -DCMAKE_TOOLCHAIN_FILE=<toolchain.cmake> -DCMAKE_INSTALL_PREFIX=<install prefix>cmake --build <builddir> --target install
with Fedora it is quite easy to do, just
- Install
sudo dnf install mingw64-zlib.noarch mingw64-winpthreads.noarch mingw64-pixman.noarch mingw64-openssl.noarch mingw64-libstdc++.x86_64 mingw64-libgcc.x86_64 mingw64-jsoncpp.noarch mingw64-SDL2.noarch mingw64-SDL2_ttf.noarch mingw64-crt.noarch mingw64-fontconfig.noarch mingw64-gsm.noarch mingw64-harfbuzz.noarch mingw64-gcc-c++.x86_64 mingw64-gcc.x86_64 mingw64-libgcc.x86_64- then proceed with the build as described incommon (replace
cmakeconfiguration calls withmingw64-cmake)
SET(CMAKE_SYSTEM_NAME Windows CACHE STRING "toolchain default")SET(CMAKE_SYSTEM_PROCESSOR amd64 CACHE STRING "toolchain default")SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc CACHE STRING "toolchain default")SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++ CACHE STRING "toolchain default")SET(CMAKE_RC_COMPILER_INIT /usr/bin/x86_64-w64-mingw32-windres CACHE STRING "toolchain default")SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres CACHE STRING "toolchain default")SET(CMAKE_AR /usr/bin/x86_64-w64-mingw32-ar CACHE STRING "toolchain default")SET(CMAKE_C_COMPILER_AR /usr/bin/x86_64-w64-mingw32-ar CACHE STRING "toolchain default")SET(CMAKE_CXX_COMPILER_AR /usr/bin/x86_64-w64-mingw32-ar CACHE STRING "toolchain default")SET(CMAKE_RANLIB /usr/bin/x86_64-w64-mingw32-ranlib CACHE STRING "toolchain default")SET(CMAKE_C_COMPILER_RANLIB /usr/bin/x86_64-w64-mingw32-ranlib CACHE STRING "toolchain default")SET(CMAKE_CXX_COMPILER_RANLIB /usr/bin/x86_64-w64-mingw32-ranlib CACHE STRING "toolchain default")SET(CMAKE_LINKER /usr/bin/x86_64-w64-mingw32-ld CACHE STRING "toolchain default")SET(CMAKE_NM /usr/bin/x86_64-w64-mingw32-nm CACHE STRING "toolchain default")SET(CMAKE_READELF /usr/bin/x86_64-w64-mingw32-readelf CACHE STRING "toolchain default")SET(CMAKE_OBJCOPY /usr/bin/x86_64-w64-mingw32-objcopy CACHE STRING "toolchain default")SET(CMAKE_OBJDUMP /usr/bin/x86_64-w64-mingw32-objdump CACHE STRING "toolchain default")SET(CMAKE_SYSROOT /usr/x86_64-w64-mingw32 CACHE STRING "toolchain default")set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER CACHE STRING "toolchain default")set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE STRING "toolchain default")set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE STRING "toolchain default")set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY CACHE STRING "toolchain default")ForCMake based projects you need to add the following to your command line (or add to the toolchain with theset(VARIABLE_NAME <install prefix>) syntax) to control installation and library search locations:
-DCMAKE_INSTALL_PREFIX=<install path> \-DCMAKE_PREFIX_PATHS=<install path> \-DCMAKE_FIND_ROOT_PATH=<install path>then proceed with the build as described incommon