urdfdom icon indicating copy to clipboard operation
urdfdom copied to clipboard

Invalid path in urdfdom_INCLUDE_DIRS on Windows installation using vcpkg

Open jslee02 opened this issue 5 years ago • 0 comments

I am encountering an issue while installing urdfdom using vcpkg on Windows. The urdfdom-config.cmake file that is generated and installed contains the following issue: (CI log):

if (urdfdom_CONFIG_INCLUDED)
  return()
endif()
set(urdfdom_CONFIG_INCLUDED TRUE)

set(urdfdom_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include" "${_IMPORT_PREFIX}/include")

foreach(lib urdfdom_sensor;urdfdom_model_state;urdfdom_model;urdfdom_world)
  set(onelib "${lib}-NOTFOUND")
  find_library(onelib ${lib}
      PATHS "${CMAKE_CURRENT_LIST_DIR}/../../lib"
    NO_DEFAULT_PATH
    )
  if(NOT onelib)
    message(FATAL_ERROR "Library '${lib}' in package urdfdom is not installed properly")
  endif()
  list(APPEND urdfdom_LIBRARIES ${onelib})
endforeach()


foreach(dep urdfdom_headers;console_bridge)
  if(NOT ${dep}_FOUND)
    find_package(${dep})
  endif()
  list(APPEND urdfdom_INCLUDE_DIRS ${${dep}_INCLUDE_DIRS})
  list(APPEND urdfdom_LIBRARIES ${${dep}_LIBRARIES})
endforeach()

In line 6 of the urdfdom-config.cmake file, the variable urdfdom_INCLUDE_DIRS contains ${_IMPORT_PREFIX}/include, which is /include because _IMPORT_PREFIX is not defined for some reason. This seems to be causing a problem with TinyXML_INCLUDE_DIRS not being correctly defined on Windows. The relevant section of the urdfdom-config.cmake file is: https://github.com/ros/urdfdom/blob/0da4b20675cdbe14b532d484a1c17df85b4e1584/cmake/urdfdom-config.cmake.in#L6 where TinyXML_INCLUDE_DIRS is defined in the following way: https://github.com/ros/urdfdom/blob/0da4b20675cdbe14b532d484a1c17df85b4e1584/cmake/FindTinyXML.cmake#L56-L74

This issue is related to https://github.com/dartsim/dart/issues/1365

jslee02 avatar May 02 '20 19:05 jslee02