[Reference Site]
CMakeList.txt
에 absolute path를 및 다음과 같은 경로를 추가
sudo find /usr/ -name “*boost*”
/usr/include/boost
” 여기에, library는 “usr/local/lib
” 여기에 있음을 확인build할 package의 경로를 CMakeList.txt에 다음과 같은 코드 삽입
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/usr/include/boost")
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "/usr/local/lib")
FIND_PACKAGE(Boost)
IF (Boost_FOUND)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
ADD_DEFINITIONS( "-DHAS_BOOST" )
ENDIF()
[Step 2] 추가로 build할 Boost package의 absolute path를 export
export BOOST_INCLUDE_DIR="/usr/local/include"
export BOOST_LIBRARYDIR="/usr/local/lib"
export BOOST_ROOT="/usr/include/boost"
catkin clean
후 catkin build
진행위의 방법을 적용하여도 같은 error가 발생하나 found version이 변경된 경우
**CMake Error at /usr/local/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: python) (found version "1.65.1")**
sudo find /usr/ -name “libboost_python*”
본 저자의 경우 다음과 같이 버전이 나타남 (해당 버전은 python3임)
/usr/local/lib/libboost_python3.so
/usr/local/lib/libboost_python3.so.1.65.1
/usr/local/lib/libboost_python3.a
Before
if(NOT ANDROID)
find_package(PythonLibs)
if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
find_package(Boost REQUIRED python)
else()
find_package(Boost REQUIRED python3)
endif()
After (Boost REQUIRED 뒤에 같은 버전으로 모두 변경)
if(NOT ANDROID)
find_package(PythonLibs)
if(PYTHONLIBS_VERSION_STRING VERSION_LESS **"3"**)
find_package(Boost REQUIRED **python3**)
else()
find_package(Boost REQUIRED **python3**)
endif()
python3 → python3.8
로 작성하면 끝!catkin clean
후 catkin build
진행