CMake ===== config.cmake ------------ CMake configuration file(s) defining a cross compiler toolchain and installation directories. They can also optionally define extra assembly, C, C++ or linker flag arguments to the cross and/or native compilers. To create a new configuration file from the template invoke the pyedev config command:: pyedev config --new NAME The defined variables in this file are made available to CMakeLists.txt files (when using the pyedev build command) using the following include:: include("${PYEDEV_CONFIG}") build.cmake ----------- CMake function definitions for use by CMake build targets files. These are made available to CMakeLists.txt files (when using the pyedev build command) using the following include:: include("${PYEDEV_BUILD}") Includes build tools for cross compiling static library archives and application binaries, and for natively compiling executable test suites. The functions available are documented below. pyedev_build_util_configure_files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function to configure list of files where .in exists:: pyedev_build_util_configure_files([file1, ...]) Wrapper to CMake configure_file, iterates over list of files and if file with .in extension exists it is configured to produce file output. The arguments are: ``[file1, ...]`` Input file list without .in extension. pyedev_build_util_build_number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function to get a build number from file:: pyedev_build_util_build_number( ) Uses regex to get build number from file, or return a default value of 1. The arguments are: ```` Build number file path. ```` Output build number variable. pyedev_build_util_arch_flags ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function to get architecture specific compiler and linker flags:: pyedev_build_util_arch_flags( ) Will set the output variable names to architecture specific compiler and linker flags for use during compilation. Currently supports: ``cortex-m0``, ``cortex-m4``, ``cortex-m7``. The arguments are: ```` Architecture string. ```` Output compiler flags variable. ```` Output linker flags variable. pyedev_build_target_library_headers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function to install library headers:: pyedev_build_target_library_headers( ) Library headers will be installed the specified installation subdirectory, which can be used to structure the library includes installation directory. The arguments are: ```` Unique name for library headers target. ```` Headers file list. ```` Installation location for target output, this should be a relative path inside the library includes install directory defined in configuration file. ```` Output target variable. pyedev_build_target_library ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function to create a static library build target:: pyedev_build_target_library( ) ```` Unique name for library target. ```` Architecture string. ```` General compiler flags. ```` Include directories list. ```` Source files list. ```` Target dependencies list. ```` Build file path (increments build number). ```` Output target variable. pyedev_build_target_application ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function to create a application binary build target:: pyedev_build_target_application( ) Application sources will be compiled to produce elf, map and binary output files for the target architecture. Target files will be copied to the install directory and output target variable will be set. Target is built when platform type is ``cross``. The arguments are: ```` Unique name for application target. ```` Architecture string. ```` General compiler flags. ```` Linker script file path. ```` Linker flags. ```` Include directories list. ```` Source files list. ```` Linked libraries list. ```` Target dependencies list. ```` Installation location for target outputs, this should be a relative path inside the application install directory defined in configuration file. ```` Build file path (increments build number). ```` Output target variable. pyedev_build_target_utility ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function to create a utility executable build target:: pyedev_build_target_utility( ) Utility sources will be compiled to produce executable binary. Target is built when platform type is ``native``. ```` Unique name for utility target. ```` General compiler flags. ```` Include directories list. ```` Source files list. ```` Target dependencies list. ```` Installation location for target output, this should be a relative path inside the binary install directory defined in configuration file. ```` Output target variable. pyedev_build_target_test ~~~~~~~~~~~~~~~~~~~~~~~~ Function to create a test executable build target:: pyedev_build_target_test( ) Test sources will be compiled to produce executable binary. Output file will be copied to the install directory and executed. Target is built when platform type is ``native``. ```` Unique name for test target. ```` General compiler flags. ```` Include directories list. ```` Source files list. ```` Target dependencies list. ```` Installation location for target output, this should be a relative path inside the tests install directory defined in configuration file. ```` Output target variable. pyedev_build_target_doxygen ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function to create a documentation generation target using Doxygen:: pyedev_build_target_doxygen( ) Doxygen will be invoked with the doxyfile configuration file. HTML produced in the output directory will be copied to the install directory. Target is built when platform type is ``none``. The arguments are: ```` Unique name for Doxygen target. ```` Input Doxygen configuration file. ```` Directory location of Doxygen output, this should be a relative path inside the CMake build directory such as "doxygen" and match the variable ``OUTPUT_DIRECTORY`` in the doxyfile. ```` Installation location for Doxygen html output, this should be a relative path inside the documentation install directory defined in configuration file.