赞
踩
参考:使用Ubuntu-base构建根文件系统_CoooStar的博客-CSDN博客
- cmake_minimum_required(VERSION 3.18)
- include_guard(GLOBAL)
-
- set(CMAKE_SYSTEM_NAME Linux)
- set(CMAKE_SYSTEM_PROCESSOR arm)
-
- #set(TARGET_SYSROOT /home/mc/Projects/rk3588_linux/ubuntu/binary)
- set(TARGET_SYSROOT /home/mc/build_qt6_arm/rootfs)
-
- #set(CROSS_COMPILER /opt/toolchain/bin/aarch64-none-linux-gnu-)
- set(CROSS_COMPILER /usr/bin/aarch64-linux-gnu-)
- set(CMAKE_SYSROOT ${TARGET_SYSROOT})
-
- set(ENV{PKG_CONFIG_PATH} "")
- set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig)
- set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT})
-
- set(CMAKE_C_COMPILER ${CROSS_COMPILER}gcc)
- set(CMAKE_CXX_COMPILER ${CROSS_COMPILER}g++)
-
-
- set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
- set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
- set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
- set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
-
- include(CMakeInitializeConfigs)
-
- function(cmake_initialize_per_config_variable _PREFIX _DOCSTRING)
- if (_PREFIX MATCHES "CMAKE_(C|CXX|ASM)_FLAGS")
- set(CMAKE_${CMAKE_MATCH_1}_FLAGS_INIT "${QT_COMPILER_FLAGS}")
-
- foreach (config DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
- if (DEFINED QT_COMPILER_FLAGS_${config})
- set(CMAKE_${CMAKE_MATCH_1}_FLAGS_${config}_INIT "${QT_COMPILER_FLAGS_${config}}")
- endif()
- endforeach()
- endif()
-
- if (_PREFIX MATCHES "CMAKE_(SHARED|MODULE|EXE)_LINKER_FLAGS")
- foreach (config SHARED MODULE EXE)
- set(CMAKE_${config}_LINKER_FLAGS_INIT "${QT_LINKER_FLAGS}")
- endforeach()
- endif()
-
- _cmake_initialize_per_config_variable(${ARGV})
- endfunction()
- $HOME/build_qt6_arm/qt-everywhere-src-6.4.3/configure \
- -release -nomake examples -nomake tests -no-opengl \
- -qt-host-path /opt/Qt/6.4.3/gcc_64 \
- -prefix /opt/qt6-arm64 \
- -- -DCMAKE_TOOLCHAIN_FILE=$HOME/build_qt6_arm/toolchain.cmake
-
-
-
- cmake --build buildQt6 --parallel
-
-
-
- cmake --install buildQt6
参考资料
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。