Hi All,

We are trying to clean up our Visual Studio flow with CMake. However, we
are running into an issue with Intellisense not finding header files
properly if we use target_include_directories(). For instance, given the
simple example below, if we add the "global" include_directories() call
Intellisense will work, but if we use target_include_directories()
approach, Intellisense does not work.

# Works if we use this ...
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

add_library(foo ...)

# Does not work using this ...
target_include_directories(foo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)

The build is fine, just Intellisense doesn't work. We noticed in the Visual
Studio project file generated for the component the include directories
show up as an AdditionalIncludeDirectories in a few sections like <Midl/>
and <CudaCompile> but not under <ClCommand>, for instance. I'm not sure
where they should show up to affect Intellisense.

In short, before we try a bunch of other stuff, I'd like to know in general
what the status of integration with Intellisense should be so we know what
to expect. Note, we are compiling a project with CUDA source, not sure if
that makes a difference, but we are seeing the behavior even for non-CUDA
targets.

Thanks!
Dustyn
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to