On 06/22/2016 08:08 PM, Miroslav Drahos wrote: > I believe I found a bug in FindProtobuf.cmake. Using set with two > parameters will insert an unwanted semicolon, the list separator. > The changes I made are like this (several occurrences): > > - set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR}) > + set(_protobuf_include_path "-I${CMAKE_CURRENT_SOURCE_DIR}")
The ";" in the value of the _protobuf_include_path are just normal list separators which will be used to divide the list when the variable is later referenced as ${_protobuf_include_path} in add_custom_command calls. The difference that this patch makes is `-I foo` v. `-Ifoo` on the resulting command lines. > I also added a test for FindProtobuf.cmake, which is a new addition. > The complete patch is attached. What I cannot figure out is how to > run the test? When I configure cmake build, I don’t see an option > to set the path to protobuf. Thanks for writing a test! The `CMake_TEST_Find...` options are all undocumented options that have to be added explicitly to the cache when configuring (e.g. -DCMake_TEST_FindProtobuf=1). The problem is that we don't know what packages are installed on a system such that running a find module test for them will work. Therefore we just keep them off by default and enable the tests on nightly testing machines where they are expected to work. I'd like to find a better solution but this is at least better than when we had no tests for individual find modules at all. Currently the patch makes the test get added as part of the build of CMake itself. Please see the other Tests/Find* directories for how the tests should be laid out. Thanks, -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers