source: trunk/fw_g473rct/CMakeLists.txt

Last change on this file was 20, checked in by f.jahn, 4 days ago

adc dma funktioniert und modbus funktioniert

File size: 1.6 KB
Line 
1cmake_minimum_required(VERSION 3.22)
2
3#
4# This file is generated only once,
5# and is not re-generated if converter is called multiple times.
6#
7# User is free to modify the file as much as necessary
8#
9
10# Setup compiler settings
11set(CMAKE_C_STANDARD 11)
12set(CMAKE_C_STANDARD_REQUIRED ON)
13set(CMAKE_C_EXTENSIONS ON)
14
15
16# Define the build type
17if(NOT CMAKE_BUILD_TYPE)
18    set(CMAKE_BUILD_TYPE "Debug")
19endif()
20
21# Set the project name
22set(CMAKE_PROJECT_NAME fw_g473rct)
23
24# Enable compile command to ease indexing with e.g. clangd
25set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
26
27# Core project settings
28project(${CMAKE_PROJECT_NAME})
29message("Build type: " ${CMAKE_BUILD_TYPE})
30
31# Enable CMake support for ASM and C languages
32enable_language(C ASM)
33
34# Create an executable object type
35add_executable(${CMAKE_PROJECT_NAME})
36
37# Add STM32CubeMX generated sources
38add_subdirectory(cmake/stm32cubemx)
39
40# Link directories setup
41target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
42    # Add user defined library search paths
43)
44
45# Add sources to executable
46target_sources(${CMAKE_PROJECT_NAME} PRIVATE
47    # Add user sources here
48)
49
50# Add include paths
51target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
52    # Add user defined include paths
53)
54
55# Add project symbols (macros)
56target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
57    # Add user defined symbols
58)
59
60# Remove wrong libob.a library dependency when using cpp files
61list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_LIBRARIES ob)
62
63# Add linked libraries
64target_link_libraries(${CMAKE_PROJECT_NAME}
65    stm32cubemx
66
67    # Add user defined libraries
68)
Note: See TracBrowser for help on using the repository browser.