Lines Matching +full:if +full:- +full:no +full:- +full:files +full:- +full:found

6 The Zephyr `CMake package`_ is a convenient way to create a Zephyr-based application.
9 The :ref:`zephyr-app-types` section introduces the application types
13 the application, whether it is a :ref:`Zephyr repository application <zephyr-repo-app>`,
14 a :ref:`Zephyr workspace application <zephyr-workspace-app>`, or a
15 :ref:`Zephyr freestanding application <zephyr-freestanding-app>`.
17 When developing a Zephyr-based application, then a developer simply needs to write
27 .. group-tab:: Ubuntu
29 In Linux, the CMake user package registry is found in:
33 .. group-tab:: macOS
35 In macOS, the CMake user package registry is found in:
39 .. group-tab:: Windows
41 In Windows, the CMake user package registry is found in:
56 to export Zephyr using ``west zephyr-export``.
65 .. code-block:: bash
67 cmake -P <PATH-TO-ZEPHYR>/share/zephyr-package/cmake/zephyr_export.cmake
73 .. code-block:: bash
75 cmake -P <PATH-TO-ZEPHYR>/share/zephyrunittest-package/cmake/zephyr_export.cmake
87 .. code-block:: cmake
105 .. code-block:: none
107 <projects>/zephyr-workspace/zephyr
111 in this example, ``hello_world`` will use ``<projects>/zephyr-workspace/zephyr``.
117 .. code-block:: none
119 <projects>/zephyr-workspace
125 in this example, ``my_first_app`` will use ``<projects>/zephyr-workspace/zephyr`` as this Zephyr
129 The root of a Zephyr workspace is identical to ``west topdir`` if the workspace was
135 .. code-block:: none
137 <projects>/zephyr-workspace-1
140 <projects>/zephyr-workspace-2
149 in this example, only ``<projects>/zephyr-workspace-2/zephyr`` is exported to the CMake package
153 If user wants to test the application with ``<projects>/zephyr-workspace-1/zephyr``, this can be
155 ``ZEPHYR_BASE=<projects>/zephyr-workspace-1/zephyr``, before
179 .. code-block:: cmake
193 .. code-block:: none
195 <projects>/zephyr-workspace-2.a
198 <projects>/zephyr-workspace-2.b
213 .. code-block:: cmake
221 CMake also supports the keyword ``EXACT``, to ensure an exact version is used, if that is required.
224 .. code-block:: cmake
229 In case no Zephyr is found which satisfies the version required, as example, the application specif…
231 .. code-block:: cmake
238 .. code-block:: none
243 The following configuration files were considered but not accepted:
245 …<projects>/zephyr-workspace-2.a/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake, version: 2.a…
246 …<projects>/zephyr-workspace-2.b/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake, version: 2.b…
251 application will only build if the Zephyr repository or workspace is matching.
266 .. code-block:: none
268 <projects>/zephyr-workspace
270 ├── zephyr-vendor
271 ├── zephyr-custom
283 * ``zephyr-custom``
284 * ``zephyr-vendor``
286 This means that ``my_first_app`` will use ``<projects>/zephyr-workspace/zephyr``.
292 .. code-block:: cmake
294 set(ZEPHYR_PREFER "zephyr-custom" "zephyr-vendor")
301 If a Zephyr is specified in the list, but not found in the system, it is simply ignored and
306 Zephyr. When testing is done, the ``zephyr-test`` folder can simply be removed.
309 .. code-block:: cmake
311 set(ZEPHYR_PREFER "zephyr-test")
327 They are similar to the per-user :file:`.zephyrrc` file that can be used to set :ref:`env_vars`,
335 application-specific package could override the workspace settings, if needed.
342 in the appropriate location. The CMake ``find_package`` mechanism will search for these files with
343 the steps below. Other default CMake package search paths and hints are disabled and there is no
347 1. If ``ZephyrBuildConfiguration_ROOT``, or ``ZephyrAppConfiguration_ROOT`` respectively, is set,
348 search within this prefix path. If a matching file is found, execute this file. If no matching
349 file is found, go to step 2.
350 2. Search within ``${ZEPHYR_BASE}/../*``, or ``${APPLICATION_SOURCE_DIR}`` respectively. If a
351 matching file is found, execute this file. If no matching file is found, abort the search.
353 It is recommended to place the files in the default paths from step 2, but with the
358 variable or from a CMake cache initialization file with the ``-C`` command line option.
365 If you want to completely disable the search for these packages, you can use the special CMake
372 .. code-block:: none
374 <projects>/zephyr-workspace
381 └── share/zephyrapp-package/cmake/ZephyrAppConfig.cmake
385 .. code-block:: cmake
398 # Default to GNU Arm Embedded toolchain if no toolchain is set
399 if(NOT ENV{ZEPHYR_TOOLCHAIN_VARIANT})
401 find_program(GNU_ARM_GCC arm-none-eabi-gcc)
402 if(NOT ${GNU_ARM_GCC} STREQUAL GNU_ARM_GCC-NOTFOUND)
412 :zephyr_file:`share/zephyr-package/cmake` and
413 :zephyr_file:`share/zephyrunittest-package/cmake` contains the CMake config
418 The following is an overview of the files in these directories:
422 if this installation fulfils the requirements specified by user when calling
447 .. _CMake package: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html
448 …ge registry: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#user-package-registry
449 .. _CMake package version: https://cmake.org/cmake/help/latest/command/find_package.html#version-se…
450 …ge search procedure: https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure