cmake: Using find_package(Boost) when FindBoost.cmake is not in the default location
Hello all,
I am attempting to compile some code on a cluster where I do not have root access (and is missing many of the libraries I want), and hence have had to create local builds of the boost and opencv libraries (i.e. in /home/username/usr/local). In particular, my cmake depends on: Code:
find_package(boost) Code:
/usr/share/cmake-2.6/Modules/FindBoost.cmake Code:
/home/username/cmake_modules I've modified the FindBoost.cmake file to make it search in the locally installed boost libraries. -- Damien EDIT: Now I'm really scratching my head. According to http://www.itk.org/Wiki/CMake:How_To_Find_Libraries if I place the following line in my CMakeLists.txt file, it should find any modules in that path: Code:
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") Code:
set(CMAKE_MODULE_PATH "/home/username/find_cmake") The cmake version is 2.8.0 |
'cmake' is looking for <Search-PATH>/lib/libboost****.so
There are 42 different libs ... You will have to compile e.g. boost_1.38 to your "local location", and export the PATH, so the cmake "configuring opencv" can find libraries in <prefix>/lib and headers in <prefix>/include/boost/ The text file FindBoost.cmake is just one of the 130 files used by cmake to find libraries : (( /usr/share/cmake/Modules/CMakeFind****.cmake .)) ..... And I guess that a cmake installed to /home/<user>/ also will be able to find its own files in e.g. /home/<user>/share/cmake/Modules/ if it is a real install and not just a copy of the files. ? Or did you find the solution ? ..... |
Quote:
When I perform the following, I get: Code:
username@lyra:~/code> cmake . I solved it by directly specifying the include and lib directories, rather than the FindBoost.cmake in CMakeLists.txt, Dirty, yes, but it works for this run. -- Damien |
I have a similar situation. How did you directly specify the include and lib directories, rather than using find_package in CMakeLists.txt?
|
All times are GMT -5. The time now is 10:42 PM. |