<?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>Building nRF5340 project with multiple external dependencies that depend on each other</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102843/building-nrf5340-project-with-multiple-external-dependencies-that-depend-on-each-other</link><description>Hi, I am running into a cmake build error when i try to include external projects. Here&amp;#39;s what i have done and what are the issues i am running into, 1) i studied the sdk-zephyr/external_library example 2) After looking at that example i created a custom</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Aug 2023 08:28:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102843/building-nrf5340-project-with-multiple-external-dependencies-that-depend-on-each-other" /><item><title>RE: Building nRF5340 project with multiple external dependencies that depend on each other</title><link>https://devzone.nordicsemi.com/thread/441784?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 08:28:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a12ffd8-cc6c-4d9c-9215-d079dce29773</guid><dc:creator>Einarh</dc:creator><description>[quote user="Omegaki113r"]But is there a way that instead of makefile on the external project to use CMake on there as well?[/quote]
&lt;p&gt;I think that should be possible, maybe you could look to the Asset Tracker application for inspiration:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/main/applications/asset_tracker_v2"&gt;https://github.com/nrfconnect/sdk-nrf/tree/main/applications/asset_tracker_v2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There multiple &lt;code&gt;CMakeLists.txt&lt;/code&gt; files are chained to include modules, using &lt;code&gt;add_subdirectory()&lt;/code&gt; and &lt;code&gt;target_include_directories()&lt;/code&gt;.&lt;/p&gt;
[quote user="Omegaki113r"]there is a linking error. that the ADSController library cant find the C functions from the SPIController.c[/quote]
&lt;p&gt;This might also be fixed with the above approach I think, adding all source files to your main project&amp;#39;s target sources.&lt;/p&gt;
&lt;p&gt;-Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building nRF5340 project with multiple external dependencies that depend on each other</title><link>https://devzone.nordicsemi.com/thread/441706?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2023 18:07:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:591604f6-2a85-4f3c-bba9-03879c87e630</guid><dc:creator>Omegaki113r</dc:creator><description>&lt;p&gt;Yes. this Stackoverflow thread helped to make the code compile. Compilation is happening successfully now. But there is a linking error. that the ADSController library cant find the C functions from the SPIController.c &lt;br /&gt;&lt;br /&gt;but let me look into that more before i get back to you. most likely a typo in my end.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building nRF5340 project with multiple external dependencies that depend on each other</title><link>https://devzone.nordicsemi.com/thread/441705?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2023 18:06:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39010fa9-db8b-4866-af33-bbfc1787a508</guid><dc:creator>Omegaki113r</dc:creator><description>&lt;p&gt;Quick question before that. &lt;br /&gt;&lt;br /&gt;So the projects created by the VSCode for Zephyr is based on CMake. But the external project example (external project itself) is using makefile. I know this is written like that to show that the Zephyr can build project that get build from other build systems as well. &lt;br /&gt;&lt;br /&gt;But is there a way that instead of makefile on the external project to use CMake on there as well? &lt;br /&gt;&lt;br /&gt;Do we have guidance to do that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building nRF5340 project with multiple external dependencies that depend on each other</title><link>https://devzone.nordicsemi.com/thread/441592?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2023 11:50:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1eecd0f4-1105-4e80-b5a8-c65d978cc308</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;I think that just makes them compile in the right order, which is good, but you&amp;#39;ll have to make sure the SPI project header file is visible to your ADS project.&lt;/p&gt;
&lt;p&gt;Which would be done by including the SPI project in your ADS project&amp;#39;s makefile I believe, have a look here, I believe this case is pretty similar to yours:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/15045748/how-to-use-external-libraries-and-headers-in-c-makefile"&gt;https://stackoverflow.com/questions/15045748/how-to-use-external-libraries-and-headers-in-c-makefile&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;-Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building nRF5340 project with multiple external dependencies that depend on each other</title><link>https://devzone.nordicsemi.com/thread/441396?ContentTypeID=1</link><pubDate>Tue, 15 Aug 2023 13:09:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b945c936-e2a0-474e-aed5-3c247a951e83</guid><dc:creator>Omegaki113r</dc:creator><description>&lt;p&gt;yeah. &lt;br /&gt;i haven&amp;#39;t done something like that. &lt;br /&gt;&lt;br /&gt;i thought putting this on the main project&amp;#39;s CMakeLists.txt took care of that &lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1692104908987v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So it seems like that doesn&amp;#39;t take care of it. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;can you explain how/what i need to put on the &amp;quot;&lt;span&gt;OmegaADS129xController&lt;/span&gt;&amp;quot; makefile to make the code compile.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Building nRF5340 project with multiple external dependencies that depend on each other</title><link>https://devzone.nordicsemi.com/thread/441324?ContentTypeID=1</link><pubDate>Tue, 15 Aug 2023 09:17:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb2694b0-78d5-4d54-a195-553ca1e35e5f</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I would suspect that you&amp;#39;ll have to include the SPI controller project in the makefile of your&amp;nbsp;&lt;span&gt;OmegaADS129xController project, since your ADS project needs to find the OmegaSPIController.h file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As far as I can see you haven&amp;#39;t done this, or am I missing something?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Einar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>