ament / ament_cmake

Supporting CMake packages for working with ament
Apache License 2.0
100 stars 124 forks source link

ament_vendor() does not install vendor project to correct path #475

Open felixf4xu opened 1 year ago

felixf4xu commented 1 year ago

Hi,

I'm building ros2/rosbag2/zstd_vendor and the cmake file is like:

ament_vendor(zstd_vendor
  SATISFIED ${zstd_FOUND}
  VCS_URL https://github.com/facebook/zstd.git
  VCS_VERSION v1.4.8
  SOURCE_SUBDIR build/cmake
  CMAKE_ARGS
    -DZSTD_BUILD_STATIC:BOOL=OFF
    -DZSTD_BUILD_SHARED:BOOL=ON
    -DZSTD_BUILD_PROGRAMS:BOOL=OFF
)

but the current result is that bin/include/lib are installed at C:\ros\rolling\install\opt\zstd_vendor image but by colcon build --merge-install, I think those 3 sub folders should be installed to C:\ros\rolling\install.

felixf4xu commented 1 year ago

oh, to fix the issue, I should change

install(
      DIRECTORY "${INSTALL_DIR}/"
      DESTINATION "opt/${PROJECT_NAME}"
      USE_SOURCE_PERMISSIONS
    )

to

install(
      DIRECTORY "${INSTALL_DIR}/"
      DESTINATION "${CMAKE_INSTALL_PREFIX}"
      USE_SOURCE_PERMISSIONS
    )