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

CMake error of SET(KDL_CFLAGS "${KDL_CFLAGS} -I${EIGEN3_INCLUDE_DIR}") #439

Closed
felixf4xu opened this issue May 19, 2023 · 2 comments · Fixed by #440
Closed

CMake error of SET(KDL_CFLAGS "${KDL_CFLAGS} -I${EIGEN3_INCLUDE_DIR}") #439

felixf4xu opened this issue May 19, 2023 · 2 comments · Fixed by #440

Comments

@felixf4xu
Copy link

Hi,

I found a potential bug of the cmake file https://github.com/orocos/orocos_kinematics_dynamics/blob/master/orocos_kdl/CMakeLists.txt#L57

SET(KDL_CFLAGS "${KDL_CFLAGS} -I${EIGEN3_INCLUDE_DIR}")

in cmake, SET() will treat white spaces as separator like ;, in my case , ${EIGEN3_INCLUDE_DIR} is C:/Program Files/Eigen3/include/eigen3 which has white space inside.

As a result, when KDL_CFLAGS is used later at COMPILE_FLAGS "${CMAKE_CXX_FLAGS_ADD} ${KDL_CFLAGS}", the result of generated VS project file is like:

      <AdditionalIncludeDirectories>C:\Program Files\Eigen3\include\eigen3;E:\github\orocos_kinematics_dynamics\orocos_kdl\build\src;C:\Program;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <AdditionalOptions>%(AdditionalOptions) Files/Eigen3/include/eigen3</AdditionalOptions>

You can see the path is divided into 2 elements.

As a workaround, I changed the code to

SET(KDL_CFLAGS "${KDL_CFLAGS} -I\"${EIGEN3_INCLUDE_DIR}\"")

and it's fixed.

@MatthijsBurgh
Copy link
Collaborator

Thanks for reporting this bug.

Can we use single quotes instead of \"?

@felixf4xu
Copy link
Author

I tested, ' or " does not work.

MatthijsBurgh added a commit that referenced this issue May 22, 2023
MatthijsBurgh added a commit that referenced this issue Sep 6, 2023
jhonasiv added a commit to rock-core/rock-package_set that referenced this issue Sep 6, 2023
After orocos/orocos_kinematics_dynamics#439,
the orocks_kdl_eigen_v3 patch breaks the control/kdl build. It also
doesnt seem to be needed, so this PR just removes it.
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

Successfully merging a pull request may close this issue.

2 participants