Message-generation package not found
Hi all,
Since a few days I have had the following error mesage:
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by
"message_generation" with any of the following names:
message_generationConfig.cmake
message_generation-config.cmake
Add the installation prefix of "message_generation" to CMAKE_PREFIX_PATH or
set "message_generation_DIR" to a directory containing one of the above
files. If "message_generation" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
le_painters_companion/lc_control/CMakeLists.txt:22 (find_package)
-- Could not find the required component 'message_generation'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
"message_generation" with any of the following names:
message_generationConfig.cmake
message_generation-config.cmake
Add the installation prefix of "message_generation" to CMAKE_PREFIX_PATH or
set "message_generation_DIR" to a directory containing one of the above
files. If "message_generation" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
le_painters_companion/lc_control/CMakeLists.txt:22 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/arennuit/DevRoot/src/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/arennuit/DevRoot/src/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
I am sure the ros-indigo-message-generation
and ros-indigo-message-runtime
are installed.
Any idea of what is going on?
Kind regards,
Antoine.
Asked by arennuit on 2018-07-17 00:02:23 UTC
Answers
Hi, I get this problem, And fix it. Please attention this point WORD: CMAKE_PREFIX_PATH
now run:
sudo vi /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake
line 67:
set(paths " ")
foreach(path ${CMAKE_PREFIX_PATH})
if(IS_DIRECTORY ${path}/share/${component}/cmake)
list(APPEND paths ${path}/share/${component}/cmake)
endif()
endforeach()
Please add one line:
set(paths " ")
message("Fix The fucking bug: ${CMAKE_PREFIX_PATH}")
foreach(path ${CMAKE_PREFIX_PATH})
if(IS_DIRECTORY ${path}/share/${component}/cmake)
list(APPEND paths ${path}/share/${component}/cmake)
endif()
endforeach()
You will find the ${CMAKE_PREFIX_PATH} is empty or don't has the /opt/ros/kinetic
So, PLEASE ADD ONE LINE IN YOUR PROJECT CMakeLists.txt
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/opt/ros/kinetic")
Asked by Haoming on 2020-04-28 20:54:21 UTC
Comments
I don't often downvote an answer, but in this case I did.
For two reasons:
message("Fix The fucking bug: ${CMAKE_PREFIX_PATH}")
- you should not edit files in
/opt/ros
. If fixes are needed, propose them upstream. Do not edit files in system locations, as those will be overwritten the next time the package gets updated
Finally: it is very likely the problem described by the OP was also a configuration or setup issue on the side of the OP (ie: his machine or workflow). Notice also the comment posted by @arennuit:
The problem was totally unlinked to ROS, sorry.
Also: manually changing CMAKE_PREFIX_PATH
, especially in the file you are doing it, should not and is not needed.
Asked by gvdhoorn on 2020-04-29 02:43:25 UTC
Thank for your suggestion
I also agree your word, The system file shound not be edited. And I just for output the debug information.
I git checkout the /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake
you just need to add set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/opt/ros/kinetic")
in yourself project CMakeLists..txt
However, almost people just want to make their project work.
Before the offical solution of the problem, I think it work.
Asked by Haoming on 2020-04-29 05:27:18 UTC
Comments
Can you roscd into those packages? $
roscd message_generation
brings you to your ros install? Even if you are sure the packages are installed it might help if you reinstall them.Asked by Reamees on 2018-07-17 01:28:12 UTC
Can you find it with:
?
Asked by pavel92 on 2018-07-17 02:04:42 UTC
The problem was totally unlinked to ROS, sorry.
Asked by arennuit on 2018-07-23 01:52:59 UTC
Hey! I am stuck with the same error, can you elaborate on what you did to solve this? Thanks in advance!
Asked by H.Ruthrash on 2019-05-19 10:59:49 UTC
@arennuit: could you perhaps post an answer which describes what the actual cause was of your problem? Even if it doesn't contain the fix it would already be better than leaving it as a comment.
Asked by gvdhoorn on 2020-04-29 02:45:11 UTC