{"id":23236796,"url":"https://github.com/pratikpc/goldpkg-template","last_synced_at":"2026-01-20T10:32:58.894Z","repository":{"id":125288614,"uuid":"296422220","full_name":"pratikpc/GoldPKG-Template","owner":"pratikpc","description":"GoldPKG:- A C++ Package Manager which uses CMake and VCPKG to simplify CMake based project development","archived":false,"fork":false,"pushed_at":"2020-09-29T05:35:24.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T21:17:27.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/pratikpc/GoldPKG","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/pratikpc.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":"2020-09-17T19:24:00.000Z","updated_at":"2020-09-29T05:35:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"c01729b1-f24e-4c3d-9e96-f59ecb198706","html_url":"https://github.com/pratikpc/GoldPKG-Template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/pratikpc/GoldPKG-Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2FGoldPKG-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2FGoldPKG-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2FGoldPKG-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2FGoldPKG-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pratikpc","download_url":"https://codeload.github.com/pratikpc/GoldPKG-Template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpc%2FGoldPKG-Template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28601858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T09:39:28.479Z","status":"ssl_error","status_checked_at":"2026-01-20T09:38:10.511Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-12-19T04:12:45.175Z","updated_at":"2026-01-20T10:32:58.876Z","avatar_url":"https://github.com/pratikpc.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoldPKG\n\n![npm](https://img.shields.io/npm/v/goldpkg) ![C++](https://img.shields.io/badge/C++-Solutions-blue.svg?style=flat\u0026logo=cplusplus) [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![Test on Windows, MacOS, Ubuntu](https://github.com/pratikpc/GoldPKG-Template/workflows/Test%20on%203%20OSes/badge.svg)](https://github.com/pratikpc/GoldPKG-Template/actions)\n\n---\n\n_[Did you pay the Iron Price for CMake and VCPKg Integration or the Gold?  \n Yes. I watch GoT. Non-GoT can ignore this lame joke](https://youtu.be/uY_KyLAdgfs?t=65)_\n\n---\n\nGoldPKG simplifies [VCPKG](https://github.com/microsoft/vcpkg/) and CMake Integration by\n\n1. Make VCPKG into the _[NPM](https://docs.npmjs.com/cli-documentation/) of the C++ World_ (at least npm install and uninstall :-P)\n2. Making it _easier_ to integrate CMake and VCPKG Manifests\n3. Making it _easier_ to install and remove packages from Manifests\n4. Extend VCPKG with more tighter CMake Integration\n\n## How To Install\n\n---\n\nYou will need\n\n1. [NodeJS/NPM](https://nodejs.org/)\n2. [CMake](https://cmake.org/download/)\n3. A Good C++ Compiler\n4. [Ninja-Build](https://ninja-build.org/)(Not Required but we recommend)\n\n```powershell\n\u003e npm install -g goldpkg\n\u003e goldpkg --init Project\n```\n\nThis will create a CMake Project with GoldPKG Support\n\n---\n\n## Starting\n\n---\n\n### Using an Existing Project\n\nYou need - To possess a top level CMakeLists.txt\n\n-   An Initialized Git Repository - With a commit - As we will add vcpkg as a submodule for you\n    Run `goldpkg install`  \n    GoldPKG will add .vcpkg submodule etc for you  \n    We will also generate a VCPKG Manifest for you  \n    We will also generate a GoldPKG Configuration for you\n\n### Handhold Me. Generate Samples for Me\n\nRun `goldpkg --init Samples`  \nThis generates a CMake Project in the _Samples_ Folder  \nThe Code generated is Modular  \nWe provide a Sample Library in Lib Folder  \nAnd Application in src  \nWe also provide Unit Tests for Library\n\nNext run `goldpkg install`\n\n---\n\n## How to use?\n\n---\n\n1. `goldpkg install pkg-names`  \n   Overloads _`vcpkg install`_\n   Installs the packages provided in Non-Manifest Mode  \n   Adds packages to the manifest  \n   Displays Find and Target to CMake for all packages in Manifest  \n   If `--cmake` option is specified with path to CMake Directory, adds Find and Target to all CMakeLists.txt that match the glob\n\n    Will add\n\n    ```cmake\n    # AUTOGEN FIND COMMANDS GENERATED BY goldpkg\n    # AUTOGEN FIND PLEASE DO NOT MODIFY\n    find_path(BOOST_ARRAY_INCLUDE_DIRS \"boost/array.hpp\")\n    # AUTOGEN FIND LIBRARY WILL LOOK FOR PACKAGES HERE ONLY\n    # AUTOGEN FIND ENDS HERE\n\n    ...\n\n    # AUTOGEN TARGET GENERATED BY goldpkg\n    # AUTOGEN TARGET PLEASE DO NOT MODIFY\n    target_include_directories(${PROJECT_NAME} PRIVATE ${BOOST_ARRAY_INCLUDE_DIRS})\n    target_link_libraries(${PROJECT_NAME} PRIVATE libs::SAMPLE-LIB)\n    # AUTOGEN TARGET LIBRARY WILL LOOK FOR PACKAGES HERE ONLY\n    # AUTOGEN TARGET ENDS HERE\n    ```\n\n2. `goldpkg install`  \n   Overloads `vcpkg install`  \n   Displays Find and Target to CMake for all packages in Manifest\n\n3. `goldpkg remove pkg-names`  \n   Replaces `vcpkg remove` which does not work in Manifest mode  \n   Removes pkg-names from Manifest  \n   **DEFAULT**:- Removes the package from all `CMakeLists.txt` found  \n   If `--cmake` option is specified, removes Packages from `CMakeLists` provided in command line\n\n    This option here can be used as a glob also (provide src to remove from all CMakeLists.txt in src directory)\n\n    Remove is a goldpkg only operation as VCPKG as of Now does not Support Remove\n\n4. `goldpkg update`  \n   Updates the vcpkg submodule  \n   Runs bootstrap to rebuild `vcpkg` executable  \n   Then runs vcpkg update\n\n5. `goldpkg --versupgrade`\n\n    Absent in VCPKG  \n     One of our own commands.  \n    Upgrades the _Semver_ version specified in the manifest (choices: _\"`major`\", \"`premajor`\", \"`minor`\", \"`preminor`\", \"`patch`\", \"`prepatch`\", \"`prerelease`\"_)\n\n    We use the [same library as NPM](https://www.npmjs.com/package/semver)\n\n6. Rest of the commands  \n   Directly passed to `vcpkg`\n\n---\n\n## What next?\n\n1. Install the Dependencies using (`goldpkg install`)\n2. Modify the Code and add libraries to your liking\n3. Run `cmake -S . -B build -G Ninja`  \n   This will generate Ninja-Build files for you  \n   I recommend using Ninja-Build because it's pretty nice\n4. Run `cmake --build build` to build the code\n5. `cd build`\n6. Run `ctest` to start testing\n\n---\n\n## _OPTIONS_\n\n---\n\n| Option                    | Definition                                                                 | Type                                                                                      |\n| :------------------------ | :------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------- |\n| **--version**             | Show version number                                                        | `[boolean]`                                                                               |\n| **--help**                | Show help                                                                  | `[boolean]`                                                                               |\n| **--bootstrap**           | Bootstrap VCPKG                                                            | `[array]`                                                                                 |\n| **--config-json**         | Provide Path to Configuration File. By Default, Looks in Current Directory | `[string]` [default: Current Directory]                                                   |\n| **_--cmake_**             | Provide Path to `CMakeLists.txt`.                                          | `[string]`                                                                                |\n| **--vcpkg-json**          | Provide Path to vcpkg Manifest                                             | `[string]` [default: Current Directory]                                                   |\n| **--vcpkg-root**          | Provide Path to VCPkg.                                                     | `[string]` [default: Current Directory]                                                   |\n| **--save-dev**, **--dev** | Save New Package to Dev Environment                                        |                                                                                           |\n| **--cmake-toolchain**     | Get the Path to VCPKG ToolChain File                                       |                                                                                           |\n| **--triplet**             | Set the VCPKG Triplet                                                      | `[string]`                                                                                |\n| **--versupgrade**         | Semver updates of Manifest                                                 | [`choices`: _\"major\", premajor\", \"minor\", \"preminor\", \"patch\", \"prepatch\", \"prerelease\"_] |\n| **--init**                | Name the Directory to Initialize the Project                               | `[string]`                                                                                |\n| **--vcpkg**               | Pass Commands directly to VCPKG instead of using our Overloads             | `[array]`                                                                                 |\n\n---\n\n## ADDITIONAL CONFIGURATIONS\n\n---\n\nWe provide a `.goldpkg.json` file by default\n\n```json\n{\n    \"Bootstrap\": [\"-disableMetrics\"],\n    \"VCPkg\": []\n}\n```\n\nCurrently supports configuring Bootstrap and VCPKG with additional commands\n\n---\n\n## FAQ\n\n---\n\n1. Why do we need another package manager after the 100s we already have?\n    \u003cdetails\u003e\n     \u003csummary\u003eSpoiler Alert\u003c/summary\u003e  \n     We don't  \n     Let's stop making new package managers and start supporting existing ones\n     \u003c/details\u003e\n\n    Our package extends VCPKG to add support for CMake  \n    VCPKG manages the packages  \n    VCPKG performs the downloads  \n    VCPKG performs the installations\n    All we do is Integrate VCPKG and CMake\n\n---\n\n2. Do I need to add Toolchain File when running CMake?  \n   No. We add the Toolchain to the Root CMake File we provide  \n   No need to configure anything. The Process is Automatic  \n   All you need to do is run at least one command in the Root directory\n\n---\n\n3. Do I need to install something for your Library to Work?  \n   Yes you will need to [install Node.JS/NPM](https://nodejs.org/).  \n   And then run the Command mentioned above\n\n---\n\n4. Does your App work on Windows \u0026 Linux?  \n   You bet it does\n\n---\n\n5. Do you plan to add support for these to VCPKG?  \n   That's the Aim.  \n    See TypeScript allows us to develop the code very quickly  \n    So this is a prototyping model  \n    Based on the responses of the userbase, I will try to add new features\n\n---\n\n6. Do you work for Microsoft? Is this package officially backed by Microsoft or VCPKG Team?  \n   The max I have done is created issues and used VCPKG since 2018  \n   I do not and have not yet had the pleasure of working for them  \n   So no, this package enjoys no official support from VCPKG or Microsoft\n\n---\n\n7. I have ideas to share and features to add. Can I help?  \n   GoldPKG needs you!  \n   It's sort of a meme I realise but there are a lot of features we can add here  \n   And I cannot do it alone\n\n---\n\n8. I just learnt how to use VCPKG. Now I have to learn how to use this. Why?  \n   This is a genuine question.  \n   The thing is though, the way GoldPKG is designed, you do not have to learn\n   a new anything.  \n   GoldPKG overloads VCPKG commands  \n   It uses absolutely the same commands so knowledge of one, transfers to another\n\n---\n\n9.  What do you provide in [the Generated Repo](https://github.com/pratikpc/GoldPKG-Template)?  \n    We provide\n\n    1. Clang-Format file. (To use Clang-Format with Support for globs as Input params install [clang-format-ex](https://www.npmjs.com/package/clang-format-ex). Another of my libraries)\n    2. A Sample CMake Project with\n        - Boost Array\n        - Catch2 for Unit Testing\n        - VCPKG Manifest with both installed\n        - Why were these packages chosen?\n            - To be honest, I have no idea why I chose Boost-Array\n            - Catch2 is one of the most popular Unit Tests solutions though\n    3. VCPKG installed as a Submodule\n    4. An NPM Package.json\n        - You can choose not to use it\n        - I provided it because I sometimes use\n            - [Husky](https://www.npmjs.com/package/husky)\n            - [Lint-Staged](https://www.npmjs.com/package/lint-staged)\n        - for [Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)\n    5. [GitHub Actions](https://docs.github.com/en/actions) for Unit Testing CMake on\n        - Windows\n        - Linux\n        - macOS\n\n---\n\n10. I want to run VCPKG Commands Directly. I don't want to use your overloads  \n    We allow that  \n    Use\n\n```bash\n\u003e goldpkg --vcpkg \u003c-commands-\u003e\n```\n\n11. Why create GoldPKG?  \n    I wanted something like Node_Modules and NPM for C++  \n    However, I found nothing that works well  \n    VCPKG working as submodules was begging to be used as the Node_Modules of the C++ World  \n    Begging I tell you. Begging!\n\n12. Can this be used for production?  \n    I am not sure. I don't think it should be used in production till we reach our first major release\n\n---\n\n## Samples Repo Location\n\nNot to put to fine a point on it, [you could find it here](https://github.com/pratikpc/GoldPKG-Template)\n\nWe might need a lot of help optimising this repo to make it better for most of our userbase here as well\n\nMore comments and to make the CMake less CMake-y and more Tutorial like\n\n(I have not written a lot of CMake code in my life and it shows)\n\n---\n\n## Reserved Sections in `CMakeLists.txt`\n\nThe idea is no..., we are not here to overrwrite your packages\nWe reserve our zones, you reserve yours\n\nNow what if you have your own `find_package` commands?\n\nNo issues, we stop searching the moment our comment at the top is not found\n\nWe reserve our zones.\n\nWe do not focus on the rest\n\n### 1. Zone For `find_`\n\nRight below `project()` command\n\n```cmake\nproject (SAMPLE-RUN)\n# AUTOGEN FIND COMMANDS GENERATED BY goldpkg\n```\n\n---\n\n### 2. Zone for `target_`\n\nWe add these at the very end  \nAt the last line\n\n```cmake\ntarget_link_libraries(${PROJECT_NAME} PRIVATE Catch2::Catch2)\n# AUTOGEN TARGET LIBRARY WILL LOOK FOR PACKAGES HERE ONLY\n# AUTOGEN TARGET ENDS HERE\n```\n\n---\n\n### 3. Zone for `set (CMAKE_TOOLCHAIN_FILE`\n\nWe add this either to the first line or after `cmake_minimum_required`  \nAnd only in the Top Level Directory (same as one with VCPKG Manifest)\n\n```cmake\ncmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)\n\n# AUTOGEN TOOLCHAIN Generated by goldpkg\n# AUTOGEN TOOLCHAIN Links to LOCAL VCPKG ToolChain File\nset(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/.vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING \"Vcpkg toolchain file\")\n# AUTOGEN TOOLCHAIN Generation ENDS\n```\n\n---\n\n## HOW DOES IT ALL WORK\n\n---\n\nYou work with the deficiencies of VCPKG  \nVCPKG install in Manifest mode does not showcase CMake Information  \nSo we run `vcpkg install package-names` in Non-Manifest Mode first  \nGet the package-names CMake Information  \nAnd append those to the CMake Files\n\nWhile removing, we do the same\nExcept we delete this time\n\n---\n\n## TODO\n\n---\n\n### 1. EASILY ACHIEVABLE\n\n1. One of my favourite parts of NPM is that using NPM version \u003c-option-\u003e\n\n    - It not only updates the version like GoldPKG\n    - But creates a Commit\n    - And a Tag\n    - We could add that\n\n2. Nicer Template Repo\n    - If you have seen our template, it must be\n    - Painfully obvious that I am not Mr CMake\n    - Painfully obvious I don't use CMake for a living\n    - Painfully obvious the Unit Tests to everything are Zero Effort\n    - If we could clean that up, it would be rather nice!\n\n---\n\n### 2. DIFFICULT TO ACHIEVE\n\n1. Something similar to NPM PUBLISH\n    - Automatically commit the code and create a Pull Request in VCPKG Repo Manually\n    - This could be used via GitHub Actions or other such tools\n    - Or, we modify GoldPKG\n2. Something simplar to NPM Scripts\n    - In NPM you can\n    - Provide script command where\n    - You can mention the commands you can run\n    - Say something like\n    - goldpkg run format\n    - Would format your entire Codebase\n\n---\n\n## Contact the Developer\n\nYou can contact me via [LinkedIn](https://www.linkedin.com/in/pratik-chowdhury-889bb2183/) or create a GitHub Issue\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpc%2Fgoldpkg-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratikpc%2Fgoldpkg-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpc%2Fgoldpkg-template/lists"}