Skip to content

Commit 5371758

Browse files
Split CMake example and test targets into multiple CMakeLists.txt
1 parent 6754320 commit 5371758

29 files changed

Lines changed: 882 additions & 149 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -27,156 +27,8 @@ cmake_minimum_required(VERSION 3.25)
2727

2828
project(MiosixExamples C CXX ASM)
2929

30-
add_compile_definitions($<$<COMPILE_LANGUAGE:C,CXX>:PARSING_FROM_IDE>)
31-
3230
add_subdirectory(miosix EXCLUDE_FROM_ALL)
33-
add_subdirectory(miosix/_examples/datalogger/tscpp EXCLUDE_FROM_ALL)
34-
3531
include(miosix/cmake/miosix_link_target.cmake)
3632

37-
#-----------------------------------------------------------------------------#
38-
# Examples #
39-
#-----------------------------------------------------------------------------#
40-
4133
add_executable(main main.cpp)
4234
miosix_link_target(main stm32f407vg_discovery)
43-
44-
add_executable(asm miosix/_examples/asm/main.s)
45-
miosix_link_target(asm stm32f407vg_discovery)
46-
47-
add_executable(atsam4l_lcd miosix/_examples/atsam4l_lcd/main.cpp)
48-
miosix_link_target(atsam4l_lcd atsam4lc2aa_generic)
49-
50-
add_executable(blinking_led miosix/_examples/blinking_led/simple.cpp)
51-
miosix_link_target(blinking_led stm32f429zi_discovery)
52-
53-
add_executable(datalogger
54-
miosix/_examples/datalogger/main.cpp
55-
miosix/_examples/datalogger/Logger.cpp
56-
)
57-
target_link_libraries(datalogger PUBLIC tscpp)
58-
miosix_link_target(datalogger stm32f407vg_discovery)
59-
60-
add_executable(hd44780 miosix/_examples/hd44780/hd44780.cpp)
61-
miosix_link_target(hd44780 stm32f407vg_discovery)
62-
63-
add_executable(ir_decoder miosix/_examples/ir_decoder/ir_decoder.cpp)
64-
miosix_link_target(ir_decoder stm32f407vg_discovery)
65-
66-
add_executable(led_display miosix/_examples/led_display/main.cpp)
67-
miosix_link_target(led_display stm32f100rb_discovery)
68-
69-
add_executable(sad_trombone
70-
miosix/_examples/sad_trombone/main.cpp
71-
miosix/_examples/sad_trombone/player.cpp
72-
miosix/_examples/sad_trombone/adpcm.c
73-
)
74-
miosix_link_target(sad_trombone stm32f407vg_discovery)
75-
76-
add_executable(servo-prompt miosix/_examples/servo/prompt.cpp)
77-
miosix_link_target(servo-prompt stm32f407vg_discovery)
78-
79-
add_executable(servo-sweep miosix/_examples/servo/sweep.cpp)
80-
miosix_link_target(servo-sweep stm32f407vg_discovery)
81-
82-
add_executable(streamwriter miosix/_examples/streamwriter/streamwriter.cpp)
83-
miosix_link_target(streamwriter stm32f407vg_discovery)
84-
85-
add_executable(termios miosix/_examples/termios/main.cpp)
86-
miosix_link_target(termios stm32f407vg_discovery)
87-
88-
add_executable(thread_native miosix/_examples/thread_native/native_thread_example.cpp)
89-
miosix_link_target(thread_native stm32f407vg_discovery)
90-
91-
add_executable(thread_pthread miosix/_examples/thread_pthread/pthread_example.cpp)
92-
miosix_link_target(thread_pthread stm32f407vg_discovery)
93-
94-
#-----------------------------------------------------------------------------#
95-
# Others #
96-
#-----------------------------------------------------------------------------#
97-
98-
add_executable(delay_test miosix/_tools/delay_test/delay_test.cpp)
99-
miosix_link_target(delay_test stm32f407vg_discovery)
100-
101-
add_executable(feedforward_profiling miosix/_tools/feedforward_profiling/test.cpp)
102-
miosix_link_target(feedforward_profiling stm32f407vg_discovery)
103-
104-
add_executable(fs_backend miosix/_tools/fs_backend/backend_benchmark.cpp)
105-
miosix_link_target(fs_backend stm32f407vg_discovery)
106-
107-
add_executable(fs_misc_testcode miosix/_tools/fs_misc_testcode/dirlist.cpp)
108-
miosix_link_target(fs_misc_testcode stm32f407vg_discovery)
109-
110-
# To build this entrypoint remember to:
111-
# - Define WITH_PROCESSES in miosix_settings.h
112-
# - Select a linker script like stm32_1m+192k_rom_processes.ld
113-
# add_executable(processes miosix/_tools/processes/main_processes.cpp)
114-
# target_include_directories(processes PUBLIC miosix/_tools/processes)
115-
# add_custom_command(
116-
# TARGET processes
117-
# PRE_BUILD COMMAND make
118-
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/miosix/_tools/processes/process_template
119-
# )
120-
# miosix_link_target(processes stm32f407vg_discovery)
121-
122-
add_executable(ram_test
123-
miosix/_tools/ram_test/main.cpp
124-
miosix/_tools/ram_test/sha1.cpp
125-
)
126-
miosix_link_target(ram_test stm32f407vg_discovery)
127-
128-
# If you want to test the MPU remember to run build.sh in miosix/_tools/testsuite
129-
# add_executable(testsuite miosix/_tools/testsuite/testsuite.cpp)
130-
# miosix_link_target(testsuite stm32f407vg_discovery)
131-
132-
# Build the testsuite for all supported boards to test compilation
133-
set(TESTSUITE_BOARDS
134-
lpc2138_miosix_board
135-
# stm32f072rb_discovery
136-
efm32gg332f1024_wandstem
137-
# stm32f100c8_microboard
138-
# stm32f100c8_vaisala_rs41
139-
# stm32f100cb_tempsensor
140-
# stm32f100cx_generic
141-
# stm32f100rb_discovery
142-
stm32f100rc_solertegiard
143-
# stm32f103c8_breakout
144-
# stm32f103cb_als_mainboard_rev2
145-
# stm32f103cx_generic
146-
stm32f103ve_mp3v2
147-
stm32f103ve_strive_mini
148-
stm32f103ze_redbull_v2
149-
stm32f103ze_evaluation
150-
stm32f205_generic
151-
stm32f205rc_skyward_stormtrooper
152-
stm32f205rg_sony_newman
153-
stm32f207ig_evaluation
154-
stm32f207ze_als_camboard
155-
stm32f207zg_ethboard_v2
156-
stm32f207zg_nucleo
157-
# stm32l151c8_als_mainboard
158-
# atsam4lcc
159-
stm32f303vc_discovery
160-
stm32f401re_nucleo
161-
stm32f401vc_discovery
162-
stm32f407vg_bitsboard
163-
stm32f407vg_discovery
164-
stm32f407vg_thermal_test_chip
165-
stm32f411ce_blackpill
166-
stm32f411re_nucleo
167-
stm32f429zi_oledboard2
168-
stm32f429zi_skyward_anakin
169-
stm32f429zi_skyward_homeone
170-
stm32f429zi_discovery
171-
stm32f469ni_discovery
172-
stm32l4r9zi_sensortile
173-
stm32l476rg_nucleo
174-
stm32f746zg_nucleo
175-
stm32f767zi_nucleo
176-
# stm32f769ni_discovery
177-
stm32h753xi_evaluation
178-
)
179-
foreach(OPT_BOARD ${TESTSUITE_BOARDS})
180-
add_executable(testsuite-${OPT_BOARD} miosix/_tools/testsuite/testsuite.cpp)
181-
miosix_link_target(testsuite-${OPT_BOARD} ${OPT_BOARD})
182-
endforeach()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2024 by Skyward
2+
#
3+
# This program is free software; you can redistribute it and/or
4+
# it under the terms of the GNU General Public License as published
5+
# the Free Software Foundation; either version 2 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# As a special exception, if other files instantiate templates or use
14+
# macros or inline functions from this file, or you compile this file
15+
# and link it with other works to produce a work based on this file,
16+
# this file does not by itself cause the resulting work to be covered
17+
# by the GNU General Public License. However the source code for this
18+
# file must still be made available in accordance with the GNU
19+
# Public License. This exception does not invalidate any other
20+
# why a work based on this file might be covered by the GNU General
21+
# Public License.
22+
#
23+
# You should have received a copy of the GNU General Public License
24+
# along with this program; if not, see <http://www.gnu.org/licenses/>
25+
26+
cmake_minimum_required(VERSION 3.25)
27+
28+
project(Asm C CXX ASM)
29+
30+
# Bypass the ckeck in miosix_settings.h
31+
add_compile_definitions($<$<COMPILE_LANGUAGE:C,CXX>:PARSING_FROM_IDE>)
32+
33+
add_subdirectory(../.. miosix EXCLUDE_FROM_ALL)
34+
include(../../cmake/miosix_link_target.cmake)
35+
36+
add_executable(asm main.s)
37+
miosix_link_target(asm stm32f407vg_discovery)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2024 by Skyward
2+
#
3+
# This program is free software; you can redistribute it and/or
4+
# it under the terms of the GNU General Public License as published
5+
# the Free Software Foundation; either version 2 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# As a special exception, if other files instantiate templates or use
14+
# macros or inline functions from this file, or you compile this file
15+
# and link it with other works to produce a work based on this file,
16+
# this file does not by itself cause the resulting work to be covered
17+
# by the GNU General Public License. However the source code for this
18+
# file must still be made available in accordance with the GNU
19+
# Public License. This exception does not invalidate any other
20+
# why a work based on this file might be covered by the GNU General
21+
# Public License.
22+
#
23+
# You should have received a copy of the GNU General Public License
24+
# along with this program; if not, see <http://www.gnu.org/licenses/>
25+
26+
cmake_minimum_required(VERSION 3.25)
27+
28+
project(atsam4lLCD C CXX ASM)
29+
30+
# Bypass the ckeck in miosix_settings.h
31+
add_compile_definitions($<$<COMPILE_LANGUAGE:C,CXX>:PARSING_FROM_IDE>)
32+
33+
add_subdirectory(../.. miosix EXCLUDE_FROM_ALL)
34+
include(../../cmake/miosix_link_target.cmake)
35+
36+
add_executable(atsam4l_lcd main.cpp)
37+
miosix_link_target(atsam4l_lcd atsam4lc2aa_generic)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2024 by Skyward
2+
#
3+
# This program is free software; you can redistribute it and/or
4+
# it under the terms of the GNU General Public License as published
5+
# the Free Software Foundation; either version 2 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# As a special exception, if other files instantiate templates or use
14+
# macros or inline functions from this file, or you compile this file
15+
# and link it with other works to produce a work based on this file,
16+
# this file does not by itself cause the resulting work to be covered
17+
# by the GNU General Public License. However the source code for this
18+
# file must still be made available in accordance with the GNU
19+
# Public License. This exception does not invalidate any other
20+
# why a work based on this file might be covered by the GNU General
21+
# Public License.
22+
#
23+
# You should have received a copy of the GNU General Public License
24+
# along with this program; if not, see <http://www.gnu.org/licenses/>
25+
26+
cmake_minimum_required(VERSION 3.25)
27+
28+
project(BlinkingLED C CXX ASM)
29+
30+
# Bypass the ckeck in miosix_settings.h
31+
add_compile_definitions($<$<COMPILE_LANGUAGE:C,CXX>:PARSING_FROM_IDE>)
32+
33+
add_subdirectory(../.. miosix EXCLUDE_FROM_ALL)
34+
include(../../cmake/miosix_link_target.cmake)
35+
36+
add_executable(blinking_led simple.cpp)
37+
miosix_link_target(blinking_led stm32f429zi_discovery)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (C) 2024 by Skyward
2+
#
3+
# This program is free software; you can redistribute it and/or
4+
# it under the terms of the GNU General Public License as published
5+
# the Free Software Foundation; either version 2 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# As a special exception, if other files instantiate templates or use
14+
# macros or inline functions from this file, or you compile this file
15+
# and link it with other works to produce a work based on this file,
16+
# this file does not by itself cause the resulting work to be covered
17+
# by the GNU General Public License. However the source code for this
18+
# file must still be made available in accordance with the GNU
19+
# Public License. This exception does not invalidate any other
20+
# why a work based on this file might be covered by the GNU General
21+
# Public License.
22+
#
23+
# You should have received a copy of the GNU General Public License
24+
# along with this program; if not, see <http://www.gnu.org/licenses/>
25+
26+
cmake_minimum_required(VERSION 3.25)
27+
28+
project(Datalogger C CXX ASM)
29+
30+
# Bypass the ckeck in miosix_settings.h
31+
add_compile_definitions($<$<COMPILE_LANGUAGE:C,CXX>:PARSING_FROM_IDE>)
32+
33+
add_subdirectory(../.. miosix EXCLUDE_FROM_ALL)
34+
add_subdirectory(tscpp EXCLUDE_FROM_ALL)
35+
include(../../cmake/miosix_link_target.cmake)
36+
37+
add_executable(datalogger main.cpp Logger.cpp)
38+
target_link_libraries(datalogger PUBLIC tscpp)
39+
miosix_link_target(datalogger stm32f407vg_discovery)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2024 by Skyward
2+
#
3+
# This program is free software; you can redistribute it and/or
4+
# it under the terms of the GNU General Public License as published
5+
# the Free Software Foundation; either version 2 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# As a special exception, if other files instantiate templates or use
14+
# macros or inline functions from this file, or you compile this file
15+
# and link it with other works to produce a work based on this file,
16+
# this file does not by itself cause the resulting work to be covered
17+
# by the GNU General Public License. However the source code for this
18+
# file must still be made available in accordance with the GNU
19+
# Public License. This exception does not invalidate any other
20+
# why a work based on this file might be covered by the GNU General
21+
# Public License.
22+
#
23+
# You should have received a copy of the GNU General Public License
24+
# along with this program; if not, see <http://www.gnu.org/licenses/>
25+
26+
cmake_minimum_required(VERSION 3.25)
27+
28+
project(DeepSleep C CXX ASM)
29+
30+
# Bypass the ckeck in miosix_settings.h
31+
add_compile_definitions($<$<COMPILE_LANGUAGE:C,CXX>:PARSING_FROM_IDE>)
32+
33+
add_subdirectory(../.. miosix EXCLUDE_FROM_ALL)
34+
include(../../cmake/miosix_link_target.cmake)
35+
36+
add_executable(deep_sleep main-test.cpp)
37+
miosix_link_target(deep_sleep stm32f407vg_discovery)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) 2024 by Skyward
2+
#
3+
# This program is free software; you can redistribute it and/or
4+
# it under the terms of the GNU General Public License as published
5+
# the Free Software Foundation; either version 2 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# As a special exception, if other files instantiate templates or use
14+
# macros or inline functions from this file, or you compile this file
15+
# and link it with other works to produce a work based on this file,
16+
# this file does not by itself cause the resulting work to be covered
17+
# by the GNU General Public License. However the source code for this
18+
# file must still be made available in accordance with the GNU
19+
# Public License. This exception does not invalidate any other
20+
# why a work based on this file might be covered by the GNU General
21+
# Public License.
22+
#
23+
# You should have received a copy of the GNU General Public License
24+
# along with this program; if not, see <http://www.gnu.org/licenses/>
25+
26+
cmake_minimum_required(VERSION 3.25)
27+
28+
project(HD44780 C CXX ASM)
29+
30+
# Bypass the ckeck in miosix_settings.h
31+
add_compile_definitions($<$<COMPILE_LANGUAGE:C,CXX>:PARSING_FROM_IDE>)
32+
33+
add_subdirectory(../.. miosix EXCLUDE_FROM_ALL)
34+
include(../../cmake/miosix_link_target.cmake)
35+
36+
add_executable(hd44780 hd44780.cpp)
37+
miosix_link_target(hd44780 stm32f407vg_discovery)

0 commit comments

Comments
 (0)