I've used an Ubuntu 20.4 mini server, and compiled targeting linux but for the moment didn't yet get a crosscompiled version, maybe I will continue another day, but for the moment if these two files help someone... they are able to configure project for win64 targeting, I've created them on the decompressed source root folder:
win64.cmake:
Code:
# the name of the target operating systemset(CMAKE_SYSTEM_NAME Windows)# avoid error on check cc compiling a simple program for cross-compilingset(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")# which compilers to use for C and C++set(MAKE_C_COMPILER=x86_64-w64-mingw32-gcc)set(MAKE_CXX_COMPILER=x86_64-w64-mingw32-g++)# where is the target environment locatedset(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32)# adjust the default behavior of the FIND_XXX() commands:# search programs in the host environmentset(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)# search headers and libraries in the target environmentset(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
and modified compile_muse.sh into compile_muse_win64.sh:
Code:
#!/bin/bash# (UNCHANGED LICENSE COMMENTS)echo "Remember you need to install mingw-w64 for this script to work. Also following packages are needed: qtdeclarative5-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev ladspa-sdk git cmake libsndfile1-dev libsamplerate-ocaml-dev libjack-jackd2-dev"if [ -d build ]; then echo "Build dir already exists"else echo "Create build dir" mkdir buildficd build# to put the resulting binary in a specific location add -DCMAKE_INSTALL_PREFIX=<some location>cmake -DQt5Widgets_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets" \ -DQt5UiTools_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5UiTools" \ -DQt5LinguistTools_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5LinguistTools" \ -DQt5Xml_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5Xml" \ -DQt5Svg_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5Svg" \ -DCMAKE_TOOLCHAIN_FILE="win64.cmake" \ -DCMAKE_BUILD_TYPE=release -DMODULES_BUILD_STATIC=ON .. && make clean all && echo "Build was OK, now enter the 'build' dir and run 'make install' as root"
Statistics: Posted by iagofg — Tue Oct 01, 2024 10:52 pm