mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-20 23:37:35 +08:00
Renamed dsdlc target, library made static, added linux drivers project (empty yet)
This commit is contained in:
@@ -34,7 +34,7 @@ endif ()
|
||||
execute_process(COMMAND ./setup.py build WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dsdl_compiler)
|
||||
set(DSDLC_INPUTS "test/dsdl_test/root_ns_a" "test/dsdl_test/root_ns_b" "${CMAKE_CURRENT_SOURCE_DIR}/../dsdl/uavcan")
|
||||
set(DSDLC_OUTPUT "include/dsdlc_generated")
|
||||
add_custom_target(dsdlc dsdl_compiler/libuavcan_dsdlc ${DSDLC_INPUTS} -O${DSDLC_OUTPUT}
|
||||
add_custom_target(libuavcan_dsdlc dsdl_compiler/libuavcan_dsdlc ${DSDLC_INPUTS} -O${DSDLC_OUTPUT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories(${DSDLC_OUTPUT})
|
||||
|
||||
@@ -62,8 +62,8 @@ include_directories(include)
|
||||
# libuavcan
|
||||
#
|
||||
file(GLOB_RECURSE LIBUAVCAN_CXX_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
|
||||
add_library(uavcan SHARED ${LIBUAVCAN_CXX_FILES})
|
||||
add_dependencies(uavcan dsdlc)
|
||||
add_library(uavcan STATIC ${LIBUAVCAN_CXX_FILES})
|
||||
add_dependencies(uavcan libuavcan_dsdlc)
|
||||
|
||||
install(TARGETS uavcan DESTINATION lib)
|
||||
install(DIRECTORY include/uavcan DESTINATION include)
|
||||
@@ -111,11 +111,11 @@ if (DEBUG_BUILD)
|
||||
# Additional flavours of the library
|
||||
add_library(uavcan_cpp03 SHARED ${LIBUAVCAN_CXX_FILES})
|
||||
set_target_properties(uavcan_cpp03 PROPERTIES COMPILE_FLAGS ${cpp03_flags})
|
||||
add_dependencies(uavcan_cpp03 dsdlc)
|
||||
add_dependencies(uavcan_cpp03 libuavcan_dsdlc)
|
||||
|
||||
add_library(uavcan_optim SHARED ${LIBUAVCAN_CXX_FILES})
|
||||
set_target_properties(uavcan_optim PROPERTIES COMPILE_FLAGS ${optim_flags})
|
||||
add_dependencies(uavcan_optim dsdlc)
|
||||
add_dependencies(uavcan_optim libuavcan_dsdlc)
|
||||
|
||||
# GTest executables
|
||||
find_package(GTest REQUIRED)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(libuavcan_linux)
|
||||
|
||||
#
|
||||
# Library (header only)
|
||||
#
|
||||
install(DIRECTORY include/uavcan_linux DESTINATION include)
|
||||
|
||||
#
|
||||
# Test/demo executables
|
||||
#
|
||||
find_library(UAVCAN_LIB uavcan REQUIRED)
|
||||
include_directories(include)
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -pedantic -std=c++0x -g3 -O1") # GCC or Clang
|
||||
|
||||
add_executable(log_subscriber test/log_subscriber.cpp)
|
||||
target_link_libraries(log_subscriber ${UAVCAN_LIB})
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
num_cores=$(grep -c ^processor /proc/cpuinfo)
|
||||
if [ -z "$num_cores" ]; then
|
||||
echo "num_cores=? WTF?"
|
||||
num_cores=4
|
||||
fi
|
||||
|
||||
cppcheck . --error-exitcode=1 --quiet --enable=all --platform=unix64 --std=c99 --std=c++11 \
|
||||
--inline-suppr --force --template=gcc -j$num_cores \
|
||||
-Iinclude $@
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <uavcan/uavcan.hpp>
|
||||
#include <uavcan_linux/socketcan.hpp>
|
||||
#include <uavcan_linux/clock.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello owl." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user