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!
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.

edit retag close merge delete

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. ( 2018-07-17 01:28:12 -0600 )edit Can you find it with: rospack find message_generation  ? ( 2018-07-17 02:04:42 -0600 )edit The problem was totally unlinked to ROS, sorry. ( 2018-07-23 01:52:59 -0600 )edit Hey! I am stuck with the same error, can you elaborate on what you did to solve this? Thanks in advance! ( 2019-05-19 10:59:49 -0600 )edit @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. ( 2020-04-29 02:45:11 -0600 )edit ## 1 Answer Sort by » oldest newest most voted 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()


 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")

more

I don't often downvote an answer, but in this case I did.

For two reasons:

1. message("Fix The fucking bug: ${CMAKE_PREFIX_PATH}") 2. 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. ( 2020-04-29 02:43:25 -0600 )edit 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.

( 2020-04-29 05:27:18 -0600 )edit