Cleanup of module building.

This commit is contained in:
James Goppert
2015-09-09 23:00:58 -04:00
parent a529153062
commit bf18c84652
36 changed files with 151 additions and 291 deletions
@@ -640,4 +640,36 @@ function(px4_mangle_name dirname newname)
set(${newname} ${tmp} PARENT_SCOPE)
endfunction()
#=============================================================================
#
# px4_create_git_hash_header
#
# Create a header file containing the git hash of the current tree
#
# Usage:
# px4_create_git_hash_header(HEADER ${CMAKE_BUILD_DIR}/git_hash.h)
#
# Input:
# HEADER : path of the header file to generate
#
# Example:
# px4_create_git_hash_header(HEADER ${CMAKE_BUILD_DIR}/git_hash.h)
#
function(px4_create_git_hash_header)
px4_parse_function_args(
NAME px4_create_git_hash_header
ONE_VALUE HEADER
REQUIRED HEADER
ARGN ${ARGN})
execute_process(
COMMAND git log -n 1 --pretty=format:"%H"
OUTPUT_VARIABLE git_desc
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "GIT_DESC = ${git_desc}")
set(git_desc_short)
string(SUBSTRING ${git_desc} 1 16 git_desc_short)
configure_file(${CMAKE_SOURCE_DIR}/cmake/templates/build_git_version.h.in ${HEADER} @ONLY)
endfunction()
# vim: set noet fenc=utf-8 ff=unix nowrap:
@@ -0,0 +1,23 @@
include(nuttx/px4_impl_nuttx)
function(px4_set_config_modules out_module_list)
set(config_module_list
platforms/nuttx
platforms/nuttx/px4_layer
platforms/common
drivers/led
drivers/device
modules/systemlib
modules/uORB
examples/px4_simple_app
drivers/boards/px4fmu-v2
drivers/stm32
lib/mathlib/math/filter
lib/conversion
)
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
endfunction()
@@ -1,4 +1,7 @@
include(posix/px4_impl_posix)
function(px4_set_config_modules out_module_list)
set(config_module_list
drivers/led
drivers/device
@@ -39,7 +42,6 @@ function(px4_set_config_modules out_module_list)
modules/fw_pos_control_l1
modules/dataman
modules/sdlog2
modules/simulator
modules/commander
modules/controllib
lib/mathlib
@@ -51,7 +53,8 @@ function(px4_set_config_modules out_module_list)
lib/geo_lookup
lib/launchdetection
)
message(STATUS "modules: ${config_module_list}")
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
endfunction()
@@ -80,7 +80,6 @@ function(px4_set_config_modules out_module_list)
#
modules/muorb/adsp
)
message(STATUS "modules: ${config_module_list}")
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
endfunction()
+1 -1
View File
@@ -49,7 +49,7 @@
# * px4_os_prebuild_targets
#
include(px4_base)
include(common/px4_base)
#=============================================================================
#
+1 -1
View File
@@ -48,7 +48,7 @@
# * px4_os_prebuild_targets
#
include(px4_base)
include(common/px4_base)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/posix)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/posix/configs)
-31
View File
@@ -1,31 +0,0 @@
#=============================================================================
#
# px4_create_git_hash_header
#
# Create a header file containing the git hash of the current tree
#
# Usage:
# px4_create_git_hash_header(HEADER ${CMAKE_BUILD_DIR}/git_hash.h)
#
# Input:
# HEADER : path of the header file to generate
#
# Example:
# px4_create_git_hash_header(HEADER ${CMAKE_BUILD_DIR}/git_hash.h)
#
function(px4_create_git_hash_header)
px4_parse_function_args(
NAME px4_create_git_hash_header
ONE_VALUE HEADER
REQUIRED HEADER
ARGN ${ARGN})
execute_process(
COMMAND git log -n 1 --pretty=format:"%H"
OUTPUT_VARIABLE git_desc
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "GIT_DESC = ${git_desc}")
set(git_desc_short)
string(SUBSTRING ${git_desc} 1 16 git_desc_short)
configure_file(${CMAKE_SOURCE_DIR}/cmake/build_git_version.h.in ${HEADER} @ONLY)
endfunction()
+1 -1
View File
@@ -49,7 +49,7 @@
# * px4_os_prebuild_targets
#
include(px4_base)
include(common/px4_base)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/qurt)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/qurt/configs)
include(qurt_funcs)
@@ -19,7 +19,7 @@ parser.add_argument('--backup', help='create backup of existing files if overwri
parser.set_defaults(overwrite=False, backup=False)
args = parser.parse_args()
cmake_template = jinja2.Template(open('cmake/cmake_lists.jinja', 'r').read())
cmake_template = jinja2.Template(open('cmake/scripts/cmake_lists.jinja', 'r').read())
module_files = []
for root, dirnames, filenames in os.walk(args.path):
@@ -32,7 +32,7 @@
include(CMakeForceCompiler)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(px4_base)
include(common/px4_base)
if(NOT HEXAGON_TOOLS_ROOT)
set(HEXAGON_TOOLS_ROOT /opt/6.4.05)