Commit d4e6048e authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

Adapted to CMake plural variables *_DIRS and *_LIBRARIES

parent 6d12ff21
#edit the following line to add the librarie's header files
FIND_PATH(bno055_imu_driver_INCLUDE_DIR bno055_imu_driver.h bno055_imu_exceptions.h bno055_common.h bno055_imu_sim.h /usr/local/include/iri/bno055_imu /usr/include/iri/bno055_imu)
FIND_PATH(bno055_imu_driver_INCLUDE_DIRS bno055_imu_driver.h bno055_imu_exceptions.h bno055_common.h bno055_imu_sim.h /usr/local/include/iri/bno055_imu /usr/include/iri/bno055_imu)
FIND_LIBRARY(bno055_imu_driver_LIBRARY_aux
FIND_LIBRARY(bno055_imu_driver_LIBRARIES_aux
NAMES bno055_imu_driver
PATHS /usr/local/lib/iri/bno055_imu /usr/lib/iri/bno055_imu)
FIND_LIBRARY(bno055_imu_sim_LIBRARY_aux
FIND_LIBRARY(bno055_imu_sim_LIBRARIES_aux
NAMES bno055_imu_sim
PATHS /usr/local/lib/iri/bno055_imu /usr/lib/iri/bno055_imu)
IF (bno055_imu_driver_LIBRARY_aux AND bno055_imu_sim_LIBRARY_aux)
SET(bno055_imu_driver_LIBRARY ${bno055_imu_driver_LIBRARY_aux} ${bno055_imu_sim_LIBRARY_aux})
ELSE (bno055_imu_driver_LIBRARY_aux AND bno055_imu_sim_LIBRARY_aux)
MESSAGE(FATAL_ERROR "Could not find bn055_imu_driver ${bno055_imu_driver_LIBRARY_aux} or bno055_imu_sim ${bno055_imu_sim_LIBRARY_aux}")
ENDIF (bno055_imu_driver_LIBRARY_aux AND bno055_imu_sim_LIBRARY_aux)
IF (bno055_imu_driver_LIBRARIES_aux AND bno055_imu_sim_LIBRARIES_aux)
SET(bno055_imu_driver_LIBRARIES ${bno055_imu_driver_LIBRARIES_aux} ${bno055_imu_sim_LIBRARIES_aux})
ELSE (bno055_imu_driver_LIBRARIES_aux AND bno055_imu_sim_LIBRARIES_aux)
MESSAGE(FATAL_ERROR "Could not find bn055_imu_driver ${bno055_imu_driver_LIBRARIES_aux} or bno055_imu_sim ${bno055_imu_sim_LIBRARIES_aux}")
ENDIF (bno055_imu_driver_LIBRARIES_aux AND bno055_imu_sim_LIBRARIES_aux)
IF (bno055_imu_driver_INCLUDE_DIR AND bno055_imu_driver_LIBRARY)
SET(bno055_imu_driver_INCLUDE_DIR ${bno055_imu_driver_INCLUDE_DIRS})
SET(bno055_imu_driver_LIBRARY ${bno055_imu_driver_LIBRARIES})
IF (bno055_imu_driver_INCLUDE_DIRS AND bno055_imu_driver_LIBRARIES)
SET(bno055_imu_driver_FOUND TRUE)
ENDIF (bno055_imu_driver_INCLUDE_DIR AND bno055_imu_driver_LIBRARY)
ENDIF (bno055_imu_driver_INCLUDE_DIRS AND bno055_imu_driver_LIBRARIES)
IF (bno055_imu_driver_FOUND)
IF (NOT bno055_imu_driver_FIND_QUIETLY)
MESSAGE(STATUS "Found bno055_imu_driver: ${bno055_imu_driver_LIBRARY}")
MESSAGE(STATUS "Found bno055_imu_driver: ${bno055_imu_driver_LIBRARIES}")
ENDIF (NOT bno055_imu_driver_FIND_QUIETLY)
ELSE (bno055_imu_driver_FOUND)
IF (bno055_imu_driver_FIND_REQUIRED)
......
......@@ -11,19 +11,19 @@ FIND_PACKAGE(iriutils REQUIRED)
FIND_PACKAGE(comm REQUIRED)
# add the necessary include directories
INCLUDE_DIRECTORIES(../include)
INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${comm_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${comm_INCLUDE_DIRS})
# create the shared library
ADD_LIBRARY(bno055_imu_driver SHARED ${sources})
# link necessary libraries
TARGET_LINK_LIBRARIES(bno055_imu_driver ${iriutils_LIBRARY})
TARGET_LINK_LIBRARIES(bno055_imu_driver ${comm_LIBRARY})
TARGET_LINK_LIBRARIES(bno055_imu_driver ${iriutils_LIBRARIES})
TARGET_LINK_LIBRARIES(bno055_imu_driver ${comm_LIBRARIES})
# create the shared library
ADD_LIBRARY(bno055_imu_sim SHARED ${sources_sim})
# link necessary libraries
TARGET_LINK_LIBRARIES(bno055_imu_sim ${iriutils_LIBRARY})
TARGET_LINK_LIBRARIES(bno055_imu_sim ${comm_LIBRARY})
TARGET_LINK_LIBRARIES(bno055_imu_sim ${iriutils_LIBRARIES})
TARGET_LINK_LIBRARIES(bno055_imu_sim ${comm_LIBRARIES})
INSTALL(TARGETS bno055_imu_driver
RUNTIME DESTINATION bin
......
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