updated cmake scripts

This commit is contained in:
Robin Müller 2021-07-13 11:04:31 +02:00
parent bace149fa4
commit d2d38fb0b3
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
12 changed files with 46 additions and 222 deletions

View File

@ -32,26 +32,10 @@ project(fsfw-example-stm32h7-freertos ASM C CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
find_package(CMSIS COMPONENTS STM32H743ZI STM32H7_M7 RTOS REQUIRED)
find_package(FreeRTOS COMPONENTS STM32H7 ARM_CM7 REQUIRED)
find_package(HAL COMPONENTS STM32H7M7 STM32H743ZI RCC GPIO UART TIM CORTEX ETH SPI DMA REQUIRED)
find_package(LwIP REQUIRED)
set(TGT_BSP "arm/stm32h743zi-nucleo")
set(FREERTOS_NAMESPACE FreeRTOS::STM32::H7::M7)
# These need to be set for the FSFW so the sources are compiled with the ABI flags
# and to compile FreeRTOS first
set(LIB_OS_NAME ${FREERTOS_NAMESPACE}::ARM_CM7)
# This target is used because a custom linker script is used
set(CMSIS_LINK_TARGET CMSIS::STM32::H743xx::M7)
set(FSFW_ADDITIONAL_LINK_LIBS ${CMSIS_LINK_TARGET})
set(FSFW_HAL_LINK_LIBS
HAL::STM32::H7::M7::CORTEX
${CMSIS_LINK_TARGET}
${LIB_OS_NAME}
)
# Set names and variables
set(TARGET_NAME ${CMAKE_PROJECT_NAME})
set(LIB_FSFW_NAME fsfw)
@ -68,8 +52,24 @@ set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
set(BSP_NUCLEO_PATH "${BSP_PATH}/NUCLEO-H743ZI")
set(BSP_NUCLEO_INC_PATH "${BSP_NUCLEO_PATH}/Inc")
set(FSFW_HAL_ADDITIONAL_INC_PATHS ${BSP_NUCLEO_INC_PATH})
# See stm32-cmake documentation for more information
find_package(CMSIS COMPONENTS STM32H743ZI STM32H7_M7 RTOS REQUIRED)
find_package(FreeRTOS COMPONENTS STM32H7 ARM_CM7 REQUIRED)
find_package(HAL COMPONENTS STM32H7M7 STM32H743ZI RCC GPIO UART TIM CORTEX ETH SPI DMA REQUIRED)
find_package(LwIP REQUIRED)
# These need to be set for the FSFW so the sources are compiled with the ABI flags
# and to compile FreeRTOS first
set(LIB_OS_NAME ${FREERTOS_NAMESPACE}::ARM_CM7)
# This target is used because a custom linker script is used
set(CMSIS_LINK_TARGET CMSIS::STM32::H743xx::M7)
set(FSFW_ADDITIONAL_LINK_LIBS ${CMSIS_LINK_TARGET})
set(FSFW_HAL_LINK_LIBS
HAL::STM32::H7::M7::CORTEX
${CMSIS_LINK_TARGET}
${LIB_OS_NAME}
)
set(FSFW_HAL_ADDITIONAL_INC_PATHS ${BSP_NUCLEO_INC_PATH})
set(FSFW_ADDITIONAL_INC_PATHS
"${COMMON_CONFIG_PATH}"
"${CMAKE_CURRENT_BINARY_DIR}"

View File

@ -1,28 +0,0 @@
#!/bin/sh
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
done
if [ "${counter}" -ge 5 ];then
echo "create_cmake_cfg.sh not found in upper directories!"
exit 1
fi
build_generator=""
os_fsfw="host"
builddir="Debug-VS2019"
if [ "${OS}" = "Windows_NT" ]; then
build_generator="Visual Studio 16 2019"
# Could be other OS but this works for now.
else
build_generator="Unix Makefiles"
fi
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"

View File

@ -1,28 +0,0 @@
#!/bin/sh
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
done
if [ "${counter}" -ge 5 ];then
echo "create_cmake_cfg.sh not found in upper directories!"
exit 1
fi
build_generator=""
os_fsfw="host"
builddir="Release-VS2019"
if [ "${OS}" = "Windows_NT" ]; then
build_generator="Visual Studio 16 2019"
# Could be other OS but this works for now.
else
build_generator="Unix Makefiles"
fi
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}"

View File

@ -1,26 +0,0 @@
#!/bin/sh
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
done
if [ "${counter}" -ge 5 ];then
echo "create_cmake_cfg.sh not found in upper directories!"
exit 1
fi
build_generator="Unix Makefiles"
os_fsfw="linux"
builddir="build-Debug"
echo "Running command (without the leading +):"
set -x # Print command
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" \
-t "host/none" -l "${builddir}"
# Use this if commands are added which should not be printed
# set +x

View File

@ -1,26 +0,0 @@
#!/bin/sh
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
done
if [ "${counter}" -ge 5 ];then
echo "create_cmake_cfg.sh not found in upper directories!"
exit 1
fi
build_generator="Unix Makefiles"
os_fsfw="linux"
builddir="build-Release"
echo "Running command (without the leading +):"
set -x # Print command
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" \
-t "host/none" -l "${builddir}"
# Use this if commands are added which should not be printed
# set +x

View File

@ -1,26 +0,0 @@
#!/bin/sh
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
done
if [ "${counter}" -ge 5 ];then
echo "create_cmake_cfg.sh not found in upper directories!"
exit 1
fi
build_generator="Unix Makefiles"
os_fsfw="linux"
builddir="build-Release"
echo "Running command (without the leading +):"
set -x # Print command
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" \
-t "host/none" -l "${builddir}"
# Use this if commands are added which should not be printed
# set +x

View File

@ -1,26 +0,0 @@
#!/bin/sh
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
done
if [ "${counter}" -ge 5 ];then
echo "create_cmake_cfg.sh not found in upper directories!"
exit 1
fi
build_generator="Unix Makefiles"
os_fsfw="linux"
builddir="build-Release"
echo "Running command (without the leading +):"
set -x # Print command
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "size"\
-t "host/none" -l "${builddir}"
# Use this if commands are added which should not be printed
# set +x

View File

@ -1,26 +0,0 @@
#!/bin/sh
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
done
if [ "${counter}" -ge 5 ];then
echo "create_cmake_cfg.sh not found in upper directories!"
exit 1
fi
build_generator="Ninja"
os_fsfw="linux"
builddir="build-Debug"
echo "Running command (without the leading +):"
set -x # Print command
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" \
-t "host/none" -l "${builddir}"
# Use this if commands are added which should not be printed
# set +x

View File

@ -2,11 +2,11 @@
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
cd ..
done
if [ "${counter}" -ge 5 ];then
@ -15,13 +15,18 @@ if [ "${counter}" -ge 5 ];then
fi
build_generator=""
os_fsfw="host"
os_fsfw="freertos"
builddir="build-Debug"
if [ "${OS}" = "Windows_NT" ]; then
build_generator="MinGW Makefiles"
python="py"
# Could be other OS but this works for now.
else
build_generator="Unix Makefiles"
python="python3"
fi
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
echo "Running command (without the leading +):"
set -x # Print command
${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
# set +x

View File

@ -2,11 +2,11 @@
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
cd ..
done
if [ "${counter}" -ge 5 ];then
@ -15,17 +15,18 @@ if [ "${counter}" -ge 5 ];then
fi
build_generator=""
os_fsfw="host"
os_fsfw="freertos"
builddir="build-Release"
if [ "${OS}" = "Windows_NT" ]; then
build_generator="MinGW Makefiles"
python="py"
# Could be other OS but this works for now.
else
build_generator="Unix Makefiles"
python="python3"
fi
echo "Running command (without the leading +):"
set -x # Print command
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -l "${builddir}"
# Use this if commands are added which should not be printed
# set +x
${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}"
# set +x

View File

@ -2,11 +2,11 @@
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
cd ..
done
if [ "${counter}" -ge 5 ];then
@ -15,13 +15,18 @@ if [ "${counter}" -ge 5 ];then
fi
build_generator=""
os_fsfw="host"
os_fsfw="freertos"
builddir="build-Release"
if [ "${OS}" = "Windows_NT" ]; then
build_generator="MinGW Makefiles"
python="py"
# Could be other OS but this works for now.
else
build_generator="Unix Makefiles"
python="python3"
fi
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -l "${builddir}"
echo "Running command (without the leading +):"
set -x # Print command
${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "size" -l "${builddir}"
# set +x

View File

@ -2,11 +2,11 @@
counter=0
while [ ${counter} -lt 5 ]
do
cd ..
if [ -f "cmake_build_config.py" ];then
break
fi
counter=$((counter=counter + 1))
cd ..
done
if [ "${counter}" -ge 5 ];then
@ -15,18 +15,17 @@ if [ "${counter}" -ge 5 ];then
fi
build_generator=""
os_fsfw="host"
builddir="RelWithDeb-VS2019"
os_fsfw="freertos"
builddir="build-Debug"
build_generator="Ninja"
if [ "${OS}" = "Windows_NT" ]; then
build_generator="Visual Studio 16 2019"
python="py"
# Could be other OS but this works for now.
else
build_generator="Unix Makefiles"
python="python3"
fi
echo "Running command (without the leading +):"
set -x # Print command
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -l "${builddir}"
# Use this if commands are added which should not be printed
${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}"
# set +x