Skip to content
Snippets Groups Projects

Resolve "Adapt to core CMakeLists.txt refactor"

Merged Mederic Fourmy requested to merge 22-adapt-to-core-cmakelists-txt-refactor into devel
Files
8
+ 0
88
#edit the following line to add the librarie's header files
FIND_PATH(
wolfgnss_INCLUDE_DIRS
NAMES gnss.found
PATHS /usr/local/include/iri-algorithms/wolf/plugin_gnss)
IF(wolfgnss_INCLUDE_DIRS)
MESSAGE("Found gnss include dirs: ${wolfgnss_INCLUDE_DIRS}")
ELSE(wolfgnss_INCLUDE_DIRS)
MESSAGE("Couldn't find gnss include dirs")
ENDIF(wolfgnss_INCLUDE_DIRS)
FIND_LIBRARY(
wolfgnss_LIBRARIES
NAMES libwolfgnss.so
PATHS /usr/local/lib)
IF(wolfgnss_LIBRARIES)
MESSAGE("Found gnss lib: ${wolfgnss_LIBRARIES}")
ELSE(wolfgnss_LIBRARIES)
MESSAGE("Couldn't find wolf gnss lib")
ENDIF(wolfgnss_LIBRARIES)
IF (wolfgnss_INCLUDE_DIRS AND wolfgnss_LIBRARIES)
SET(wolfgnss_FOUND TRUE)
ELSE(wolfgnss_INCLUDE_DIRS AND wolfgnss_LIBRARIES)
set(wolfgnss_FOUND FALSE)
ENDIF (wolfgnss_INCLUDE_DIRS AND wolfgnss_LIBRARIES)
IF (wolfgnss_FOUND)
IF (NOT wolfgnss_FIND_QUIETLY)
MESSAGE(STATUS "Found gnss: ${wolfgnss_LIBRARIES}")
ENDIF (NOT wolfgnss_FIND_QUIETLY)
ELSE (wolfgnss_FOUND)
IF (wolfgnss_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find wolf gnss")
ENDIF (wolfgnss_FIND_REQUIRED)
ENDIF (wolfgnss_FOUND)
macro(wolf_report_not_found REASON_MSG)
set(wolfgnss_FOUND FALSE)
unset(wolfgnss_INCLUDE_DIRS)
unset(wolfgnss_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 (wolfgnss_FIND_QUIETLY)
message(STATUS "Failed to find wolf gnss- " ${REASON_MSG} ${ARGN})
elseif(wolfgnss_FIND_REQUIRED)
message(FATAL_ERROR "Failed to find wolf gnss - " ${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 gnss - " ${REASON_MSG} ${ARGN})
endif ()
return()
endmacro(wolf_report_not_found)
if(NOT wolfgnss_FOUND)
wolf_report_not_found("Something went wrong while setting up wolf gnss.")
endif(NOT wolfgnss_FOUND)
# Set the include directories for wolf (itself).
set(wolfgnss_FOUND TRUE)
# Now we gather all the required dependencies for Wolf Laser
FIND_PACKAGE(gnss_utils REQUIRED)
list(APPEND wolfgnss_INCLUDE_DIRS ${gnss_utils_INCLUDE_DIRS})
list(APPEND wolfgnss_LIBRARIES ${gnss_utils_LIBRARY})
if(NOT wolf_FOUND)
FIND_PACKAGE(wolfcore REQUIRED)
#We reverse in order to insert at the start
list(REVERSE wolfgnss_INCLUDE_DIRS)
list(APPEND wolfgnss_INCLUDE_DIRS ${wolfcore_INCLUDE_DIRS})
list(REVERSE wolfgnss_INCLUDE_DIRS)
list(REVERSE wolfgnss_LIBRARIES)
list(APPEND wolfgnss_LIBRARIES ${wolfcore_LIBRARIES})
list(REVERSE wolfgnss_LIBRARIES)
endif()
# provide both INCLUDE_DIR and INCLUDE_DIRS
SET(wolfgnss_INCLUDE_DIR ${wolfgnss_INCLUDE_DIRS})
# provide both LIBRARY and LIBRARIES
SET(wolfgnss_LIBRARY ${wolfgnss_LIBRARIES})
\ No newline at end of file
Loading