Ubuntu18 changes

parent 396f5e4f
......@@ -8,6 +8,7 @@ endif(COMMAND cmake_policy)
# The project name and the type of project
PROJECT(dynamixel)
SET(PACKAGE_NAME dynamixel)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
......@@ -61,6 +62,8 @@ IF (UNIX)
ADD_CUSTOM_COMMAND(
COMMENT "uninstall package"
COMMAND xargs ARGS rm < install_manifest.txt
COMMAND rm -rd ${CMAKE_INSTALL_PREFIX}/lib/iri/${PROJECT_NAME}
COMMAND rm -rd ${CMAKE_INSTALL_PREFIX}/include/iri/${PROJECT_NAME}
TARGET uninstall
)
......@@ -71,19 +74,24 @@ ELSE(UNIX)
)
ENDIF(UNIX)
IF (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
SET (X86 TRUE)
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
ELSE ()
SET (X86 FALSE)
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
ENDIF()
IF (UNIX)
SET(CPACK_PACKAGE_FILE_NAME "iri-${PROJECT_NAME}-dev-${CPACK_PACKAGE_VERSION}${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_PACKAGE_FILE_NAME "iri-${PROJECT_NAME}-dev-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
SET(CPACK_PACKAGE_NAME "iri-${PROJECT_NAME}-dev")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Part of IRI-laboratory libraries. More information at http://wikiri.upc.es/index.php/Robotics_Lab")
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
SET(CPACK_PACKAGING_INSTALL_PREFIX /usr)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "galenya - labrobotica@iri.upc.edu")
SET(CPACK_SET_DESTDIR "ON") # Necessary because of the absolute install paths
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-iriutils-dev (>= 1.0~${DISTRIB})")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-comm-dev (>= 1.0~${DISTRIB})")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "labrobotica - labrobotica@iri.upc.edu")
INCLUDE(CPack)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "iri-iriutils-dev (>= 1.0~${DISTRIB}), iri-comm-dev (>= 1.0~${DISTRIB}), libxerces-c-dev (>= 1.0~${DISTRIB}), xsdcxx (>= 1.0~${DISTRIB}), libboost-all-dev (>= 1.0~${DISTRIB})")
ELSE(UNIX)
ADD_CUSTOM_COMMAND(
COMMENT "packaging only implemented in unix"
......
#edit the following line to add the librarie's header files
FIND_PATH(dynamixel_INCLUDE_DIR dynamixel.h dynamixelserver.h dynamixelexceptions.h /usr/include/iridrivers /usr/local/include/iridrivers)
FIND_PATH(dynamixel_INCLUDE_DIRS dynamixel.h dynamixelserver.h dynamixelexceptions.h dynamixel_common.h dynamixel_slave.h dynamixel_slave_ftdi.h dynamixel_slave_serial.h dynamixelserver_ftdi.h dynamixelserver_serial.h /usr/local/include/iri/dynamixel /usr/include/iri/dynamixel)
FIND_LIBRARY(dynamixel_LIBRARY
NAMES dynamixel
PATHS /usr/lib/iridrivers /usr/local/lib /usr/local/lib/iridrivers)
FIND_LIBRARY(dynamixel_LIBRARIES
NAMES dynamixel
PATHS /usr/local/lib/iri/dynamixel /usr/lib/iri/dynamixel)
IF (dynamixel_INCLUDE_DIR AND dynamixel_LIBRARY)
SET(dynamixel_INCLUDE_DIR ${dynamixel_INCLUDE_DIRS})
SET(dynamixel_LIBRARY ${dynamixel_LIBRARIES})
IF (dynamixel_INCLUDE_DIRS AND dynamixel_LIBRARIES)
SET(dynamixel_FOUND TRUE)
ENDIF (dynamixel_INCLUDE_DIR AND dynamixel_LIBRARY)
ENDIF (dynamixel_INCLUDE_DIRS AND dynamixel_LIBRARIES)
IF (dynamixel_FOUND)
IF (NOT dynamixel_FIND_QUIETLY)
MESSAGE(STATUS "Found dynamixel: ${dynamixel_LIBRARY}")
ENDIF (NOT dynamixel_FIND_QUIETLY)
IF (NOT dynamixel_FIND_QUIETLY)
MESSAGE(STATUS "Found dynamixel: ${dynamixel_LIBRARIES}")
ENDIF (NOT dynamixel_FIND_QUIETLY)
ELSE (dynamixel_FOUND)
IF (dynamixel_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find dynamixel")
ENDIF (dynamixel_FIND_REQUIRED)
IF (dynamixel_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find dynamixel")
ENDIF (dynamixel_FIND_REQUIRED)
ENDIF (dynamixel_FOUND)
......@@ -31,11 +31,11 @@ ADD_DEPENDENCIES(dynamixel xsd_files_gen)
INSTALL(TARGETS dynamixel
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/iridrivers
ARCHIVE DESTINATION lib/iridrivers
LIBRARY DESTINATION lib/iri/${PROJECT_NAME}
ARCHIVE DESTINATION lib/iri/${PROJECT_NAME}
)
INSTALL(FILES ${headers} DESTINATION include/iridrivers)
INSTALL(FILES ${headers} DESTINATION include/iri/${PROJECT_NAME})
INSTALL(FILES ../Finddynamixel.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
......
Markdown is supported
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