mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 04:21:35 +08:00
cmake standalone build
This commit is contained in:
+60
-28
@@ -1,6 +1,6 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 ECL Development Team. All rights reserved.
|
||||
# Copyright (c) 2015-2018 ECL Development Team. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
@@ -30,31 +30,63 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
include_directories(.)
|
||||
px4_add_library(ecl
|
||||
airdata/WindEstimator.cpp
|
||||
attitude_fw/ecl_controller.cpp
|
||||
attitude_fw/ecl_pitch_controller.cpp
|
||||
attitude_fw/ecl_roll_controller.cpp
|
||||
attitude_fw/ecl_wheel_controller.cpp
|
||||
attitude_fw/ecl_yaw_controller.cpp
|
||||
EKF/airspeed_fusion.cpp
|
||||
EKF/control.cpp
|
||||
EKF/covariance.cpp
|
||||
EKF/drag_fusion.cpp
|
||||
EKF/ekf.cpp
|
||||
EKF/ekf_helper.cpp
|
||||
EKF/estimator_interface.cpp
|
||||
EKF/gps_checks.cpp
|
||||
EKF/mag_fusion.cpp
|
||||
EKF/optflow_fusion.cpp
|
||||
EKF/sideslip_fusion.cpp
|
||||
EKF/terrain_estimator.cpp
|
||||
EKF/vel_pos_fusion.cpp
|
||||
geo/geo.cpp
|
||||
geo_lookup/geo_mag_declination.cpp
|
||||
l1/ecl_l1_pos_controller.cpp
|
||||
tecs/tecs.cpp
|
||||
validation/data_validator.cpp
|
||||
validation/data_validator_group.cpp
|
||||
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(ECL CXX)
|
||||
|
||||
execute_process(
|
||||
COMMAND git describe --always --tags
|
||||
OUTPUT_VARIABLE git_tag
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
message(STATUS "PX4 ECL: Very lightweight Estimation & Control Library ${git_tag}")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
set(ECL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
# ECL standalone build
|
||||
add_definitions(-DECL_STANDALONE)
|
||||
|
||||
add_custom_target(prebuild_targets)
|
||||
|
||||
add_compile_options(
|
||||
-pedantic
|
||||
|
||||
-Wall
|
||||
-Wextra
|
||||
-Werror
|
||||
|
||||
-Wno-unused-parameter
|
||||
)
|
||||
|
||||
# fetch latest matrix from github
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(matrix
|
||||
GIT_REPOSITORY "https://github.com/PX4/Matrix.git"
|
||||
UPDATE_COMMAND ""
|
||||
PATCH_COMMAND ""
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
add_dependencies(prebuild_targets matrix)
|
||||
include_directories(${CMAKE_BINARY_DIR}/matrix-prefix/src/matrix)
|
||||
|
||||
add_subdirectory(mathlib)
|
||||
endif()
|
||||
|
||||
add_subdirectory(airdata)
|
||||
add_subdirectory(attitude_fw)
|
||||
add_subdirectory(EKF)
|
||||
add_subdirectory(geo)
|
||||
add_subdirectory(geo_lookup)
|
||||
add_subdirectory(l1)
|
||||
add_subdirectory(tecs)
|
||||
add_subdirectory(validation)
|
||||
|
||||
Reference in New Issue
Block a user