added cmakelists.txt
This commit is contained in:
parent
e21175b260
commit
82671539a4
@ -20,7 +20,7 @@ if(NOT OS_FSFW)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Project Name
|
# Project Name
|
||||||
project(fsfw-example-hosted C CXX)
|
project(fsfw-example-stm32h7-freertos ASM C CXX)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Pre-Sources preparation
|
# Pre-Sources preparation
|
||||||
@ -40,7 +40,7 @@ set(FSFW_PATH fsfw)
|
|||||||
set(COMMON_PATH example_common)
|
set(COMMON_PATH example_common)
|
||||||
set(LIB_FSFW_HAL_PATH fsfw_hal)
|
set(LIB_FSFW_HAL_PATH fsfw_hal)
|
||||||
|
|
||||||
set(BSP_PATH "bsp_hosted")
|
set(BSP_PATH "bsp_stm32h7_freertos")
|
||||||
set(COMMON_CONFIG_PATH "${COMMON_PATH}/config")
|
set(COMMON_CONFIG_PATH "${COMMON_PATH}/config")
|
||||||
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
|
||||||
set(FSFW_ADDITIONAL_INC_PATHS
|
set(FSFW_ADDITIONAL_INC_PATHS
|
||||||
@ -70,18 +70,6 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|||||||
add_compile_definitions(NOMINMAX)
|
add_compile_definitions(NOMINMAX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${OS_FSFW} STREQUAL linux)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
# Hosted
|
|
||||||
else()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
elseif(UNIX)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Executable and Sources
|
# Executable and Sources
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -104,8 +92,6 @@ add_subdirectory(${COMMON_PATH})
|
|||||||
# Add libraries for all sources.
|
# Add libraries for all sources.
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE
|
target_link_libraries(${TARGET_NAME} PRIVATE
|
||||||
${LIB_FSFW_NAME}
|
${LIB_FSFW_NAME}
|
||||||
${LIB_OS_NAME}
|
|
||||||
# ${LIB_FSFW_HAL_NAME}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add include paths for all sources.
|
# Add include paths for all sources.
|
||||||
@ -146,13 +132,6 @@ target_compile_options(${TARGET_NAME} PRIVATE
|
|||||||
${WARNING_FLAGS}
|
${WARNING_FLAGS}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT CMAKE_SIZE)
|
|
||||||
set(CMAKE_SIZE size)
|
|
||||||
if(WIN32)
|
|
||||||
set(FILE_SUFFIX ".exe")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(TGT_BSP)
|
if(TGT_BSP)
|
||||||
set(TARGET_STRING "Target BSP: ${TGT_BSP}")
|
set(TARGET_STRING "Target BSP: ${TGT_BSP}")
|
||||||
else()
|
else()
|
||||||
@ -165,13 +144,8 @@ string(CONCAT POST_BUILD_COMMENT
|
|||||||
"Target Build Type: ${CMAKE_BUILD_TYPE}\n"
|
"Target Build Type: ${CMAKE_BUILD_TYPE}\n"
|
||||||
"${TARGET_STRING}"
|
"${TARGET_STRING}"
|
||||||
)
|
)
|
||||||
|
# TODO: Generate bin file with stm32-cmake command
|
||||||
add_custom_command(
|
# TODO: Print size with stm32-cmake command
|
||||||
TARGET ${TARGET_NAME}
|
|
||||||
POST_BUILD
|
|
||||||
COMMAND ${CMAKE_SIZE} ${TARGET_NAME}${FILE_SUFFIX}
|
|
||||||
COMMENT ${POST_BUILD_COMMENT}
|
|
||||||
)
|
|
||||||
|
|
||||||
include (${CMAKE_SCRIPT_PATH}/BuildType.cmake)
|
include (${CMAKE_SCRIPT_PATH}/BuildType.cmake)
|
||||||
set_build_type()
|
set_build_type()
|
||||||
|
Loading…
Reference in New Issue
Block a user