Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lists ROMFS files explicity instead of using GLOB_RECURSE #9107

Merged
merged 7 commits into from
Mar 26, 2018
71 changes: 67 additions & 4 deletions ROMFS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,76 @@
############################################################################
#
# Copyright (c) 2018 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################

message(STATUS "ROMFS: ${config_romfs_root}")

set(romfs_temp_dir ${PX4_BINARY_DIR}/ROMFS/${config_romfs_root})
set(config_romfs_files_list)
set(romfs_src_dir ${PX4_SOURCE_DIR}/ROMFS/${config_romfs_root})
set(romfs_temp_dir ${PX4_BINARY_DIR}/genromfs/${config_romfs_root})

#=============================================================================
#
# px4_add_romfs_files
#
# This function builds a list of files to be included in the ROMFS.
#
# Usage:
# px4_add_romfs_files(<list of files in current directory to be added to the project>)
#
# Output:
# list config_romfs_files_list populated with a list of ROMFS src files including their full file path.
#
# Example:
# px4_add_module(
# <ROMFS_file_1>
# <ROMFS_file_2>
# <ROMFS_file_3>
# )
#
function(px4_add_romfs_files)
foreach(arg IN LISTS ARGN)
list(APPEND config_romfs_files_list
${CMAKE_CURRENT_SOURCE_DIR}/${arg}
)
endforeach()

set(config_romfs_files_list ${config_romfs_files_list} CACHE INTERNAL "ROMFS file list")
endfunction()

# get list of all ROMFS files
add_subdirectory(${romfs_src_dir})

# directory setup
# copy all romfs files, process airframes, prune comments
file(GLOB_RECURSE init_airframes ${PX4_SOURCE_DIR}/ROMFS/${config_romfs_root}/*/[1-9]*)
add_custom_command(OUTPUT ${romfs_temp_dir}/init.d/rcS ${romfs_temp_dir}/init.d/rc.autostart
COMMAND cmake -E copy_directory ${romfs_src_dir} ${romfs_temp_dir}
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_airframes.py
Expand All @@ -16,8 +80,7 @@ add_custom_command(OUTPUT ${romfs_temp_dir}/init.d/rcS ${romfs_temp_dir}/init.d/
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_romfs_pruner.py
--folder ${romfs_temp_dir} --board ${BOARD}
DEPENDS
${romfs_src_files}
${init_airframes}
${config_romfs_files_list}
${PX4_SOURCE_DIR}/ROMFS/${config_romfs_root}/init.d/rcS
${PX4_SOURCE_DIR}/Tools/px_process_airframes.py
)
Expand Down
35 changes: 35 additions & 0 deletions ROMFS/px4fmu_common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
############################################################################
#
# Copyright (c) 2018 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################

add_subdirectory(init.d)
add_subdirectory(mixers)
118 changes: 118 additions & 0 deletions ROMFS/px4fmu_common/init.d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
############################################################################
#
# Copyright (c) 2018 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################

px4_add_romfs_files(
1000_rc_fw_easystar.hil
1001_rc_quad_x.hil
2100_standard_plane
2105_maja
2106_albatross
24001_dodeca_cox
3000_generic_wing
3030_io_camflyer
3031_phantom
3032_skywalker_x5
3033_wingwing
3034_fx79
3035_viper
3036_pigeon
3037_parrot_disco_mod
3100_tbs_caipirinha
4001_quad_x
4002_quad_x_mount
4003_qavr5
4004_H4_680mm
4009_qav250
4010_dji_f330
4011_dji_f450
4012_quad_x_can
4013_bebop
4020_hk_micro_pcb
4030_3dr_solo
4031_3dr_quad
4040_reaper
4050_generic_250
4051_s250aq
4060_dji_matrice_100
4070_aerofc
4080_zmr250
4090_nanomind
4900_crazyflie
5001_quad_+
6001_hexa_x
7001_hexa_+
8001_octo_x
9001_octo_+
10015_tbs_discovery
10016_3dr_iris
10017_steadidrone_qu4d
10018_tbs_endurance
11001_hexa_cox
12001_octo_cox
12002_steadidrone_mavrik
13000_generic_vtol_standard
13001_caipirinha_vtol
13002_firefly6
13003_quad_tailsitter
13004_quad+_tailsitter
13005_vtol_AAERT_quad
13006_vtol_standard_delta
13007_vtol_AAVVT_quad
13008_QuadRanger
13009_vtol_spt_ranger
13010_claire
13012_convergence
13013_deltaquad
14001_tri_y_yaw+
14002_tri_y_yaw-
15001_coax_heli
16001_helicopter
50000_generic_ground_vehicle
50001_axialracing_ax10
50002_traxxas_stampede_2wd
rc.axialracing_ax10_apps
rc.axialracing_ax10_defaults
rc.fw_apps
rc.fw_defaults
rc.interface
rc.io
rc.logging
rc.mc_apps
rc.mc_defaults
rcS
rc.sensors
rc.ugv_apps
rc.ugv_defaults
rc.vtol_apps
rc.vtol_defaults
)
90 changes: 90 additions & 0 deletions ROMFS/px4fmu_common/mixers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
############################################################################
#
# Copyright (c) 2018 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################

px4_add_romfs_files(
AAERTWF.main.mix
AAVVTWFF.main.mix
AERT.main.mix
AETRFG.main.mix
bebop.main.mix
blade130.main.mix
caipi.main.mix
caipirinha_vtol.main.mix
CCPM.main.mix
claire.aux.mix
claire.main.mix
coax.main.mix
delta.main.mix
deltaquad.main.mix
dodeca_bottom_cox.aux.mix
dodeca_top_cox.main.mix
firefly6.aux.mix
firefly6.main.mix
FMU_pass.mix
fw_generic_wing.main.mix
FX79.main.mix
hexa_cox.main.mix
hexa_+.main.mix
hexa_x.main.mix
IO_pass.main.mix
mount.aux.mix
mount_legs.aux.mix
ocpoc_quad_x.main.mix
octo_cox.main.mix
octo_cox_w.main.mix
octo_+.main.mix
octo_x.main.mix
pass.aux.mix
phantom.main.mix
quad_dc.main.mix
quad_h.main.mix
quad_+.main.mix
quad_s250aq.main.mix
quad_+_vtol.main.mix
quad_w.main.mix
quad_x_can.main.mix
quad_x.main.mix
quad_x_vtol.main.mix
quad_x_vtol_sim.main.mix
stampede.main.mix
tri_y_yaw-.main.mix
tri_y_yaw+.main.mix
ugv_generic.main.mix
Viper.main.mix
vtol_AAERT.aux.mix
vtol_AAVVT.aux.mix
vtol_convergence.main.mix
vtol_delta.aux.mix
wingwing.main.mix
zmr250.main.mix
)
36 changes: 36 additions & 0 deletions ROMFS/px4fmu_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
############################################################################
#
# Copyright (c) 2018 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################

add_subdirectory(init.d)
add_subdirectory(mixers)
add_subdirectory(unit_test_data)
Loading