{"id":21744672,"url":"https://github.com/github0null/cmake_embedded_project_template","last_synced_at":"2025-03-21T01:42:16.493Z","repository":{"id":100179348,"uuid":"459059024","full_name":"github0null/cmake_embedded_project_template","owner":"github0null","description":"cmake embedded project template","archived":false,"fork":false,"pushed_at":"2022-05-05T12:56:03.000Z","size":1633,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T22:23:02.099Z","etag":null,"topics":["armcc","cmake","cortex","gcc","mcu","ninja","stm32","vscode"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github0null.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-14T07:32:14.000Z","updated_at":"2023-08-21T23:31:43.000Z","dependencies_parsed_at":"2023-04-25T20:15:43.490Z","dependency_job_id":null,"html_url":"https://github.com/github0null/cmake_embedded_project_template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0null%2Fcmake_embedded_project_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0null%2Fcmake_embedded_project_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0null%2Fcmake_embedded_project_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0null%2Fcmake_embedded_project_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github0null","download_url":"https://codeload.github.com/github0null/cmake_embedded_project_template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244722655,"owners_count":20499153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["armcc","cmake","cortex","gcc","mcu","ninja","stm32","vscode"],"created_at":"2024-11-26T07:12:16.427Z","updated_at":"2025-03-21T01:42:16.467Z","avatar_url":"https://github.com/github0null.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CMake embedded project template\n\n## Requirements\n\n- cmake \u003e= 3.20\n- ninja\n- toolchain: `arm-none-eabi` or `armcc`\n\n\u003e **Recommendation**: Use this template with VsCode and `ms-vscode.cmake-tools` extensions\n\n***\n\n## Build Test Project\n\n- **Build arm-none-eabi gcc test project**\n\n  Write `CMakeLists.txt` with following contents:\n\n  ```cmake\n  cmake_minimum_required(VERSION 3.20.0 FATAL_ERROR)\n\n  # Set up compiler and mcu arch \n  set(COMPILER_TYPE \"arm-none-eabi\") # options: 'armcc' or 'arm-none-eabi'\n  set(MCU_ARCH_TYPE \"cortex_m7\") # options: 'cortex_m0', 'cortex_m3' ...\n  set(MCU_MFPU_TYPE \"default\") # options: 'sp', 'dp', 'none', 'default'\n\n  # Include toolchain config\n  include(${CMAKE_SOURCE_DIR}/cmake/toolchain/${COMPILER_TYPE}/${MCU_ARCH_TYPE}.cmake)\n\n  # Set up project name\n  set(PRJ_NAME \"cmake_project_demo\")\n\n  # Set up the project\n  project(${PRJ_NAME}\n      VERSION \"0.1.0\"\n      LANGUAGES C ASM CXX)\n\n  # Build test project\n  add_subdirectory(test/gcc_test)\n  ```\n\n  then, execute the following commands to build project:\n\n  ```shell\n  cmake -B ./build -G Ninja\n  cmake --build ./build --target all -j 14\n  ```\n\n- **Build armcc test project**\n\n  Write `CMakeLists.txt` with following contents (**Please set `TOOLCHAIN_DIR` for armcc before build**):\n\n  ```cmake\n  cmake_minimum_required(VERSION 3.20.0 FATAL_ERROR)\n\n  # Set up compiler and mcu arch \n  set(COMPILER_TYPE \"armcc\") # options: 'armcc' or 'arm-none-eabi'\n  set(MCU_ARCH_TYPE \"cortex_m3\") # options: 'cortex_m0', 'cortex_m3' ...\n  set(MCU_MFPU_TYPE \"default\") # options: 'sp', 'dp', 'none', 'default'\n  set(TOOLCHAIN_DIR \"D:/Keil/ARM/ARMCC/bin\") # toolchain root folder for armcc\n  \n  # other armcc options\n  #option(USE_MICRO_LIB \"Enable MicroLib\" ON)\n\n  # Include toolchain config\n  include(${CMAKE_SOURCE_DIR}/cmake/toolchain/${COMPILER_TYPE}/${MCU_ARCH_TYPE}.cmake)\n\n  # Set up project name\n  set(PRJ_NAME \"cmake_project_demo\")\n\n  # Set up the project\n  project(${PRJ_NAME}\n      VERSION \"0.1.0\"\n      LANGUAGES C ASM CXX)\n\n  # Build test project\n  add_subdirectory(test/armcc_test)\n  ```\n\n  then, execute the following commands to build project:\n\n  ```shell\n  cmake -B ./build -G Ninja\n  cmake --build ./build --target all -j 14\n  ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub0null%2Fcmake_embedded_project_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub0null%2Fcmake_embedded_project_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub0null%2Fcmake_embedded_project_template/lists"}