{"id":21590929,"url":"https://github.com/spaceteam/rodos","last_synced_at":"2025-07-20T00:32:22.813Z","repository":{"id":55200440,"uuid":"402907593","full_name":"SpaceTeam/rodos","owner":"SpaceTeam","description":"\"Fork\" of RODOS (https://gitlab.com/rodos/rodos), to fuck around with it as we see fit.","archived":false,"fork":false,"pushed_at":"2025-06-11T22:26:12.000Z","size":13031,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-11T23:24:51.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpaceTeam.png","metadata":{"files":{"readme":"README-cmake.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":"support/support-libs/activity.cpp","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-03T22:03:11.000Z","updated_at":"2025-06-03T18:32:14.000Z","dependencies_parsed_at":"2023-12-23T20:35:44.926Z","dependency_job_id":"5575506a-c5bb-4bf8-aa2d-7408e15299d4","html_url":"https://github.com/SpaceTeam/rodos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SpaceTeam/rodos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Frodos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Frodos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Frodos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Frodos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpaceTeam","download_url":"https://codeload.github.com/SpaceTeam/rodos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2Frodos/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266048559,"owners_count":23868741,"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":[],"created_at":"2024-11-24T16:20:59.869Z","updated_at":"2025-07-20T00:32:17.781Z","avatar_url":"https://github.com/SpaceTeam.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"How to build RODOS with CMake\n=============================\n\nCMake is a meta build-system suitable for large projects where build steps are\nconfigured declaratively in CMakeLists.txt. CMake can automatically generate a\nMakefile from this build configuration. Afterwards, make is used to compile the\nproject. The following text explains the required steps to build RODOS projects\nwith CMake.\n\nRODOS supports different target platforms, which require different compilation configuration.\nThe configuration for all the ports is encapsulated in separate cmake files at `cmake/port`.\nThere, port configuration files such as `posix.cmake`, `linux-x86.cmake`, and `stm32f4.cmake` exist.\nIn order to enable a port, we make use of a special feature of CMake: the [`CMAKE_TOOLCHAIN_FILE` variable](https://cmake.org/cmake/help/v3.15/variable/CMAKE_TOOLCHAIN_FILE.html).\nIf this variable is set on the command line when `cmake` is called, the content of the supplied file is executed before the main `CMakeLists.txt` is processed.\n\nGenerate Make Files\n-------------------\n\n```shell script\n$ mkdir build\n$ cd build\n# if on x86:\n$ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/port/linux-x86.cmake ..\n# other linux based platforms:\n$ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/port/posix.cmake ..\n```\n\nFirst, create a folder, where all the make files and the compiled files should be stored.\nIf you want to use multiple ports at once, it is sensible to create separate folders for them, e.g. `build-linux` and `build-stm32f4`.\nWhen calling cmake, the appropriate port `.cmake` file must be passed via the variable `CMAKE_TOOLCHAIN_FILE`.\n\nCompile RODOS\n-------------\n```shell script\n# make sure to be in the build directory\n$ make -j rodos\n```\n\nThis command builds the RODOS library, which is then placed at `build/librodos.a`\n\nCompile RODOS' Support Lib\n--------------------------\nThe support-libs are included automatically when compiling RODOS with CMake.\n\nCompile Tutorials\n-----------------\nFor some of the tutorials, there are ready compilation targets in CMake.\nIn order to enable them, you must set the `EXECUTABLE` variable to `ON`: \n\n```shell script\n$ cd build\n$ cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/port/posix.cmake -DEXECUTABLE=ON ..\n```\n\nAfter that, several new targets are available, which can be compiled by using their names, e.g.\n\n```shell script\n$ make -j helloworld\n```\n\nThe compiled executables are then available under `build/tutorials`.\n\nCreate Own Application Using CMake\n----------------------------------\n\nInstead of installing RODOS globally to the computer, we encourage users to add it as a submodule/subfolder to the user project.\nIf you are using git, you can add it directly as submodule just like this:\n```shell script\ngit submodule add https://gitlab.com/rodos/rodos.git\n```\nOtherwise, if you do not use git, you can simply clone (or manually copy) it into a subfolder:\n```shell script\ngit clone https://gitlab.com/rodos/rodos.git\n```\nIn each case, you need to make RODOS available to your application's CMake by adding it as a subdirectory:\n```cmake\nadd_subdirectory(rodos)\n```\n(Assuming that your CMakeLists.txt and RODOS are in the root directory of your project.)\n\nThere are two ways of compiling an own application that makes use of RODOS: either simply create an own CMake target as usual and link RODOS and the support lib if needed, or use our predefined simple macro, does these steps in only one call.\n\n```cmake\nadd_subdirectory(rodos)\nadd_rodos_executable(my-application my-source.cpp)\n```\n\ndoes the same thing as\n\n```cmake\nadd_subdirectory(rodos)\nadd_executable(my-application my-source.cpp)\ntarget_link_libraries(my-application PUBLIC rodos support-lib)\n```\n\nAfter those lines you can use all the features of CMake. To build the application, it is recommended to create a build-directory. Applications can then be built from the directory where your CMakeLists.txt is with:\n\n```shell script\n# optionally create the build directory\ncd build\ncmake -DCMAKE_TOOLCHAIN_FILE=../rodos/cmake/port/posix.cmake -DEXECUTABLE=ON ..\nmake all\n```\n\nYour executable should now show up in `ls -l`. If it is called my-application, it can be run with `./my-application`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspaceteam%2Frodos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspaceteam%2Frodos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspaceteam%2Frodos/lists"}