2012-11-04 7 views
0

Windows 7 64 비트. CMake 2.8.10.CMake가 부스트를 찾지 못함

단계 :

  • 다운로드 부스트 : http://sourceforge.net/projects/boost/files/boost/1.51.0/
  • C에 넣어 : \ 작업 \ lib 디렉토리 \ boost_1_51_0-MT
  • 열기 "시작 -> 모든 프로그램 -> 마이크로 소프트 비주얼 스튜디오 2010 -> 비주얼 스튜디오 도구 -> 비주얼 스튜디오 명령 프롬프트 (2010) "
  • 명령을  
,
 
cd C:\work\lib\boost_1_51_0-MT 
bootstrap.bat 
bjam --toolset=msvc-10.0 --variant=release --build-type=complete -j 4 --with-regex --with-test --with-filesystem --with-date_time --with-random --with-system --with-thread --with-program_options --with-chrono --with-math stage link=static threading=multi runtime-link=static 
  • 명령을  
 
set BOOST_ROOT=C:\work\lib\boost_1_51_0-MT 
cmake M:\project 

    Unable to find the requested Boost libraries. 

    Boost version: 1.51.0 

    Boost include path: C:/work/lib/boost_1_51_0-MT 

    The following Boost libraries could not be found: 

      boost_system 
      boost_thread 
      boost_random 
      boost_chrono 

    No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the 
    directory containing Boost libraries or BOOST_ROOT to the location of 
    Boost. 

M : CMakeLists.txt 포함 \ \ 프로젝트 :

 
... 
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) 
set(USE_STATIC_BOOST ON) 
add_definitions(-DBOOST_THREAD_USE_LIB) 
add_definitions(-DBOOST_ALL_NO_LIB) 

find_package(Boost 1.48.0 COMPONENTS system thread random chrono REQUIRED) 
... 

이 CMakeLists.txt이 오래 (내가 정적으로 밀어 연결해야합니다) 다른 부스트 설치에서 작동합니다 (나에게만 가능하지만 과거에는 없었지만 리시버는 손실 됨).

지금 CMake 도서관을 향상 발견 ...

 
set(Boost_USE_STATIC_LIBS ON) 

를 해결! 내 "설정 (USE_STATIC_BOOST ON)은"비록 지금 CMake 도서관을 향상 발견 ...

+4

그것은 것 :

if(WIN32) # Needed for boost to turn off autolinking for dynamic linking add_definitions(-DBOOST_ALL_NO_LIB) endif() 

가에 대한 자세한 내용보기 : 내 CMakeLists.txt이 set(USE_STATIC_BOOST ON)이 있지만

당신이 추가 할 필요가 set(Boost_USE_STATIC_LIBS OFF)를 사용하려면 ... 같은 효과를 가지고 있지만, 그것은 나던해야하는 아마도 "해결 된"부분을 대답으로 게시하고 동의하는 것이 좋습니다. – jogojapan

답변

관련 문제