Commit 20b6226a authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

Adapted to CMake plural variables *_DIRS and *_LIBRARIES

parent 500aa925
#edit the following line to add the librarie's header files
FIND_PATH(dynamixel_motor_cont_INCLUDE_DIR dynamixel_motor.h dynamixel_motor_group.h dynamixel_registers.h dynamixel_motor_exceptions.h
FIND_PATH(dynamixel_motor_cont_INCLUDE_DIRS dynamixel_motor.h dynamixel_motor_group.h dynamixel_registers.h dynamixel_motor_exceptions.h
/usr/local/include/iridrivers /usr/local/include/iri/dynamixel_motor_cont /usr/include/iri/dynamixel_motor_cont)
FIND_LIBRARY(dynamixel_motor_cont_LIBRARY
FIND_LIBRARY(dynamixel_motor_cont_LIBRARIES
NAMES dynamixel_motor_cont
PATHS /usr/local/lib/iridrivers /usr/local/lib/iri/dynamixel_motor_cont /usr/lib/iri/dynamixel_motor_cont)
SET(dynamixel_motor_cont_INCLUDE_DIRS ${dynamixel_motor_cont_INCLUDE_DIR})
SET(dynamixel_motor_cont_LIBRARIES ${dynamixel_motor_cont_LIBRARY})
SET(dynamixel_motor_cont_INCLUDE_DIR ${dynamixel_motor_cont_INCLUDE_DIRS})
SET(dynamixel_motor_cont_LIBRARY ${dynamixel_motor_cont_LIBRARIES})
IF (dynamixel_motor_cont_INCLUDE_DIR AND dynamixel_motor_cont_LIBRARY)
IF (dynamixel_motor_cont_INCLUDE_DIRS AND dynamixel_motor_cont_LIBRARIES)
SET(dynamixel_motor_cont_FOUND TRUE)
ENDIF (dynamixel_motor_cont_INCLUDE_DIR AND dynamixel_motor_cont_LIBRARY)
ENDIF (dynamixel_motor_cont_INCLUDE_DIRS AND dynamixel_motor_cont_LIBRARIES)
IF (dynamixel_motor_cont_FOUND)
IF (NOT dynamixel_motor_cont_FIND_QUIETLY)
MESSAGE(STATUS "Found dynamixel_motor_cont: ${dynamixel_motor_cont_LIBRARY}")
MESSAGE(STATUS "Found dynamixel_motor_cont: ${dynamixel_motor_cont_LIBRARIES}")
ENDIF (NOT dynamixel_motor_cont_FIND_QUIETLY)
ELSE (dynamixel_motor_cont_FOUND)
IF (dynamixel_motor_cont_FIND_REQUIRED)
......
......@@ -16,14 +16,14 @@ FIND_PACKAGE(dynamixel REQUIRED)
FIND_PACKAGE(trajectory REQUIRED)
# edit the following line to add the necessary include directories
INCLUDE_DIRECTORIES(. ${iriutils_INCLUDE_DIR} ${comm_INCLUDE_DIR} ${dynamixel_INCLUDE_DIR} ${trajectory_INCLUDE_DIR})
INCLUDE_DIRECTORIES(. ${iriutils_INCLUDE_DIRS} ${comm_INCLUDE_DIRS} ${dynamixel_INCLUDE_DIRS} ${trajectory_INCLUDE_DIRS})
SET_SOURCE_FILES_PROPERTIES(${XSD_SOURCES} PROPERTIES GENERATED 1)
ADD_LIBRARY(dynamixel_motor_cont SHARED ${sources} ${XSD_SOURCES})
#edit the following line to add the necessary system libraries (if any)
TARGET_LINK_LIBRARIES(dynamixel_motor_cont ${iriutils_LIBRARY} ${comm_LIBRARY} ${dynamixel_LIBRARY} ${XSD_LIBRARY} ${trajectory_LIBRARY})
TARGET_LINK_LIBRARIES(dynamixel_motor_cont ${iriutils_LIBRARIES} ${comm_LIBRARIES} ${dynamixel_LIBRARIES} ${XSD_LIBRARIES} ${trajectory_LIBRARIES})
ADD_DEPENDENCIES(dynamixel_motor_cont xsd_files_gen)
......
......@@ -4,15 +4,18 @@ IF(EXISTS "/usr/include/xsd/cxx")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_HAVE_XSD" PARENT_SCOPE)
SET(XSD_FOUND TRUE)
MESSAGE(STATUS "Found the XML library ... adding support for XML files")
FIND_LIBRARY(XSD_LIBRARY
FIND_LIBRARY(XSD_LIBRARIES
NAMES xerces-c
PATHS /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu/)
SET(XSD_LIBRARY ${XSD_LIBRARIES})
ELSE(EXISTS "/usr/include/xsd/cxx")
MESSAGE(STATUS "XML library not found ... it will be impossible to handle XML files")
ENDIF(EXISTS "/usr/include/xsd/cxx")
IF(XSD_FOUND)
SET(XSD_LIBRARIES ${XSD_LIBRARIES} PARENT_SCOPE)
SET(XSD_LIBRARY ${XSD_LIBRARY} PARENT_SCOPE)
SET(XSD_FILES dynamixel_motor_cfg_file.xsd dynamixel_motor_group_cfg_file.xsd)
IF(XSD_FILES)
......
Supports Markdown
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