#### # Deployment 'CMakeLists.txt': # # fprime deployments setup the most basic CMake settings, include the F prime build system, and # list deployment specific modules. In one or more of these deployment modules, executables should # be registered using `register_fprime_executable`. This is usually done in a `Top` module, but not # strictly required. # # To create a deployment, create a `CMakeLists.txt` file following this template structure in a # directory. This `CMakeLists.txt` is buildable as part of CMake. Thus, the user can build the # deployment using the following commands. Unless building unit tests, these commands are the # recommended way of building F prime projects. # # **Build Commands** # ``` # mkdir build_dir # cd build_dir # cmake # ``` # # This file can be constructed in three sections. # # ### Section 1: Setup the Basic CMake Infrastructure ### # # Section 1 sets up the basic CMake infrastructure. This infrastructure configures CMake by setting # the minimum setup for a CMake project. This requires calling several CMake functions, and setting # a CMake variable. # # First, the user must call `project` to setup the project and default deployment executable name. # Also the project languages "C" and "CXX" (C++) must be supplied. # # Next, call `cmake_minimum_required` and set VERSION to 3.16 or greater. # # **Example:** # ``` # project(Ref C CXX) # cmake_minimum_required(VERSION 3.16) # ``` # # ### Section 2: Include F prime Core Build System # # This section includes the `cmake/FPrime.cmake` file from the root of the F prime library. # # **Example:** # ``` # include("${CMAKE_CURRENT_LIST_DIR}/../cmake/FPrime.cmake") # include("${CMAKE_CURRENT_LIST_DIR}/../cmake/FPrime-Code.cmake") # ``` # **Note:** if custom targets are desired, then they should be registered between the two includes. # # ### Section 3: Include Modules and Topologies # # The last section is to include all the modules that are specific to this deployment. This uses # the `add_fprime_subdirectory` function to help with adding F prime deployment modules and # keeping the F prime import structure correct. # # **Note:** Topology directories are included here. # # **Example:** # ``` # add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PingReceiver/") # add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/RecvBuffApp/") # add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SendBuffApp/") # add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/SignalGen/") # # Add Topology subdirectory # add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Top/") # ``` #### ## # Section 1: Basic Project Setup # # This contains the basic project information. Specifically, a cmake version and # project definition. # Step 1: set ## project( C CXX) cmake_minimum_required(VERSION 3.16) # Optional: set CMake build type ## # Section 2: F prime Core # # This includes all of the F prime core components, and imports the make-system. F prime core # components will be placed in the 'F-Prime' binary subdirectory to keep them from # colliding with deployment specific items. # # Step 2: set ``. Usually this is `${CMAKE_CURRENT_LIST_DIR}` ## include("/cmake/FPrime.cmake") #NOTE: add custom targets here include("/cmake/FPrime-Code.cmake") ## # Section 3: Components and Topology # # This section includes deployment specific directories. This allows use of non- # core components in the topology, which is also added here. # # Step 4: include all the subdirectories. ## # Add component subdirectories add_fprime_subdirectory("") add_fprime_subdirectory("") ... add_fprime_subdirectory("")