{"id":34633923,"url":"https://github.com/omnetpp/cmake","last_synced_at":"2026-03-15T19:34:39.615Z","repository":{"id":47605744,"uuid":"365992547","full_name":"omnetpp/cmake","owner":"omnetpp","description":"CMake module for OMNeT++ projects","archived":false,"fork":false,"pushed_at":"2021-08-22T09:49:30.000Z","size":332,"stargazers_count":10,"open_issues_count":3,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-02-19T04:40:50.504Z","etag":null,"topics":["cmake","omnetpp"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omnetpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-10T09:45:44.000Z","updated_at":"2025-03-11T13:34:53.000Z","dependencies_parsed_at":"2022-09-13T12:41:22.465Z","dependency_job_id":null,"html_url":"https://github.com/omnetpp/cmake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/omnetpp/cmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnetpp%2Fcmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnetpp%2Fcmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnetpp%2Fcmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnetpp%2Fcmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omnetpp","download_url":"https://codeload.github.com/omnetpp/cmake/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omnetpp%2Fcmake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30550341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T15:03:43.933Z","status":"ssl_error","status_checked_at":"2026-03-15T15:03:37.630Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cmake","omnetpp"],"created_at":"2025-12-24T16:58:58.961Z","updated_at":"2026-03-15T19:34:39.609Z","avatar_url":"https://github.com/omnetpp.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"`omnetpp-cmake` — CMake + OMNeT++ = ❤\n======================================\n\n*This repository is a community-supported work-in-progress, and may never be fully completed.\nPlease help us and others like you by contributing. Thanks!*\n\nCMake Modules for building OMNeT++ projects and integrating with you CMake supporting editor.\n\nThese CMake modules were originally developed against **OMNeT+ 5.X**, but should also work with **OMNeT++ 6.0** and beyond.\n\nWe are currently building our :pencil: documentation website at https://omnetpp.github.io/cmake.\nThough this documentation is still work-in-progress, you may already have a look at it!\n\nUsage\n-----\n\nThe following is *one* of many other ways to do it.\n\n1.\tAdd the repository as a *`git` submodule* to your repository in `cmake`.\u003csup id=\"a1\"\u003e[1](#f1)\u003c/sup\u003e\n\n    ```sh\n    git submodule add https://github.com/omnetpp/cmake.git cmake\n    ```\n\n    ⚠ **Note:** If you have other CMake modules it is recommended that you replace `cmake` with `cmake/omnet` and so forth here and in the following steps.\n\n2.  Update and/or initialise the submodule.\u003csup id=\"a2\"\u003e[1](#f2)\u003c/sup\u003e\n\n    ```sh\n    git submodule update --init --recursive\n    ```\n\n3.  Create a minimal `CMakeLists.txt` in the root repository folder.\n\n\n    ```cmake\n    project(YourProject)\n\n    # It is recommended to increase the minimum version to your current\n    cmake_minimum_required(VERSION 3.1)\n\n    # Change \"cmake\" if you put the submodule in a different directory\n    set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)\n\n    find_package(OmnetPP 6.0 REQUIRED)\n\n    # Load the CMake commands for OMNeT++\n    include(OmnetppHelpers)\n    ```\n\n4.  Update your `CMakeLists.txt` with your OMNeT++ project details\n\n    ```cmake\n    # Uncomment the following if you have external dependencies like INET\n    #find_path(INET_DIR NAMES src/inet/package.ned DOC \"INET root directory\")\n    #import_opp_target(inet ${INET_DIR}/src/Makefile)\n\n    # Define your library/simulation sources\n    set(SOURCES\n        src/a.cc\n        src/b.cc)\n\n    add_library(project_library SHARED ${SOURCES})\n\n    # Define your messages as well\n    set(MESSAGE_SOURCES\n        messages/a.msg\n        messages/b.msg)\n\n    generate_opp_message(project_library\n        MESSAGE_FILES ${MESSAGE_SOURCES})\n\n    # You will need to tweak and add the additional properties for your project\n    set_target_properties(project_library PROPERTIES\n        OUTPUT_NAME my_project_sim\n        NED_FOLDERS src)\n\n    # Link the libraries you need for your project; add \"inet\" if necessary\n    target_link_libraries(project_library opp_interface)\n\n    # This creates an OMNet++ CMake run for you\n    add_opp_run(project_name \n        CONFIG omnetpp.ini \n        DEPENDENCY project_library)\n    ```\n\n\n### Macros Available\n\n- `generate_opp_message`(`\u003ctarget\u003e` *`MESSAGE_FILES`* `\u003cfile1\u003e ...`)  \n  Generates and links a message file to a given target.\n\n- `import_opp_target`(`\u003copp_makemake_target\u003e` `\u003cMakefile\u003e` [ `\u003ccmake_target_file\u003e` ])  \n  Imports a target from a Makefile created by opp_makemake.  \n  ⚠ **Note:** The target must have the same name as in the `Makefile`!\n\n- `add_opp_build_target`(`\u003cname\u003e`)  \n  Adds a build target with a given name.\n\n- `add_opp_run`(`\u003cname\u003e` [ *`CONFIG`* `\u003cfile\u003e` | *`WORKING_DIRECTORY`* `\u003cdir\u003e` | *`NED_FOLDERS`* `\u003cdir1\u003e ...` ] *`DEPENDENCY`* `\u003ctarget\u003e` )  \n  Adds a build target with a given name based on the given dependency.\n\n- `add_opp_test`(`\u003cname\u003e` [*`CONFIG`* `\u003cfile\u003e` | *`RUN`* `\u003centry\u003e` | *`SIMTIME_LIMIT`* `\u003climit\u003e` | *`SUFFIX`* `\u003cname\u003e`])\n  Adds a test target with a given name.\n\n### Interfaces and Library Targets Available\n\n`OmnetPP::header` is a bare interface target with at least the compile definitions and include directories set for the found OMNeT++ setup.\nAdditionally, the following OMNeT++ libraries are provided as imported library targets:\n- `OmnetPP::cmdenv`\n- `OmnetPP::common`\n- `OmnetPP::envir`\n- `OmnetPP::eventlog`\n- `OmnetPP::layout`\n- `OmnetPP::main`\n- `OmnetPP::nedxml`\n- `OmnetPP::qtenv`\n- `OmnetPP::qtenv-osg`\n- `OmnetPP::scave`\n- `OmnetPP::sim`\n- `OmnetPP::tkenv`\n\n\nMotivation \u0026 Background\n-----------------------\n\nFor the full motivation and background please [see Raphael Riebl's presentation at the 2015 OMNeT++ Summit][summit-presentation].\n\nSome benefits include:\n\n- CMake is widely used for C/C++ projects\n- Convenient user interfaces available for configuring builds\n- Solid dependency handling, both *internal* and *external*\n- More accessible syntax compared to Makefiles\n- Several IDEs support the CMake build system\n- Support OMNeT++ 6.0 preview releases (by @thor)\n\nCaveats\n-------\n\nThere have been some changes which might require fixes or future improvements.\nThese are primarily changes to make the proof-of-concept employed in Artery also work with OMNet++ 6.0.\nHowever, there are also some minor oddities and questions, uncertainties and the likes of which.\n\n- [ ] `opp_cmake.py` will not take a lot of automatic definitions into account when importing a project\n- [ ] `clean_opp_messages()` is unavailable as message files are no longer gathered in a single folder for buliding\n- [ ] include path needs to be adjusted manually if `#include \"generated_m.h\"` is used\n- [ ] `add_opp_run` doesn't seem to utilise the parameter `NED_FOLDERS`\n\nLicensing\n---------\n\nThe CMake modules were based on those in [the OMNet++ V2X simulation framework in `riebl/artery`][artery], which is licensed as GPL-2.0.\n\nReferences\n----------\n\n- [Source repository `riebl/artery`][artery]\n- [Presentation at 2015 OMNet++ Summit][summit-presentation]\n\n\n[artery]: https://github.com/riebl/artery\n[artery_checkout]: https://github.com/riebl/artery/tree/a4e013af70d2b5c3223492a518afb57fb92a7a8d/cmake\n[summit-presentation]: https://summit.omnetpp.org/archive/2015/assets/pdf/OMNET-2015-17-Slides.pdf\n\n---\n\n\u003cb id=\"f1\"\u003e1\u003c/b\u003e: You could also just download the files and put them where you'd like, or if you want to contribute, *fork it* and add that repository as a submodule! [↩](#a1)\n\n\u003cb id=\"f2\"\u003e2\u003c/b\u003e: You may exchange the paths as you wish, but make sure to update them later on too. [↩](#a2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomnetpp%2Fcmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomnetpp%2Fcmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomnetpp%2Fcmake/lists"}