Adapted to Cmake plural variables *_DIRS and *_LIBRARIES

parent 35979ef1
#edit the following line to add the librarie's header files
FIND_PATH(dynamixel_INCLUDE_DIR 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/iridrivers /usr/local/include/iri/dynamixel /usr/include/iri/dynamixel)
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/iridrivers /usr/local/include/iri/dynamixel /usr/include/iri/dynamixel)
FIND_LIBRARY(dynamixel_LIBRARY
FIND_LIBRARY(dynamixel_LIBRARIES
NAMES dynamixel
PATHS /usr/local/lib/iridrivers /usr/local/lib/iri/dynamixel /usr/lib/iri/dynamixel)
SET(dynamixel_INCLUDE_DIRS ${dynamixel_INCLUDE_DIR})
SET(dynamixel_LIBRARIES ${dynamixel_LIBRARY})
SET(dynamixel_INCLUDE_DIR ${dynamixel_INCLUDE_DIRS})
SET(dynamixel_LIBRARY ${dynamixel_LIBRARIES})
IF (dynamixel_INCLUDE_DIR AND dynamixel_LIBRARY)
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}")
MESSAGE(STATUS "Found dynamixel: ${dynamixel_LIBRARIES}")
ENDIF (NOT dynamixel_FIND_QUIETLY)
ELSE (dynamixel_FOUND)
IF (dynamixel_FIND_REQUIRED)
......
......@@ -13,8 +13,8 @@ FIND_PACKAGE(comm REQUIRED)
find_package(Boost REQUIRED)
# edit the following line to add the necessary include directories
INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${comm_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${comm_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
SET_SOURCE_FILES_PROPERTIES(${XSD_SOURCES} PROPERTIES GENERATED 1)
......@@ -22,9 +22,9 @@ SET_SOURCE_FILES_PROPERTIES(${XSD_SOURCES} PROPERTIES GENERATED 1)
ADD_LIBRARY(dynamixel SHARED ${sources} ${XSD_SOURCES})
#edit the following line to add the necessary system libraries (if any)
TARGET_LINK_LIBRARIES(dynamixel ${iriutils_LIBRARY})
TARGET_LINK_LIBRARIES(dynamixel ${comm_LIBRARY})
TARGET_LINK_LIBRARIES(dynamixel ${XSD_LIBRARY})
TARGET_LINK_LIBRARIES(dynamixel ${iriutils_LIBRARIES})
TARGET_LINK_LIBRARIES(dynamixel ${comm_LIBRARIES})
TARGET_LINK_LIBRARIES(dynamixel ${XSD_LIBRARIES})
TARGET_LINK_LIBRARIES(dynamixel ${Boost_LIBRARIES})
ADD_DEPENDENCIES(dynamixel xsd_files_gen)
......
......@@ -4,14 +4,16 @@ 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)
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_PATH ${CMAKE_CURRENT_SOURCE_DIR})
......
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