Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid path in urdfdom_INCLUDE_DIRS on Windows installation using vcpkg #140

Open
jslee02 opened this issue May 2, 2020 · 0 comments
Open

Comments

@jslee02
Copy link
Contributor

jslee02 commented May 2, 2020

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:

set(@PKG_NAME@_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include" "@TinyXML_INCLUDE_DIRS@")

where TinyXML_INCLUDE_DIRS is defined in the following way:
# Find headers and libraries
find_path(TinyXML_INCLUDE_DIR NAMES tinyxml.h PATH_SUFFIXES "tinyxml" ${TinyXML_INCLUDE_PATH})
find_library(TinyXML_LIBRARY NAMES tinyxml PATH_SUFFIXES "tinyxml" ${TinyXML_LIBRARY_PATH})
mark_as_advanced(TinyXML_INCLUDE_DIR
TinyXML_LIBRARY)
# Output variables generation
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TinyXML DEFAULT_MSG TinyXML_LIBRARY
TinyXML_INCLUDE_DIR)
set(TinyXML_FOUND ${TINYXML_FOUND}) # Enforce case-correctness: Set appropriately cased variable...
unset(TINYXML_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args
if(TinyXML_FOUND)
set(TinyXML_INCLUDE_DIRS ${TinyXML_INCLUDE_DIR})
set(TinyXML_LIBRARIES ${TinyXML_LIBRARY})
endif()

This issue is related to dartsim/dart#1365

@jslee02 jslee02 changed the title Invalid path in urdfdom_INCLUDE_DIRS on Windows Invalid path in urdfdom_INCLUDE_DIRS on Windows installation using vcpkg Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant