From: Mart K. <ma...@ke...> - 2008-11-24 08:17:03
|
Hi Jean-Philippe (and others), Op Sunday 23 November 2008 22:34:30 schreef Annick et Jean-Philippe: > Hi, Mart, and all. > > Sorry to bother you with that, but I think it's important, > and I finally found a solution, despite strange things. > > My configuration : Linux x86_64, GCC 4.2.2, CMake 2.6.2 > > My problem : > > I've got standard OpenAL lib installed in /usr (lib64 and include) > and Torcs-NG crashes when using it at run-time. > > So I decided to try a newer version from the Open AL web site, > and built and installed it in /usr/local : I don't want to remove > the standard one as some other softwares may need it and be incompatible > with newer ones ... > > Then, in sdl-port working copy, removed CMakeCache.txt and CMakeFiles dir, > and run "cmake .". And when I run "ccmake ." to check for detected libs > and associated pathes, I realize that OpenAL is still detected in /usr > (lib64 and include), while it should be in /usr/local (as stated in > FindOpenAL.cmake in cmake installation : > /usr/local/share/cmake-2.6.2/Modules : /usr/local is before /usr in the > search path). > > Then I spent the whole afternoon : > - lots of different hacks, > - cmake variables settings (like CMAKE_INCLUDE_PATH, CMAKE_LIBRARY_PATH) > - google searches > - changing my PATH env variable to get /usr/local/bin before /usr/bin > - check that my LIB env variable is empty > - rebuild cmake in case he would need to see /usr/local at build time, > - ... but no way to get it to work. > > A (bad) solution was to copy FindOpenAL.cmake > in our cmake directory (next to FindPLib.cmake) and make the following > modifications : add NO_DEFAULT_PATH at the end of the FIND_PATH and > FIND_LIBRARY instructions. This time, ccmake shows /usr/local for OpenAL > include and libs. > > Of course, this was NOT a solution, but it indicated to me that there were > something strange with cmake default lib and include pathes ... > > And displaying CMAKE_SYSTEM_PREFIX_PATH in one .cmake, I found : > /;/usr;/usr/local;/usr/local;/usr/local/dev !!!!!!!!!!!! > > /usr BEFORE /usr/local !!!!!!!!! > > I find this VERY strange, and would have assumed a reverse path order ... > > Do you have this strange thing home ? /usr is before /usr/local here too. > The solution: > > cmake .... -DCMAKE_PREFIX_PATH:STRING=/usr/local . > > and all works fine. The way CMake should work in your case is as follows: 1. Run ccmake . (no need to run cmake . first) 2. Press "c" such that CMake start configuring 3. It finish, but you can see in your screen that it found the wrong OpenAL. So you change the path manually to the right one (for both include and lib) and press "c" again to reconfigure. 4. Now everything seems right, so you can press "g" and CMake ends. 5. Now you can run "make" just as normal. The discussion about where to look first belongs at the CMake mailing list, in my opinion. It also happends that programs in /usr/local are very old and not updated for a long time. Whatever the order of the paths, it can happen that it finds the wrong one (depending wether /usr or /usr/local is the right one). > Hope this helps. > > Cheers, > > Jean-Philippe. > > PS: Just committed improved FindPLib.cmake and FindALUT.cmake for lib64 > support. Somewhat changed FindPLib.cmake (replaced PLIB_DIR cmake variable > by PLIB_DIR env variable, to be consistent with OpenAL detection > techniques. > > Please tell me what you think, and if I broke something on Windows ... Regards, Mart |