<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Include path in VS Code using West command</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67335/include-path-in-vs-code-using-west-command</link><description>Hello, 
 I am using VS Code 1.48.2 and building the C++ application code on nRF52840 dev board using &amp;quot;west&amp;quot; commands. 
 I have the following structure 
 project_directory/src/dummy.cpp 
 project_directory/src/dummy.hpp 
 project_directory/src/folder/temp</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Oct 2020 01:25:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67335/include-path-in-vs-code-using-west-command" /><item><title>RE: Include path in VS Code using West command</title><link>https://devzone.nordicsemi.com/thread/276047?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 01:25:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cf59d82-c5d2-4862-91a9-db0fa50f7d52</guid><dc:creator>RajLav</dc:creator><description>&lt;p&gt;&lt;span&gt;zephyr_library_include_directories(&lt;/span&gt;&lt;span&gt;src/&lt;strong&gt;folder/&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;) - Yes explicitly giving folder paths work. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I was under impression that only zephyr directories could be given to &amp;quot;zephyr_library_include_directories&amp;quot; and the rest of the directories were supposed to be added in target_sources.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your help.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Include path in VS Code using West command</title><link>https://devzone.nordicsemi.com/thread/276008?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 16:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6bb9ca3-6496-4e66-9489-a75f465fdac8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I&amp;#39;m still getting familiar with the build system to be honest, but I imagine you have to specify the sub-directory in your cmake list.&amp;nbsp; E.g., &lt;span&gt;zephyr_library_include_directories(&lt;/span&gt;&lt;span&gt;src/&lt;strong&gt;folder/&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;)&lt;strong&gt;.&lt;/strong&gt; Or&lt;strong&gt; h&lt;/strong&gt;ave you tried it already?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Include path in VS Code using West command</title><link>https://devzone.nordicsemi.com/thread/275754?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 06:39:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fe1945a-4590-4eee-a948-55408fa8f5f0</guid><dc:creator>RajLav</dc:creator><description>&lt;p&gt;Vidar,&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;Yes I have included that in my CMakelist.txt file. It is as follows:&lt;/p&gt;
&lt;p&gt;############################################################&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;cmake_minimum_required&lt;/span&gt;&lt;span&gt;(VERSION&amp;nbsp;3.8)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;find_package&lt;/span&gt;&lt;span&gt;(Zephyr&amp;nbsp;REQUIRED&amp;nbsp;HINTS&amp;nbsp;&lt;/span&gt;&lt;span&gt;$ENV{ZEPHYR_BASE}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;project&lt;/span&gt;&lt;span&gt;(NONE)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;target_sources&lt;/span&gt;&lt;span&gt;(app&amp;nbsp;PRIVATE&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;src/dummy.cpp&lt;/span&gt;&lt;br /&gt;&lt;span&gt;src/dummy.hpp&lt;/span&gt;&lt;br /&gt;&lt;span&gt;src/folder/temp.hpp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;zephyr_library_include_directories(&lt;/span&gt;&lt;span&gt;${CMAKE_CURRENT_SOURCE_DIR}&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;##############################################################&lt;/p&gt;
&lt;p&gt;But my question is not about whether I should include the header files explicitly in my CMakeList.txt or not.&lt;/p&gt;
&lt;p&gt;In file&amp;nbsp;&lt;span&gt;dummy.hpp,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#include &amp;quot;folder/temp.hpp&amp;quot;&amp;nbsp; &amp;nbsp;-&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I have to do something like this to include&amp;nbsp;&amp;quot;temp.hpp&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#include &amp;quot;temp.hpp&amp;quot; -&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;I want to do something like this. In order to do this, somewhere I need to mention the path &amp;quot;src/folder&amp;quot; so that my temp.hpp file gets detected and I don&amp;#39;t have to write &amp;quot;folder/temp.hpp&amp;quot; to include &amp;quot;temp.hpp&amp;quot; file.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Include path in VS Code using West command</title><link>https://devzone.nordicsemi.com/thread/275652?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 13:19:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b83d4ea7-c63e-42b6-bec4-afcdf60c65ba</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Have you tried adding &amp;#39;zephyr_include_directories(src)&amp;#39; to your CMakeLists.txt. Header files shouldn&amp;#39;t have to be added individually like source files. Also, I don&amp;#39;t think you should have to edit &amp;quot;c_cpp_properties.json&amp;quot; if you&amp;#39;ve installed the CMake plugin in VS.&lt;/p&gt;
&lt;p&gt;&amp;quot;Kconfig for the Zephyr Project&amp;quot; is another plug-in you may find useful if you do everything in VS code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>