Fixed installation rules

This commit is contained in:
Pavel Kirienko
2014-03-31 23:53:42 +04:00
parent c80e0388eb
commit 5f8eb61a6f
2 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -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__))
+14 -1
View 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