From df17721f885d5433b1ea6c3afd75d33d781f1426 Mon Sep 17 00:00:00 2001 From: Angelo Compagnucci Date: Tue, 28 Apr 2020 16:46:00 +0200 Subject: [PATCH] package/environment-setup: add cmake alias In order to simplify the usage of a buildroot toolchain within the buildroot shell, a "cmake" alias is provided to call cmake with the correct toolchain file and options. Signed-off-by: Angelo Compagnucci Signed-off-by: Thomas Petazzoni --- package/environment-setup/environment-setup | 1 + package/environment-setup/environment-setup.mk | 3 +++ 2 files changed, 4 insertions(+) diff --git a/package/environment-setup/environment-setup b/package/environment-setup/environment-setup index 58701e4c71..813aa01c7a 100644 --- a/package/environment-setup/environment-setup +++ b/package/environment-setup/environment-setup @@ -12,6 +12,7 @@ Some tips: * Standard autotools variables (CC, LD, CFLAGS) are exported * To configure do "./configure $CONFIGURE_FLAGS" or use the "configure" alias +* To build CMake-based projects, use the "cmake" alias EOF SDK_PATH=$(dirname $(realpath "${BASH_SOURCE[0]}")) diff --git a/package/environment-setup/environment-setup.mk b/package/environment-setup/environment-setup.mk index be36cd452b..fb87c6f0b7 100644 --- a/package/environment-setup/environment-setup.mk +++ b/package/environment-setup/environment-setup.mk @@ -22,6 +22,9 @@ define HOST_ENVIRONMENT_SETUP_INSTALL_CMDS --program-prefix=\"\n" >> $(ENVIRONMENT_SETUP_FILE) printf "alias configure=\"./configure \$${CONFIGURE_FLAGS}\"\n" \ >> $(ENVIRONMENT_SETUP_FILE) + printf "alias cmake=\"cmake \ + -DCMAKE_TOOLCHAIN_FILE=$(HOST_DIR)/share/buildroot/toolchainfile.cmake \ + -DCMAKE_INSTALL_PREFIX=/usr\"\n" >> $(ENVIRONMENT_SETUP_FILE) $(SED) 's%$(HOST_DIR)%\$$SDK_PATH%g' \ -e 's%$(HOST_DIR)/bin/%%g' \ -e '/^export "PATH=/c\' \ -- 2.30.2