{"id":15068069,"url":"https://github.com/jimli570/cplusplus-cmake-template","last_synced_at":"2025-07-08T23:04:20.489Z","repository":{"id":255595727,"uuid":"852524893","full_name":"jimli570/cplusplus-cmake-template","owner":"jimli570","description":"This project demonstrates a robust CMake-based build system that showcases the creation and utilization of a custom library within an application.  Written in year 2024.","archived":false,"fork":false,"pushed_at":"2024-09-18T15:29:55.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T16:34:17.646Z","etag":null,"topics":["cmake","cplusplus"],"latest_commit_sha":null,"homepage":"","language":"CMake","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/jimli570.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":"2024-09-05T00:39:48.000Z","updated_at":"2024-11-02T23:11:28.000Z","dependencies_parsed_at":"2024-09-06T07:37:54.373Z","dependency_job_id":"093f3507-dcf0-4661-befe-f9c63041499e","html_url":"https://github.com/jimli570/cplusplus-cmake-template","commit_stats":null,"previous_names":["jimli570/cplusplus-cmake-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jimli570/cplusplus-cmake-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimli570%2Fcplusplus-cmake-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimli570%2Fcplusplus-cmake-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimli570%2Fcplusplus-cmake-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimli570%2Fcplusplus-cmake-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimli570","download_url":"https://codeload.github.com/jimli570/cplusplus-cmake-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimli570%2Fcplusplus-cmake-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264363749,"owners_count":23596502,"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":["cmake","cplusplus"],"created_at":"2024-09-25T01:30:16.925Z","updated_at":"2025-07-08T23:04:20.462Z","avatar_url":"https://github.com/jimli570.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CMake Template Project: MyLibrary and MyApp Integration\n\nThis project demonstrates a robust CMake-based build system that showcases the creation and utilization of a custom library within an application. The template is structured as follows:\n\n## About\n\n### Project Components\n\n1. **MyLibrary**: A custom-built library that encapsulates reusable functionality.\n2. **MyApp**: An application that leverages the features provided by MyLibrary.\n\n### Build Process\n\nThe CMake configuration orchestrates a two-stage build process:\n\n1. **Library Compilation**: MyLibrary is compiled as a standalone unit, generating either a static or dynamic library based on project requirements.\n\n2. **Application Linking**: MyApp is subsequently built, with CMake managing the necessary linkage to MyLibrary.\n\n### Key Features\n\n- Modular design promoting code reusability\n- Flexible configuration options for library type (static/dynamic)\n- Streamlined dependency management\n- Cross-platform compatibility ensured through CMake's abstraction layer\n- Integration with vcpkg for external library management\n\nThis template serves as an excellent starting point for projects requiring a clear separation between core library functionality and application-specific code, while maintaining a cohesive build system.\n\n## Prerequisite\n\n- CMake version \u003e= 3.15\n  - Download from: \u003chttps://cmake.org/\u003e\n- A C++ compiler and build system (e.g., Visual Studio, GCC, Clang)\n  - For Visual Studio: \u003chttps://visualstudio.microsoft.com/\u003e\n\n## Setup\n\nCommands are supposed to be run from the root directory of project.\n\n1. Follow the instructions in external libraries\n2. Generate projectfiles\n\n### External libraries\n\nFirst we need to clone VCPKG to our local drive, with the correspondig commit hash used in\nvcpkg.json. We use VCPKG to as our package manager for all 'potentially' used external libraries.\n\n```bash\ngit clone https://github.com/microsoft/vcpkg.git vcpkg\ncd vcpkg\ngit checkout 91d888703f251c13111c1b889be1f350c4ceb7ab # Corresponds to ID in vcpkg.json\n```\n\n### Generate Project Files\n\nFrom within your desired build directory, in most cases 'build/' in the project root.\nThis well genereate project files for the default generator.\n\n```bash\nmkdir build\ncd build/\ncmake ..\n```\n\nyou can also specify a specific generator using `cmake .. -G \u003creplace_with_other_generator\u003e` instead of the default one.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimli570%2Fcplusplus-cmake-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimli570%2Fcplusplus-cmake-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimli570%2Fcplusplus-cmake-template/lists"}