### Project Configuration and Compiler Setup Source: https://github.com/xmos/host_xvf_control/blob/develop/CMakeLists.txt Sets the minimum CMake version, defines build options for testing and compiler selection, and configures C++ standards. ```cmake cmake_minimum_required(VERSION 3.13) option(TESTING "If set, cmake will build tests" OFF) # Turn the option ON to use clang, you may need to change the path to your clang compiler option(USE_CLANG "If set, cmake will use clang insted of gcc" OFF) if(USE_CLANG) set(CMAKE_CXX_COMPILER "/usr/bin/clang++" CACHE STRING "C++ compiler" FORCE) set(CMAKE_C_COMPILER "/usr/bin/clang" CACHE STRING "C compiler" FORCE) endif() if(WIN32) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) include(GenerateExportHeader) endif() enable_language(CXX C) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED On) set(CMAKE_CXX_EXTENSIONS Off) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Only Release mode is allowed" FORCE) project(host_xvf_control) ``` -------------------------------- ### Display help information Source: https://github.com/xmos/host_xvf_control/blob/develop/README.rst Run the application with the help flag to view available use cases and options. ```console ./xvf_host --help ``` ```console xvf_host.exe --help ``` -------------------------------- ### Configure Dummy Libraries Source: https://github.com/xmos/host_xvf_control/blob/develop/test/CMakeLists.txt Defines shared libraries for command mapping and device simulation with necessary include paths and link options. ```cmake add_library(command_map_dummy SHARED command_map_dummy.cpp) target_link_options(command_map_dummy PRIVATE -fPIC) target_include_directories(command_map_dummy PUBLIC ${DEVICE_CONTROL_PATH}/api) add_library(device_dummy SHARED) target_sources(device_dummy PRIVATE device_dummy.cpp ) target_link_options(device_dummy PRIVATE -fPIC) target_include_directories(device_dummy PUBLIC ${CMAKE_SOURCE_DIR}/src/device ${DEVICE_CONTROL_PATH}/api ) if(WIN32) generate_export_header(command_map_dummy) generate_export_header(device_dummy) endif() ``` -------------------------------- ### Build the application Source: https://github.com/xmos/host_xvf_control/blob/develop/README.rst Commands to build the project using CMake on different operating systems. ```console cmake -B build && cd build && make ``` ```console # building with VS tools cmake -G Ninja -B build && cd build && ninja ``` -------------------------------- ### Clone the repository Source: https://github.com/xmos/host_xvf_control/blob/develop/README.rst Use this command to clone the repository along with its dependent git submodules. ```console git clone --recurse-submodules git@github.com:xvf/host_xvf_control.git ``` -------------------------------- ### Module Inclusion and Conditional Builds Source: https://github.com/xmos/host_xvf_control/blob/develop/CMakeLists.txt Defines paths for framework modules and conditionally includes source files and test directories based on platform and build options. ```cmake set(FWK_RTOS ${CMAKE_SOURCE_DIR}/fwk_rtos) set(DEVICE_CONTROL_PATH ${FWK_RTOS}/modules/sw_services/device_control) include(src/host_drivers.cmake) include(src/host_application.cmake) # Compile the DFU host app only for Raspberry Pi if((UNIX AND NOT APPLE) AND ((${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l") OR (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64"))) include(src/dfu/dfu_application.cmake) endif() if(TESTING) include(src/low_level_test_host_drivers.cmake) add_subdirectory(test) endif() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.