Skip to content
Snippets Groups Projects
Commit 4e1310be authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

Resolve "Change destination of libxxx.so for WOLF and dependencies"

parent fa63a189
No related branches found
No related tags found
3 merge requests!39release after RAL,!38After 2nd RAL submission,!36Resolve "Change destination of libxxx.so for WOLF and dependencies"
# Pre-requisites about cmake itself
CMAKE_MINimuM_REQUIRED(VERSION 2.6)
CMAKE_MINimuM_REQUIRED(VERSION 2.8)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0005 NEW)
......@@ -8,11 +8,11 @@ endif(COMMAND cmake_policy)
# MAC OSX RPATH
SET(CMAKE_MACOSX_RPATH 1)
# The project name
PROJECT(imu)
set(PLUGIN_NAME "wolf${PROJECT_NAME}")
MESSAGE("Starting ${PROJECT_NAME} CMakeLists ...")
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
......@@ -67,16 +67,11 @@ if(BUILD_TESTS)
enable_testing()
endif()
MESSAGE("Starting ${PROJECT_NAME} CMakeLists ...")
CMAKE_MINimuM_REQUIRED(VERSION 2.8)
#CMAKE modules
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
MESSAGE(STATUS ${CMAKE_MODULE_PATH})
# Some wolf compilation options
IF((CMAKE_BUILD_TYPE MATCHES DEBUG) OR (CMAKE_BUILD_TYPE MATCHES debug) OR (CMAKE_BUILD_TYPE MATCHES Debug))
set(_WOLF_DEBUG true)
ENDIF()
......@@ -91,7 +86,6 @@ IF(BUILD_EXAMPLES OR BUILD_TESTS)
set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR})
ENDIF(BUILD_EXAMPLES OR BUILD_TESTS)
#find dependencies.
# ============EXAMPLE==================
FIND_PACKAGE(wolfcore REQUIRED)
......@@ -119,14 +113,6 @@ INCLUDE_DIRECTORIES(${wolfcore_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(BEFORE "include")
#HEADERS
SET(HDRS_COMMON
)
SET(HDRS_MATH
include/imu/math/imu_tools.h
)
SET(HDRS_UTILS
)
SET(HDRS_CAPTURE
include/imu/capture/capture_compass.h
include/imu/capture/capture_imu.h
......@@ -140,7 +126,8 @@ SET(HDRS_FEATURE
include/imu/feature/feature_imu.h
include/imu/feature/feature_imu2d.h
)
SET(HDRS_LANDMARK
SET(HDRS_MATH
include/imu/math/imu_tools.h
)
SET(HDRS_PROCESSOR
include/imu/processor/processor_compass.h
......@@ -152,33 +139,15 @@ SET(HDRS_SENSOR
include/imu/sensor/sensor_imu.h
include/imu/sensor/sensor_imu2d.h
)
SET(HDRS_SOLVER
)
SET(HDRS_DTASSC
)
#SOURCES
SET(SRCS_COMMON
)
SET(SRCS_MATH
include/imu/math/imu_tools.h
include/imu/math/imu2d_tools.h
)
SET(SRCS_UTILS
)
SET(SRCS_CAPTURE
src/capture/capture_imu.cpp
)
SET(SRCS_FACTOR
)
SET(SRCS_FEATURE
src/feature/feature_imu.cpp
src/feature/feature_imu2d.cpp
)
SET(SRCS_LANDMARK
)
SET(SRCS_PROCESSOR
src/processor/processor_compass.cpp
src/processor/processor_imu.cpp
......@@ -191,55 +160,20 @@ SET(SRCS_SENSOR
src/sensor/sensor_imu.cpp
src/sensor/sensor_imu2d.cpp
)
SET(SRCS_DTASSC
)
SET(SRCS_SOLVER
)
SET(SRCS_YAML
src/yaml/processor_imu_yaml.cpp
src/yaml/processor_imu2d_yaml.cpp
src/yaml/sensor_imu_yaml.cpp
src/yaml/sensor_imu2d_yaml.cpp
)
#OPTIONALS
#optional HDRS and SRCS
# ==================EXAMPLE===============
# IF (Ceres_FOUND)
# SET(HDRS_WRAPPER
# include/base/solver_suitesparse/sparse_utils.h
# include/base/solver/solver_manager.h
# include/base/ceres_wrapper/ceres_manager.h
# include/base/ceres_wrapper/cost_function_wrapper.h
# include/base/ceres_wrapper/create_numeric_diff_cost_function.h
# include/base/ceres_wrapper/local_parametrization_wrapper.h
# )
# SET(SRCS_WRAPPER
# src/solver/solver_manager.cpp
# src/ceres_wrapper/ceres_manager.cpp
# src/ceres_wrapper/local_parametrization_wrapper.cpp
# )
# ELSE(Ceres_FOUND)
# SET(HDRS_WRAPPER)
# SET(SRCS_WRAPPER)
# ENDIF(Ceres_FOUND)
# create the shared library
ADD_LIBRARY(${PLUGIN_NAME}
SHARED
${SRCS_BASE}
${SRCS_CAPTURE}
${SRCS_COMMON}
${SRCS_DTASSC}
${SRCS_FACTOR}
${SRCS_FEATURE}
${SRCS_LANDMARK}
${SRCS_MATH}
${SRCS_PROCESSOR}
${SRCS_SENSOR}
${SRCS_SOLVER}
${SRCS_UTILS}
${SRCS_WRAPPER}
${SRCS_YAML}
)
......@@ -255,11 +189,9 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
endif()
#Link the created libraries
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} ${wolfcore_LIBRARIES})
#Build tests
#===============EXAMPLE=========================
IF(BUILD_TESTS)
......@@ -269,53 +201,34 @@ ENDIF(BUILD_TESTS)
#install library
#=============================================================
INSTALL(TARGETS ${PLUGIN_NAME} EXPORT ${PLUGIN_NAME}Targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/iri-algorithms
ARCHIVE DESTINATION lib/iri-algorithms)
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(EXPORT ${PLUGIN_NAME}Targets DESTINATION lib/cmake/${PLUGIN_NAME})
#install headers
INSTALL(FILES ${HDRS_DTASSC}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/association)
INSTALL(FILES ${HDRS_MATH}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/math)
INSTALL(FILES ${HDRS_COMMON}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/common)
INSTALL(FILES ${HDRS_UTILS}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/utils)
INSTALL(FILES ${HDRS_CAPTURE}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/capture)
INSTALL(FILES ${HDRS_FACTOR}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/factor)
INSTALL(FILES ${HDRS_FEATURE}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/feature)
INSTALL(FILES ${HDRS_SENSOR}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/sensor)
INSTALL(FILES ${HDRS_MATH}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/math)
INSTALL(FILES ${HDRS_PROCESSOR}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/processor)
INSTALL(FILES ${HDRS_LANDMARK}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/landmark)
INSTALL(FILES ${HDRS_WRAPPER}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/ceres_wrapper)
#INSTALL(FILES ${HDRS_SOLVER_SUITESPARSE}
# DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/solver_suitesparse)
INSTALL(FILES ${HDRS_SOLVER}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/solver)
INSTALL(FILES ${HDRS_SERIALIZATION}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/serialization)
INSTALL(FILES ${HDRS_YAML}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/yaml)
INSTALL(FILES ${HDRS_SENSOR}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/sensor)
FILE(WRITE imu.found "")
INSTALL(FILES ${PROJECT_NAME}.found
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME})
FILE(WRITE imu.found "")
INSTALL(FILES "${WOLF_CONFIG_DIR}/config.h"
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/internal)
INSTALL(FILES "${CMAKE_SOURCE_DIR}/cmake_modules/${PLUGIN_NAME}Config.cmake" DESTINATION "lib/cmake/${PLUGIN_NAME}")
INSTALL(DIRECTORY ${SPDLOG_INCLUDE_DIRS} DESTINATION "include/iri-algorithms/")
export(PACKAGE ${PLUGIN_NAME})
......
......@@ -12,7 +12,7 @@ ENDIF(wolfimu_INCLUDE_DIRS)
FIND_LIBRARY(
wolfimu_LIBRARIES
NAMES libwolfimu.so libwolfimu.dylib
PATHS /usr/local/lib/iri-algorithms)
PATHS /usr/local/lib)
IF(wolfimu_LIBRARIES)
MESSAGE("Found wolf imu lib: ${wolfimu_LIBRARIES}")
ELSE(wolfimu_LIBRARIES)
......@@ -77,3 +77,8 @@ if(NOT wolf_FOUND)
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})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment