CMAKE 생성 비주얼 스튜디오 프로젝트에 디렉토리를 포함시키는 방법은 무엇입니까?

StackOverflow https://stackoverflow.com/questions/1447423

문제

나는 다음 cmakelists.txt를 (대략적으로) 가지고 있습니다

project(Test)

set(SOURCE
123.cpp
456.cpp )

find_package(Boost COMPONENTS
unit_test_framework REQUIRED)

include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

message("${Boost_INCLUDE_DIRS}")

add_executable(Tests ${SOURCE})

생성 된 메시지

message("${Boost_INCLUDE_DIRS}")

~이다

C:\boost_1_40_0

Visual Studio 2008 프로젝트 파일을 생성 할 때는 모두 괜찮습니다. 프로젝트 속성에 C/C ++ 섹션에 "추가 포함 디렉토리"에는 아무것도 없습니다. 내가 만들 때, 나는 얻는다

fatal error C1083: Cannot open include file: 'boost/test/unit_test.hpp': No such file or directory

그러나 파일은 c : boost_1_40_0에 따라 바로 거기에 있습니다. 할 일이 더 있습니까?

지금은 글로벌 C ++ 디렉토리를 부스트하고 있지만 그 이유가 있는지 궁금합니다.

고맙습니다!

도움이 되었습니까?

해결책

OK ... include_directories 및 link_directories는 add_executable 이후에 있어야합니다 ...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top