VWR-24247: develop.py configure still searches for the wrong header file when checking for Tut
Review Request #39 - Created Dec. 18, 2010 and submitted
Aleric Inglewood | Reviewers | ||
viewer | |||
VWR-24247 | |||
None | viewer-development |
There is no #include "tut.h" anywhere. The only includes are #include "tut/tut.hpp" (which is correct). Tut installs in <prefix>/include/tut/* among which the headerfile tut.hpp. The changed file, indra/cmake/FindTut.cmake, is only included when configured with --standalone (and thus only on linux). find_path searches in /usr/include and /usr/local/include anyway, so there is no way to add that. Adding the NO_SYSTEM_ENVIRONMENT_PATH stops it from reading the PATH environment variable and looking for tut/tut.hpp, which probably won't harm, but it simply makes no sense: we're looking for a headerfile, not an executable. Without this patch (and without creating a fake /usr/local/include/tut.h), I get the error: CMake Error at cmake/FindTut.cmake:26 (message): Could not find Tut Call Stack (most recent call first): cmake/Tut.cmake:8 (include) llmessage/CMakeLists.txt:13 (include) With the patch, it finds /usr/local/include/tut/tut.hpp as expected, setting TUT_INCLUDE_DIR to "/usr/local/include", and it also finds (in my case) /usr/src/secondlife/viewers/snowstorm/viewer-development/include/tut/tut.hpp, setting TUT_INCLUDE_DIR to "/usr/src/secondlife/viewers/snowstorm/viewer-development/include", since I have a symbolic link from /usr/src/secondlife/viewers/snowstorm/viewer-development/include/tut to ../linden/libraries/include/tut (which was installed manually with ./scripts/install.py tut) and I have the environment variable CMAKE_INCLUDE_PATH set to "/usr/src/secondlife/llqtwebkit/install-imprudence/include:/usr/src/secondlife/viewers/snowstorm/viewer-development/include:/sl/usr/include". In other words, this allows developers to install headers whereever they want and use the API of cmake as it is intended, to find those headers.
Tested to see if it finds the header when installed in /usr/local/include as well in a path specified with CMAKE_INCLUDE_PATH. Note that you need to configure with --standalone in order to test this. Also note that unless tut is installed in /usr/local, and when you configure with -DLL_TESTS:BOOL=ON, it still won't compile because of another bug. I will submit a patch for that separately.
Posted (Dec. 19, 2010, 4:03 a.m.)
-
indra/cmake/FindTut.cmake (Diff revision 1) -
According to the CMake 2.8.1 man page, NO_SYSTEM_ENVIRONMENT_PATH makes find_path not only skip $PATH but also $INCLUDE. I think we should respect the latter when looking for headers.
Other reviews