Skip to content
Snippets Groups Projects
Commit 71c95eca authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

Adapted to CMake plural variables *_DIRS and *_LIBRARIES

parent 30e879ad
No related branches found
No related tags found
No related merge requests found
#edit the following line to add the librarie's header files
FIND_PATH(dynamixel_pan_tilt_INCLUDE_DIR dynamixel_pan_tilt.h dynamixel_pan_tilt_exceptions.h /usr/local/include/iridrivers /usr/local/include/iri/dynamixel_pan_tilt /usr/include/iri/dynamixel_pan_tilt)
FIND_PATH(dynamixel_pan_tilt_INCLUDE_DIRS dynamixel_pan_tilt.h dynamixel_pan_tilt_exceptions.h /usr/local/include/iridrivers /usr/local/include/iri/dynamixel_pan_tilt /usr/include/iri/dynamixel_pan_tilt)
FIND_LIBRARY(dynamixel_pan_tilt_LIBRARY
FIND_LIBRARY(dynamixel_pan_tilt_LIBRARIES
NAMES dynamixel_pan_tilt
PATHS /usr/local/lib/iridrivers /usr/local/lib/iri/dynamixel_pan_tilt /usr/lib/iri/dynamixel_pan_tilt)
IF (dynamixel_pan_tilt_INCLUDE_DIR AND dynamixel_pan_tilt_LIBRARY)
SET(dynamixel_pan_tilt_INCLUDE_DIR ${dynamixel_pan_tilt_INCLUDE_DIRS})
SET(dynamixel_pan_tilt_LIBRARY ${dynamixel_pan_tilt_LIBRARIES})
IF (dynamixel_pan_tilt_INCLUDE_DIRS AND dynamixel_pan_tilt_LIBRARIES)
SET(dynamixel_pan_tilt_FOUND TRUE)
ENDIF (dynamixel_pan_tilt_INCLUDE_DIR AND dynamixel_pan_tilt_LIBRARY)
ENDIF (dynamixel_pan_tilt_INCLUDE_DIRS AND dynamixel_pan_tilt_LIBRARIES)
IF (dynamixel_pan_tilt_FOUND)
IF (NOT dynamixel_pan_tilt_FIND_QUIETLY)
MESSAGE(STATUS "Found dynamixel_pan_tilt: ${dynamixel_pan_tilt_LIBRARY}")
MESSAGE(STATUS "Found dynamixel_pan_tilt: ${dynamixel_pan_tilt_LIBRARIES}")
ENDIF (NOT dynamixel_pan_tilt_FIND_QUIETLY)
ELSE (dynamixel_pan_tilt_FOUND)
IF (dynamixel_pan_tilt_FIND_REQUIRED)
......
......@@ -17,14 +17,14 @@ FIND_PACKAGE(dynamixel REQUIRED)
FIND_PACKAGE(dynamixel_motor_cont REQUIRED)
# edit the following line to add the necessary include directories
INCLUDE_DIRECTORIES(. ${iriutils_INCLUDE_DIR} ${comm_INCLUDE_DIR} ${dynamixel_INCLUDE_DIR} ${dynamixel_motor_cont_INCLUDE_DIR})
INCLUDE_DIRECTORIES(. ${iriutils_INCLUDE_DIRS} ${comm_INCLUDE_DIRS} ${dynamixel_INCLUDE_DIRS} ${dynamixel_motor_cont_INCLUDE_DIRS})
SET_SOURCE_FILES_PROPERTIES(${XSD_SOURCES} PROPERTIES GENERATED 1)
ADD_LIBRARY(dynamixel_pan_tilt SHARED ${sources} ${XSD_SOURCES})
#edit the following line to add the necessary system libraries (if any)
TARGET_LINK_LIBRARIES(dynamixel_pan_tilt ${iriutils_LIBRARY} ${comm_LIBRARY} ${dynamixel_LIBRARY} ${dynamixel_motor_cont_LIBRARY} ${XSD_LIBRARY})
TARGET_LINK_LIBRARIES(dynamixel_pan_tilt ${iriutils_LIBRARIES} ${comm_LIBRARIES} ${dynamixel_LIBRARIES} ${dynamixel_motor_cont_LIBRARIES} ${XSD_LIBRARIES})
ADD_DEPENDENCIES(dynamixel_pan_tilt xsd_files_gen)
......
......@@ -4,17 +4,19 @@ 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_pan_tilt_cfg_file.xsd)
IF(XSD_FILES)
SET(XSD_PATH ${CMAKE_CURRENT_SOURCE_DIR})
......
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