mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 18:10:34 +08:00
Fixed installation rules
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
import os, sys, logging, argparse
|
||||
|
||||
RUNNING_FROM_SRC_DIR = os.path.abspath(__file__).endswith(os.path.join('libuavcan', 'dsdl_compiler', 'uavcan_dsdlc'))
|
||||
RUNNING_FROM_SRC_DIR = os.path.abspath(__file__).endswith(os.path.join('libuavcan', 'dsdl_compiler', 'libuavcan_dsdlc'))
|
||||
if RUNNING_FROM_SRC_DIR:
|
||||
print('Running from the source directory')
|
||||
scriptdir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
@@ -11,10 +11,23 @@ project(libuavcan_linux)
|
||||
#
|
||||
install(DIRECTORY include/uavcan_linux DESTINATION include)
|
||||
|
||||
#
|
||||
# Finding libuavcan - it will be a target if we're running from the top-level CMakeLists.txt,
|
||||
# otherwise try to find it in the system directories.
|
||||
#
|
||||
if (TARGET uavcan)
|
||||
message(STATUS "Using uavcan target; source dir: ${libuavcan_SOURCE_DIR}")
|
||||
set(UAVCAN_LIB uavcan)
|
||||
include_directories(${libuavcan_SOURCE_DIR}/include
|
||||
${libuavcan_SOURCE_DIR}/include/dsdlc_generated)
|
||||
else ()
|
||||
message(STATUS "Using installed uavcan library")
|
||||
find_library(UAVCAN_LIB uavcan REQUIRED)
|
||||
endif ()
|
||||
|
||||
#
|
||||
# Test/demo executables
|
||||
#
|
||||
find_library(UAVCAN_LIB uavcan REQUIRED)
|
||||
include_directories(include)
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -pedantic -std=c++0x -g3") # GCC or Clang
|
||||
|
||||
|
||||
Reference in New Issue
Block a user