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

Merge branch '15-change-destination-of-libxxx-so-for-wolf-and-dependencies' into 'devel'

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

Closes #15

See merge request !15
parents ec4a8ffa ebf9610f
No related branches found
No related tags found
3 merge requests!18Release after RAL,!17After 2nd RAL submission,!15Resolve "Change destination of libxxx.so for WOLF and dependencies"
# Pre-requisites about cmake itself # Pre-requisites about cmake itself
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
if(COMMAND cmake_policy) if(COMMAND cmake_policy)
cmake_policy(SET CMP0005 NEW) cmake_policy(SET CMP0005 NEW)
...@@ -8,11 +8,12 @@ endif(COMMAND cmake_policy) ...@@ -8,11 +8,12 @@ endif(COMMAND cmake_policy)
# MAC OSX RPATH # MAC OSX RPATH
SET(CMAKE_MACOSX_RPATH 1) SET(CMAKE_MACOSX_RPATH 1)
# The project name # The project name
PROJECT(bodydynamics) PROJECT(bodydynamics)
set(PLUGIN_NAME wolf${PROJECT_NAME}) set(PLUGIN_NAME wolf${PROJECT_NAME})
MESSAGE("Starting ${PROJECT_NAME} CMakeLists ...")
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin) SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib) SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
SET(CMAKE_INSTALL_PREFIX /usr/local) SET(CMAKE_INSTALL_PREFIX /usr/local)
...@@ -38,13 +39,22 @@ endif() ...@@ -38,13 +39,22 @@ endif()
if(UNIX) if(UNIX)
# GCC is not strict enough by default, so enable most of the warnings. # GCC is not strict enough by default, so enable most of the warnings.
# set(CMAKE_CXX_FLAGS set(CMAKE_CXX_FLAGS
# "${CMAKE_CXX_FLAGS} -Werror=all -Werror=extra -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers") "${CMAKE_CXX_FLAGS} -Werror=all -Werror=extra -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers")
endif(UNIX) endif(UNIX)
IF(NOT BUILD_TESTS)
OPTION(BUILD_TESTS "Build Unit tests" ON)
ENDIF(NOT BUILD_TESTS)
IF(NOT BUILD_DEMOS)
OPTION(BUILD_DEMOS "Build demos in demos folder, requires robotpkg-multicontact-api and robotpkg-pinocchio packages" OFF)
ENDIF(NOT BUILD_DEMOS)
IF(NOT BUILD_DOC)
OPTION(BUILD_DOC "Build Documentation" OFF)
ENDIF(NOT BUILD_DOC)
OPTION(BUILD_TESTS "Build Unit tests" ON)
OPTION(BUILD_DEMOS "Build demos in demos folder, requires robotpkg-multicontact-api and robotpkg-pinocchio packages" OFF)
############# #############
## Testing ## ## Testing ##
############# #############
...@@ -57,28 +67,17 @@ if(BUILD_TESTS) ...@@ -57,28 +67,17 @@ if(BUILD_TESTS)
enable_testing() enable_testing()
endif() endif()
#+START_SRC --------------------------------------------------------------------------------------------------------------------------------
#Start WOLF build
MESSAGE("Starting WOLF CMakeLists ...")
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
#CMAKE modules #CMAKE modules
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules") SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
MESSAGE(STATUS ${CMAKE_MODULE_PATH}) MESSAGE(STATUS ${CMAKE_MODULE_PATH})
# Some wolf compilation options # Some wolf compilation options
IF((CMAKE_BUILD_TYPE MATCHES DEBUG) OR (CMAKE_BUILD_TYPE MATCHES debug) OR (CMAKE_BUILD_TYPE MATCHES Debug)) IF((CMAKE_BUILD_TYPE MATCHES DEBUG) OR (CMAKE_BUILD_TYPE MATCHES debug) OR (CMAKE_BUILD_TYPE MATCHES Debug))
set(_WOLF_DEBUG true) set(_WOLF_DEBUG true)
ENDIF() ENDIF()
option(_WOLF_TRACE "Enable wolf tracing macro" ON) option(_WOLF_TRACE "Enable wolf tracing macro" ON)
# option(BUILD_EXAMPLES "Build examples" OFF)
set(BUILD_TESTS true)
set(BUILD_EXAMPLES false)
# Does this has any other interest # Does this has any other interest
# but for the examples ? # but for the examples ?
# yes, for the tests ! # yes, for the tests !
...@@ -87,11 +86,8 @@ IF(BUILD_EXAMPLES OR BUILD_TESTS) ...@@ -87,11 +86,8 @@ IF(BUILD_EXAMPLES OR BUILD_TESTS)
set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR}) set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR})
ENDIF(BUILD_EXAMPLES OR BUILD_TESTS) ENDIF(BUILD_EXAMPLES OR BUILD_TESTS)
message("UPPER_NAME ${UPPER_NAME}")
#find dependencies. #find dependencies.
#FIND_PACKAGE(wolfcore REQUIRED) FIND_PACKAGE(wolfcore REQUIRED)
FIND_PACKAGE(wolfimu REQUIRED) FIND_PACKAGE(wolfimu REQUIRED)
# Define the directory where will be the configured config.h # Define the directory where will be the configured config.h
...@@ -110,11 +106,12 @@ ENDIF() ...@@ -110,11 +106,12 @@ ENDIF()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/internal/config.h.in "${WOLF_CONFIG_DIR}/config.h") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/internal/config.h.in "${WOLF_CONFIG_DIR}/config.h")
include_directories("${PROJECT_BINARY_DIR}/conf") include_directories("${PROJECT_BINARY_DIR}/conf")
include_directories("include") #INCLUDES SECTION
# ==============================
INCLUDE_DIRECTORIES(${wolfimu_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${wolfimu_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(BEFORE "include")
#HEADERS #HEADERS
SET(HDRS_MATH SET(HDRS_MATH
include/bodydynamics/math/force_torque_delta_tools.h include/bodydynamics/math/force_torque_delta_tools.h
) )
...@@ -135,8 +132,6 @@ include/bodydynamics/feature/feature_force_torque.h ...@@ -135,8 +132,6 @@ include/bodydynamics/feature/feature_force_torque.h
include/bodydynamics/feature/feature_force_torque_preint.h include/bodydynamics/feature/feature_force_torque_preint.h
include/bodydynamics/feature/feature_inertial_kinematics.h include/bodydynamics/feature/feature_inertial_kinematics.h
) )
SET(HDRS_LANDMARK
)
SET(HDRS_PROCESSOR SET(HDRS_PROCESSOR
include/bodydynamics/processor/processor_force_torque_preint.h include/bodydynamics/processor/processor_force_torque_preint.h
include/bodydynamics/processor/processor_inertial_kinematics.h include/bodydynamics/processor/processor_inertial_kinematics.h
...@@ -155,15 +150,11 @@ src/capture/capture_inertial_kinematics.cpp ...@@ -155,15 +150,11 @@ src/capture/capture_inertial_kinematics.cpp
src/capture/capture_leg_odom.cpp src/capture/capture_leg_odom.cpp
src/capture/capture_point_feet_nomove.cpp src/capture/capture_point_feet_nomove.cpp
) )
SET(SRCS_FACTOR
)
SET(SRCS_FEATURE SET(SRCS_FEATURE
src/feature/feature_force_torque.cpp src/feature/feature_force_torque.cpp
src/feature/feature_force_torque_preint.cpp src/feature/feature_force_torque_preint.cpp
src/feature/feature_inertial_kinematics.cpp src/feature/feature_inertial_kinematics.cpp
) )
SET(SRCS_LANDMARK
)
SET(SRCS_PROCESSOR SET(SRCS_PROCESSOR
src/processor/processor_force_torque_preint.cpp src/processor/processor_force_torque_preint.cpp
src/processor/processor_inertial_kinematics.cpp src/processor/processor_inertial_kinematics.cpp
...@@ -179,15 +170,11 @@ src/sensor/sensor_point_feet_nomove.cpp ...@@ -179,15 +170,11 @@ src/sensor/sensor_point_feet_nomove.cpp
ADD_LIBRARY(${PLUGIN_NAME} ADD_LIBRARY(${PLUGIN_NAME}
SHARED SHARED
${SRCS_CAPTURE} ${SRCS_CAPTURE}
${SRCS_FACTOR}
${SRCS_FEATURE} ${SRCS_FEATURE}
${SRCS_MATH}
${SRCS_PROCESSOR} ${SRCS_PROCESSOR}
${SRCS_SENSOR} ${SRCS_SENSOR}
${SRCS_YAML}
) )
# Set compiler options # Set compiler options
# ==================== # ====================
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
...@@ -200,9 +187,8 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ...@@ -200,9 +187,8 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC # using GCC
endif() endif()
#Link the created libraries
#===============EXAMPLE=========================
# Link the library with the required dependencies
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} ${wolfimu_LIBRARIES}) TARGET_LINK_LIBRARIES(${PLUGIN_NAME} ${wolfimu_LIBRARIES})
# Build demos # Build demos
...@@ -219,61 +205,30 @@ IF(BUILD_TESTS) ...@@ -219,61 +205,30 @@ IF(BUILD_TESTS)
ENDIF(BUILD_TESTS) ENDIF(BUILD_TESTS)
#install library #install library
#============================================================= #=============================================================
INSTALL(TARGETS ${PLUGIN_NAME} EXPORT ${PLUGIN_NAME}Targets INSTALL(TARGETS ${PLUGIN_NAME} EXPORT ${PLUGIN_NAME}Targets
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/iri-algorithms LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/iri-algorithms) ARCHIVE DESTINATION lib)
install(EXPORT ${PLUGIN_NAME}Targets DESTINATION lib/cmake/${PLUGIN_NAME}) install(EXPORT ${PLUGIN_NAME}Targets DESTINATION lib/cmake/${PLUGIN_NAME})
#install headers #install headers
INSTALL(FILES ${HDRS_MATH}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/math)
INSTALL(FILES ${HDRS_UTILS}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/utils)
INSTALL(FILES ${HDRS_PROBLEM}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/problem)
INSTALL(FILES ${HDRS_HARDWARE}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/hardware)
INSTALL(FILES ${HDRS_TRAJECTORY}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/trajectory)
INSTALL(FILES ${HDRS_MAP}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/map)
INSTALL(FILES ${HDRS_FRAME}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/frame)
INSTALL(FILES ${HDRS_STATE_BLOCK}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/state_block)
INSTALL(FILES ${HDRS_COMMON}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/common)
INSTALL(FILES ${HDRS_DTASSC}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/association)
INSTALL(FILES ${HDRS_CAPTURE} INSTALL(FILES ${HDRS_CAPTURE}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/capture) DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/capture)
INSTALL(FILES ${HDRS_FACTOR} INSTALL(FILES ${HDRS_FACTOR}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/factor) DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/factor)
INSTALL(FILES ${HDRS_FEATURE} INSTALL(FILES ${HDRS_FEATURE}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/feature) DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/feature)
INSTALL(FILES ${HDRS_SENSOR} INSTALL(FILES ${HDRS_MATH}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/sensor) DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/math)
INSTALL(FILES ${HDRS_PROCESSOR} INSTALL(FILES ${HDRS_PROCESSOR}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/processor) DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/processor)
INSTALL(FILES ${HDRS_LANDMARK} INSTALL(FILES ${HDRS_SENSOR}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/landmark) DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/sensor)
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_YAML}
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/yaml)
FILE(WRITE ${PROJECT_NAME}.found "") FILE(WRITE ${PROJECT_NAME}.found "")
INSTALL(FILES ${PROJECT_NAME}.found INSTALL(FILES ${PROJECT_NAME}.found
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}) DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME})
INSTALL(FILES "${WOLF_CONFIG_DIR}/config.h" INSTALL(FILES "${WOLF_CONFIG_DIR}/config.h"
DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/internal) DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/internal)
...@@ -281,7 +236,6 @@ INSTALL(FILES "${CMAKE_SOURCE_DIR}/cmake_modules/${PLUGIN_NAME}Config.cmake" DES ...@@ -281,7 +236,6 @@ INSTALL(FILES "${CMAKE_SOURCE_DIR}/cmake_modules/${PLUGIN_NAME}Config.cmake" DES
export(PACKAGE ${PLUGIN_NAME}) export(PACKAGE ${PLUGIN_NAME})
#-END_SRC --------------------------------------------------------------------------------------------------------------------------------
FIND_PACKAGE(Doxygen) FIND_PACKAGE(Doxygen)
FIND_PATH(IRI_DOC_DIR doxygen.conf ${CMAKE_SOURCE_DIR}/doc/iri_doc/) FIND_PATH(IRI_DOC_DIR doxygen.conf ${CMAKE_SOURCE_DIR}/doc/iri_doc/)
......
...@@ -12,7 +12,7 @@ ENDIF(wolfbodydynamics_INCLUDE_DIRS) ...@@ -12,7 +12,7 @@ ENDIF(wolfbodydynamics_INCLUDE_DIRS)
FIND_LIBRARY( FIND_LIBRARY(
wolfbodydynamics_LIBRARIES wolfbodydynamics_LIBRARIES
NAMES libwolfbodydynamics.so NAMES libwolfbodydynamics.so
PATHS /usr/local/lib/iri-algorithms) PATHS /usr/local/lib)
IF(wolfbodydynamics_LIBRARIES) IF(wolfbodydynamics_LIBRARIES)
MESSAGE("Found wolf bodydynamics lib: ${wolfbodydynamics_LIBRARIES}") MESSAGE("Found wolf bodydynamics lib: ${wolfbodydynamics_LIBRARIES}")
ELSE(wolfbodydynamics_LIBRARIES) ELSE(wolfbodydynamics_LIBRARIES)
...@@ -83,4 +83,9 @@ if(NOT wolf_FOUND) ...@@ -83,4 +83,9 @@ if(NOT wolf_FOUND)
list(REVERSE wolfbodydynamics_LIBRARIES) list(REVERSE wolfbodydynamics_LIBRARIES)
list(APPEND wolfbodydynamics_LIBRARIES ${wolfcore_LIBRARIES}) list(APPEND wolfbodydynamics_LIBRARIES ${wolfcore_LIBRARIES})
list(REVERSE wolfbodydynamics_LIBRARIES) list(REVERSE wolfbodydynamics_LIBRARIES)
endif() endif()
\ No newline at end of file
# provide both INCLUDE_DIR and INCLUDE_DIRS
SET(wolfbodydynamics_INCLUDE_DIR ${wolfbodydynamics_INCLUDE_DIRS})
# provide both LIBRARY and LIBRARIES
SET(wolfbodydynamics_LIBRARY ${wolfbodydynamics_LIBRARIES})
\ No newline at end of file
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