MantisBT - CMake
View Issue Details
0014515CMakeCMakepublic2013-10-28 05:202014-03-05 09:58
icando 
 
normalfeaturealways
closedsuspended 
LinuxLinux
CMake 2.8.12 
 
0014515: Add variable PROTOBUF_ROOT to FindProtobuf.cmake
FindProtobuf.cmake doesn't allow specifying non-standard install location for protobuf. It would be nice to add a variable PROTOBUF_ROOT that tells FindProtobuf.cmake to look into the directory.

My current workaround is to use CMAKE_FIND_ROOT_PATH. I need to first backup CMAKE_FIND_ROOT_PATH, set it to PROTOBUF_ROOT (I passed it in throught -DPROTOBUF_ROOT=xxxx), call find_package, then restore it. This is ugly and it would be cleaner to let FindProtobuf.cmake handle the variable (by adding it to HINTS when using find_library).

Thanks.
No tags attached.
Issue History
2013-10-28 05:20icandoNew Issue
2013-10-28 08:13Brad KingAssigned To => Philip Lowman
2013-10-28 08:13Brad KingStatusnew => assigned
2013-10-28 08:15Brad KingNote Added: 0034269
2013-10-28 12:52icandoNote Added: 0034273
2013-10-28 13:26Brad KingNote Added: 0034274
2013-10-28 13:26Brad KingAssigned ToPhilip Lowman =>
2013-10-28 13:26Brad KingStatusassigned => resolved
2013-10-28 13:26Brad KingResolutionopen => suspended
2014-03-05 09:58Robert MaynardNote Added: 0035300
2014-03-05 09:58Robert MaynardStatusresolved => closed

Notes
(0034269)
Brad King   
2013-10-28 08:15   
FYI, there are plenty of general-purpose ways to add additional places for all find operations to look. See the enumerated list in commands like find_library:

 http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:find_library [^]

You can put the protobuf install prefix in CMAKE_PREFIX_PATH for example.
(0034273)
icando   
2013-10-28 12:52   
Thanks for your information. I found FindBoost support BOOST_ROOT, so I thought xxx_ROOT is some common practice for FindXXX modules. But just now I searched in the CMake doc and I realized it is not - only a few supports it - so I guess I'll stick to the less clean approach. It is not quite feasible to fix them for every FindXXX.cmake, even this one is resolved.
(0034274)
Brad King   
2013-10-28 13:26   
Okay. BOOST_ROOT exists because that name as an environment variable is a Boost convention that exists in upstream Boost. It is not in general something that should be followed by CMake Find modules.
(0035300)
Robert Maynard   
2014-03-05 09:58   
Closing resolved issues that have not been updated in more than 4 months