question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Usage of C++ API in CMake Project

See original GitHub issue

Hi, I am trying to use C++ API in a ROS project, because it’s a CMake project we can directly use it in the ROS project through find_package(toppra).

After building, I tried to use it in the ROS package but CMake Could not find a package configuration file provided by “toppra” with any of the following names:

    toppraConfig.cmake
    toppra-config.cmake

Now, for that I have to append the config files path into the CMAKE_PREFIX_PATH. But when I look for the directory of config files I am unable to find it. If we looked at the following portion of CMakeLists.txt present in the cpp folder

set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake")
write_basic_package_version_file(
    "${VERSION_CONFIG}" VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion
)

configure_package_config_file(
    "cmake/Config.cmake.in"
    "${PROJECT_CONFIG}"
    INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}"
)

install(FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}"
    DESTINATION "${CONFIG_INSTALL_DIR}")
install(EXPORT toppra::toppra
  NAMESPACE toppra::
  FILE toppraTargets.cmake
  DESTINATION "${CONFIG_INSTALL_DIR}")

Config files directory is set to lib/cmake/toppra what I am deducing is that project cmake files are going to install under /lib/cmake right? or its in the build directory of the project because I only found the cmake-config files under the generated folder and cmake-Target file under Export directory but these should ideally be present in one directory toppra under the following path /lib/cmake. But I am not able to find any config files under this path, no files are installed there.

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jmirabelcommented, Dec 8, 2022

In sudo make install, sudo is generally a bad idea. What you should do instead is install it an custom install directory and make your environment variable points to it. This reason is good enough for me not to suggest people to use sudo when installing.

0reactions
RAJKgucommented, Dec 10, 2022

@jmirabel I agree with you @hungpham2511 and @jmirabel I have a question to ask, So I trying to develop a trajectory optimization model which can optimize a recorded set of waypoints. In the pipeline, I am thinking to use STOMP for the optimization of an initial recorded set of waypoints, but for now, I am trying parameterizing the recorded set of waypoints using toppra with velocity(3.14,-3.14) and acceleration(-1,1) bounds. So when I try to run toppra with the recorded points I am getting a parameterized path but viewing it in the plot shows that acceleration is going out of bounds. The parametrized used is “ParametrizeConstAccel”. Here is the plot

Screenshot from 2022-12-10 14-20-35

So, What am trying to ask is, Is this because of nonuniform recorded waypoints? because for parameterizing we need a smooth geometric path right? This means we can’t do parameterization of a raw sequence of waypoints while satisfying the constraints properly like the recorded ones. I am currently exploring new things So don’t have much in-depth experience and knowledge of it. But I love to have some guidance that gives me some in-depth insight.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmake-file-api(7) — CMake 3.25.1 Documentation
A JSON string specifying the toolchain language, like C or CXX. Language names are the same as language names that can be passed...
Read more >
Meta-configuration of C/C++ projects with CMake
CMake allows you to specify the build of a project, in files named CMakeLists.txt, with a simple syntax (much simpler than writing Makefiles)....
Read more >
CMake: How to Build and Package C/C++ Projects - YouTube
In this workshop we will learn about CMake, a build generation tool used to build cross platform C /C++ projects. If you are...
Read more >
Building a Python C extension module with CMake
It allows to easily handle configuration, automatically discover build settings for most of the common tools and libraries on different ...
Read more >
CMake Tutorial
.cmake files can be used as scripts, which runs cmake command to prepare environment pre-processing or split tasks which can be written outside...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found