Skip to content

Commit

Permalink
cmake:refine cmake build for apps/examples
Browse files Browse the repository at this point in the history
Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
xuxin930 committed Aug 16, 2023
1 parent 3f556c8 commit c805bd1
Show file tree
Hide file tree
Showing 152 changed files with 2,903 additions and 113 deletions.
33 changes: 33 additions & 0 deletions examples/abntcodi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ##############################################################################
# apps/examples/adntcodi/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_EXAMPLES_ABNTCODI)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_ABNTCODI_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_ABNTCODI_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_ABNTCODI_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_ABNTCODI}
SRCS
abntcodi_main.c)
endif()
10 changes: 9 additions & 1 deletion examples/adc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@
# ##############################################################################

if(CONFIG_EXAMPLES_ADC)
nuttx_add_application(NAME adc)
nuttx_add_application(
NAME
adc
STACKSIZE
${CONFIG_DEFAULT_TASK_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_ADC}
SRCS
adc_main.c)
endif()
33 changes: 33 additions & 0 deletions examples/adjtime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ##############################################################################
# apps/examples/adjtime/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_EXAMPLES_ADJTIME)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_ADJTIME_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_ADJTIME_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_ADJTIME_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_ADJTIME}
SRCS
adjtime_main.c)
endif()
12 changes: 11 additions & 1 deletion examples/adxl372_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@
# ##############################################################################

if(CONFIG_EXAMPLES_ADXL372_TEST)
nuttx_add_application(NAME adxl372_test)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_ADXL372_TEST_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_ADXL372_TEST_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_ADXL372_TEST_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_ADXL372_TEST}
SRCS
adxl372_test_main.c)
endif()
10 changes: 9 additions & 1 deletion examples/ajoystick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@
# ##############################################################################

if(CONFIG_EXAMPLES_AJOYSTICK)
nuttx_add_application(NAME ajoystick)
nuttx_add_application(
NAME
ajoy
STACKSIZE
${CONFIG_DEFAULT_TASK_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_AJOYSTICK}
SRCS
ajoy_main.c)
endif()
12 changes: 7 additions & 5 deletions examples/alarm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
if(CONFIG_EXAMPLES_ALARM)
nuttx_add_application(
NAME
alarm
SRCS
alarm_main.c
${CONFIG_EXAMPLES_ALARM_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_ALARM_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_ALARM_STACKSIZE}
PRIORITY
${CONFIG_EXAMPLES_ALARM_PRIORITY})
MODULE
${CONFIG_EXAMPLES_ALARM}
SRCS
alarm_main.c)
endif()
10 changes: 9 additions & 1 deletion examples/apa102/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@
# ##############################################################################

if(CONFIG_EXAMPLES_APA102)
nuttx_add_application(NAME apa102)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_APA102_PROGNAME}
STACKSIZE
${CONFIG_DEFAULT_TASK_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_APA102}
SRCS
apa102_main.c)
endif()
12 changes: 11 additions & 1 deletion examples/apds9960/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@
# ##############################################################################

if(CONFIG_EXAMPLES_APDS9960)
nuttx_add_application(NAME apds9960)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_APDS9960_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_APDS9960_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_APDS9960_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_APDS9960}
SRCS
apds9960_main.c)
endif()
31 changes: 31 additions & 0 deletions examples/audio_rttl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ##############################################################################
# apps/examples/audio_rttl/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_EXAMPLES_AUDIO_SOUND)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_AUDIO_SOUND_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_AUDIO_SOUND_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_AUDIO_SOUND_STACKSIZE}
SRCS
audio_rttl.c)
endif()
21 changes: 20 additions & 1 deletion examples/bastest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,24 @@
# ##############################################################################

if(CONFIG_EXAMPLES_BASTEST)
nuttx_add_application(NAME bastest)
nuttx_add_romfs(
NAME
bastest
PATH
${CMAKE_CURRENT_LIST_DIR}/test
HEADER
PREFIX
bastest
NONCONST)

nuttx_add_application(
NAME
bastest
STACKSIZE
${CONFIG_DEFAULT_TASK_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_BASTEST}
SRCS
bastest_main.c)

endif()
33 changes: 33 additions & 0 deletions examples/battery/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ##############################################################################
# apps/examples/battery/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_EXAMPLES_BATTERY)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_BATTERY_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_BATTERY_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_BATTERY_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_BATTERY}
SRCS
batt_main.c)
endif()
31 changes: 31 additions & 0 deletions examples/bmi160/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ##############################################################################
# apps/examples/bmi160/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_EXAMPLES_SIXAXIS)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_SIXAXIS_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_SIXAXIS_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_SIXAXIS_STACKSIZE}
SRCS
sixaxis_main.c)
endif()
12 changes: 11 additions & 1 deletion examples/bmp180/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@
# ##############################################################################

if(CONFIG_EXAMPLES_BMP180)
nuttx_add_application(NAME bmp180)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_BMP180_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_BMP180_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_BMP180_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_BMP180}
SRCS
bmp180_main.c)
endif()
33 changes: 33 additions & 0 deletions examples/bmp280/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ##############################################################################
# apps/examples/bmp280/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
# ##############################################################################

if(CONFIG_EXAMPLES_BMP280)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_BMP280_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_BMP280_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_BMP280_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_BMP280}
SRCS
bmp280_main.c)
endif()
12 changes: 7 additions & 5 deletions examples/buttons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
if(CONFIG_EXAMPLES_BUTTONS)
nuttx_add_application(
NAME
buttons
SRCS
buttons_main.c
${CONFIG_EXAMPLES_BUTTONS_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_BUTTONS_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_BUTTONS_STACKSIZE}
PRIORITY
${CONFIG_EXAMPLES_BUTTONS_PRIORITY})
MODULE
${CONFIG_EXAMPLES_BUTTONS}
SRCS
buttons_main.c)
endif()
12 changes: 11 additions & 1 deletion examples/calib_udelay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@
# ##############################################################################

if(CONFIG_EXAMPLES_CALIB_UDELAY)
nuttx_add_application(NAME calib_udelay)
nuttx_add_application(
NAME
calib_udelay
PRIORITY
100
STACKSIZE
${CONFIG_DEFAULT_TASK_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_CALIB_UDELAY}
SRCS
calib_udelay_main.c)
endif()
Loading

0 comments on commit c805bd1

Please sign in to comment.