From 20b6226a80fb77df80312392492bb9e3421bfa97 Mon Sep 17 00:00:00 2001 From: Alejandro Lopez Gestoso <alopez@iri.upc.edu> Date: Wed, 29 May 2019 12:05:30 +0200 Subject: [PATCH] Adapted to CMake plural variables *_DIRS and *_LIBRARIES --- Finddynamixel_motor_cont.cmake | 14 +++++++------- src/CMakeLists.txt | 4 ++-- src/xml/CMakeLists.txt | 5 ++++- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Finddynamixel_motor_cont.cmake b/Finddynamixel_motor_cont.cmake index 637d146..b29c47f 100644 --- a/Finddynamixel_motor_cont.cmake +++ b/Finddynamixel_motor_cont.cmake @@ -1,21 +1,21 @@ #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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42f47f7..823bb32 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/xml/CMakeLists.txt b/src/xml/CMakeLists.txt index d8a5585..2dea08f 100644 --- a/src/xml/CMakeLists.txt +++ b/src/xml/CMakeLists.txt @@ -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) -- GitLab