Skip to content
Extraits de code Groupes Projets
Valider fd76ef51 rédigé par François De Keersmaeker's avatar François De Keersmaeker
Parcourir les fichiers

CMake: updated build

parent 25c38ce1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#!/bin/bash #!/bin/bash
# Build the project. # Build the project.
# Usage: build.sh [-C working_directory] [-t cmake_toolchain_file] # Usage: build.sh [-C working_directory] [-t cmake_toolchain_file] [-d device]
# -C working_directory: The directory to build the project in. # -C working_directory: The directory to build the project in.
# -t cmake_toolchain_file: The CMake toolchain file to use. # -t cmake_toolchain_file: The CMake toolchain file to use.
# Default values # Default values
WORKING_DIRECTORY="" WORKING_DIRECTORY=""
CMAKE_TOOLCHAIN_FILE="" CMAKE_TOOLCHAIN_FILE=""
DEVICE=""
# Print usage information # Print usage information
usage() { usage() {
...@@ -17,7 +16,7 @@ usage() { ...@@ -17,7 +16,7 @@ usage() {
} }
# Parse command line arguments # Parse command line arguments
while getopts "C:t:" opt; while getopts "C:t:d:" opt;
do do
case "${opt}" in case "${opt}" in
C) C)
...@@ -46,13 +45,16 @@ fi ...@@ -46,13 +45,16 @@ fi
# Clean directory # Clean directory
rm -rf build bin rm -rf build bin
# Build project ## Set environmental variables
mkdir build bin ENV_VARS=""
cd build # CMake toolchain file
if [[ $CMAKE_TOOLCHAIN_FILE ]] if [[ $CMAKE_TOOLCHAIN_FILE ]]
then then
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE .. ENV_VARS="$ENV_VARS -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE"
else
cmake ..
fi fi
# Build project
mkdir build bin
cd build
cmake $ENV_VARS ..
cmake --build . cmake --build .
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter