Skip to content
Snippets Groups Projects

Resolve "Adapt to CMakeLists.txt refactoring in core"

Merged Mederic Fourmy requested to merge 26-adapt-to-cmakelists-txt-refactoring-in-core into devel
Compare and
25 files
+ 157
224
Compare changes
  • Side-by-side
  • Inline
Files
25
+ 0
84
#edit the following line to add the librarie's header files
FIND_PATH(
wolfimu_INCLUDE_DIRS
NAMES imu.found
PATHS /usr/local/include/iri-algorithms/wolf/plugin_imu)
IF(wolfimu_INCLUDE_DIRS)
MESSAGE("Found wolf imu include dirs: ${wolfimu_INCLUDE_DIRS}")
ELSE(wolfimu_INCLUDE_DIRS)
MESSAGE("Couldn't find wolf imu include dirs")
ENDIF(wolfimu_INCLUDE_DIRS)
FIND_LIBRARY(
wolfimu_LIBRARIES
NAMES libwolfimu.so libwolfimu.dylib
PATHS /usr/local/lib)
IF(wolfimu_LIBRARIES)
MESSAGE("Found wolf imu lib: ${wolfimu_LIBRARIES}")
ELSE(wolfimu_LIBRARIES)
MESSAGE("Couldn't find wolf imu lib")
ENDIF(wolfimu_LIBRARIES)
IF (wolfimu_INCLUDE_DIRS AND wolfimu_LIBRARIES)
SET(wolfimu_FOUND TRUE)
ELSE(wolfimu_INCLUDE_DIRS AND wolfimu_LIBRARIES)
set(wolfimu_FOUND FALSE)
ENDIF (wolfimu_INCLUDE_DIRS AND wolfimu_LIBRARIES)
IF (wolfimu_FOUND)
IF (NOT wolfimu_FIND_QUIETLY)
MESSAGE(STATUS "Found wolf imu: ${wolfimu_LIBRARIES}")
ENDIF (NOT wolfimu_FIND_QUIETLY)
ELSE (wolfimu_FOUND)
IF (wolfimu_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find wolf imu")
ENDIF (wolfimu_FIND_REQUIRED)
ENDIF (wolfimu_FOUND)
macro(wolf_report_not_found REASON_MSG)
set(wolfimu_FOUND FALSE)
unset(wolfimu_INCLUDE_DIRS)
unset(wolfimu_LIBRARIES)
# Reset the CMake module path to its state when this script was called.
set(CMAKE_MODULE_PATH ${CALLERS_CMAKE_MODULE_PATH})
# Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by
# FindPackage() use the camelcase library name, not uppercase.
if (wolfimu_FIND_QUIETLY)
message(STATUS "Failed to find wolf imu- " ${REASON_MSG} ${ARGN})
elseif(wolfimu_FIND_REQUIRED)
message(FATAL_ERROR "Failed to find wolf imu - " ${REASON_MSG} ${ARGN})
else()
# Neither QUIETLY nor REQUIRED, use SEND_ERROR which emits an error
# that prevents generation, but continues configuration.
message(SEND_ERROR "Failed to find wolf imu - " ${REASON_MSG} ${ARGN})
endif ()
return()
endmacro(wolf_report_not_found)
if(NOT wolfimu_FOUND)
wolf_report_not_found("Something went wrong while setting up wolf imu.")
endif(NOT wolfimu_FOUND)
# Set the include directories for wolf (itself).
set(wolfimu_FOUND TRUE)
# Now we gather all the required dependencies for Wolf imu
if(NOT wolf_FOUND)
FIND_PACKAGE(wolfcore REQUIRED)
#We reverse in order to insert at the start
list(REVERSE wolfimu_INCLUDE_DIRS)
list(APPEND wolfimu_INCLUDE_DIRS ${wolfcore_INCLUDE_DIRS})
list(REVERSE wolfimu_INCLUDE_DIRS)
list(REVERSE wolfimu_LIBRARIES)
list(APPEND wolfimu_LIBRARIES ${wolfcore_LIBRARIES})
list(REVERSE wolfimu_LIBRARIES)
endif()
# provide both INCLUDE_DIR and INCLUDE_DIRS
SET(wolfimu_INCLUDE_DIR ${wolfimu_INCLUDE_DIRS})
# provide both LIBRARY and LIBRARIES
SET(wolfimu_LIBRARY ${wolfimu_LIBRARIES})
Loading