<?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>Compilation dependencies on which board type (in CMakeList.txt and/or prj.conf)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104065/compilation-dependencies-on-which-board-type-in-cmakelist-txt-and-or-prj-conf</link><description>I have a project that has two different types of custom boards. I have created board support packages for each. Is there a way to include different kconfigs in the CMakeLists.txt ? For instance I have the following in my CMakeLists.txt file: 
 If the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 Oct 2023 15:00:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104065/compilation-dependencies-on-which-board-type-in-cmakelist-txt-and-or-prj-conf" /><item><title>RE: Compilation dependencies on which board type (in CMakeList.txt and/or prj.conf)</title><link>https://devzone.nordicsemi.com/thread/450357?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2023 15:00:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec1ddb11-ec05-4655-99af-00a6f4a1a664</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;You can do it in your CMakeLists.txt. Make an mcubootA.conf and mcubootB.conf, and add them in the if-blocks you made, using:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;add_overlay_config(
    mcuboot
    ${CMAKE_CURRENT_SOURCE_DIR}/mcubootA.conf
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Not 100% sure if this will work properly with the child_image/mcuboot.conf. You may need to remove it and add its contents to both files.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compilation dependencies on which board type (in CMakeList.txt and/or prj.conf)</title><link>https://devzone.nordicsemi.com/thread/449219?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2023 15:29:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:240561e0-95ad-4f73-a8d5-3d57467557ae</guid><dc:creator>eb12345</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t recognize it from there, as it needs to be in the mcuboot child_image directory. Anyway to do if-elseif statements from within the mcuboot.conf ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compilation dependencies on which board type (in CMakeList.txt and/or prj.conf)</title><link>https://devzone.nordicsemi.com/thread/449199?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2023 14:03:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d8963c7-f4fd-4581-a5b1-6e9e1b67fd49</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Add conf files with the name of each board. In a boards folder, or directly in the project folder.&lt;/p&gt;
&lt;p&gt;my_project/board_a.conf&lt;br /&gt;or&lt;br /&gt;my_project/boards/board_a.conf&lt;/p&gt;
&lt;p&gt;Then put the board specific configs in that conf file. It will be automatically included alongside the configs in prj.conf. If a config appears in both prj.conf and board_a.conf, the value in board_a.conf will be used in the build.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compilation dependencies on which board type (in CMakeList.txt and/or prj.conf)</title><link>https://devzone.nordicsemi.com/thread/449093?ContentTypeID=1</link><pubDate>Thu, 05 Oct 2023 21:12:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16b3c3b6-861c-4746-b26f-bf7730ebad88</guid><dc:creator>eb12345</dc:creator><description>&lt;p&gt;Yes. Thank you. One follow up question: Can the same thing be done from a *.conf file, or is the syntax different? Let&amp;#39;s say I want to set up a boot signature key depending on the board type in the child_image\mcuboot.conf&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;signingKey-BoardA.pem&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOOT_SIGNATURE_KEY_FILE=&amp;quot;signingKey-BoardB.pem&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compilation dependencies on which board type (in CMakeList.txt and/or prj.conf)</title><link>https://devzone.nordicsemi.com/thread/447516?ContentTypeID=1</link><pubDate>Mon, 25 Sep 2023 13:34:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d95e9d52-e4bc-4df0-8907-79a71d0e4c6f</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In our board files we have a Kconfig.board file, which contains something like:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;config BOARD_NRF52833DK_NRF52833
	bool &amp;quot;NRF52833 DK NRF52833&amp;quot;
	depends on SOC_NRF52833_QIAA
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There is also a &amp;lt;board&amp;gt;_defconfig file, in this case nrf52833dk_nrf52833_defconfig, which among other configs contains:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52833_QIAA=y
CONFIG_BOARD_NRF52833DK_NRF52833=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If your custom boards are set up in this way also, you can use if(), elseif() and endif() to only include the desired line:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (CONFIG_BOARD_A)
    list(APPEND EXTRA_CONF_FILE &amp;quot;boardA.conf&amp;quot;)
elseif(CONFIG_BOARD_B)
    list(APPEND EXTRA_CONF_FILE &amp;quot;boardB.conf&amp;quot;)
endif()&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>