Commit 212cbbaa authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Update find cmake. Add dependencies to comm and iriutils

parent faff90c5
#edit the following line to add the librarie's header files
FIND_PATH(lidar_lite_INCLUDE_DIR lidar_lite.h /usr/include/iridrivers /usr/local/include/iridrivers)
FIND_PATH(lidar_lite_INCLUDE_DIR lidar_lite.h /usr/include/iri/lidar_lite /usr/local/include/iri/lidar_lite)
FIND_LIBRARY(lidar_lite_LIBRARY
NAMES lidar_lite
PATHS /usr/lib /usr/local/lib /usr/local/lib/iridrivers)
PATHS /usr/lib /usr/lib/iri/lidar_lite /usr/local/lib /usr/local/lib/iri/lidar_lite)
SET(lidar_lite_INCLUDE_DIRS ${lidar_lite_INCLUDE_DIR})
SET(lidar_lite_LIBRARIES ${lidar_lite_LIBRARY})
IF (lidar_lite_INCLUDE_DIR AND lidar_lite_LIBRARY)
SET(lidar_lite_FOUND TRUE)
......
......@@ -6,15 +6,23 @@ SET(headers lidar_lite.h exceptions/exceptions.h exceptions/lidar_lite_exception
# locate the necessary dependencies
FIND_PACKAGE(usb_i2c_adapter REQUIRED)
FIND_PACKAGE(comm REQUIRED)
FIND_PACKAGE(iriutils REQUIRED)
# add the necessary include directories
INCLUDE_DIRECTORIES(. ${usb_i2c_adapter_INCLUDE_DIR})
INCLUDE_DIRECTORIES(.)
INCLUDE_DIRECTORIES(${usb_i2c_adapter_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${comm_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR})
# create the shared library
ADD_LIBRARY(lidar_lite SHARED ${sources})
# link necessary libraries
TARGET_LINK_LIBRARIES(lidar_lite ${usb_i2c_adapter_LIBRARY})
TARGET_LINK_LIBRARIES(lidar_lite ${comm_LIBRARY})
TARGET_LINK_LIBRARIES(lidar_lite ${iriutils_LIBRARY})
# Check G++ compiler version
include(CheckCXXCompilerFlag)
......@@ -31,9 +39,9 @@ endif()
# install
INSTALL(TARGETS lidar_lite
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/iridrivers
ARCHIVE DESTINATION lib/iridrivers)
INSTALL(FILES ${headers} DESTINATION include/iridrivers)
LIBRARY DESTINATION lib/iri/${PROJECT_NAME}
ARCHIVE DESTINATION lib/iri/${PROJECT_NAME})
INSTALL(FILES ${headers} DESTINATION include/iri/${PROJECT_NAME})
INSTALL(FILES ../Findlidar_lite.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
INSTALL(FILES ../99-lidar_lite.rules DESTINATION /etc/udev/rules.d/)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment