package/environment-setup: add cmake alias
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>
Tue, 28 Apr 2020 14:46:00 +0000 (16:46 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 3 Nov 2020 21:43:33 +0000 (22:43 +0100)
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 <angelo@amarulasolutions.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/environment-setup/environment-setup
package/environment-setup/environment-setup.mk

index 58701e4c7165822e313ab4c788120578d80a95a1..813aa01c7a063f7c0f23d863899f632f62cba7e2 100644 (file)
@@ -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]}"))
index be36cd452b97b361b3aa827ce68f4dc960a6f4eb..fb87c6f0b7545ecaeebcf002e650347ddb6c212c 100644 (file)
@@ -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\' \