{"id":17800923,"url":"https://github.com/refi64/rcmake","last_synced_at":"2025-04-02T04:40:49.383Z","repository":{"id":69429303,"uuid":"85119212","full_name":"refi64/rcmake","owner":"refi64","description":"rcmake is a wrapper over CMake designed to avoid having to constantly repeat the same command-line arguments","archived":false,"fork":false,"pushed_at":"2018-05-23T23:20:15.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T05:06:47.728Z","etag":null,"topics":["cmake","cmake-resources","command-line","command-line-tool","crystal","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refi64.png","metadata":{"files":{"readme":"README.rst","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-15T20:45:43.000Z","updated_at":"2023-02-18T00:03:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e48a5e1-578f-4d7b-b06a-ca1a70be6ec5","html_url":"https://github.com/refi64/rcmake","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/refi64%2Frcmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Frcmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Frcmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Frcmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refi64","download_url":"https://codeload.github.com/refi64/rcmake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246758278,"owners_count":20828919,"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","cmake-resources","command-line","command-line-tool","crystal","wrapper"],"created_at":"2024-10-27T12:32:36.190Z","updated_at":"2025-04-02T04:40:49.364Z","avatar_url":"https://github.com/refi64.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"rcmake\n======\n\nrcmake is a wrapper over CMake designed to avoid having to constantly repeat\nthe same command-line arguments.\n\nIf you feel like you're constantly doing stuff like this::\n\n  mkdir build_dir\n  cd build_dir\n  cmake -G Ninja .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D...\n\nthen rcmake is for you! Imagine all that being simplified to just::\n\n  rcmake build_dir\n\nIntrigued? Then read on!\n\nInstallation\n************\n\nYou need `Crystal \u003chttps://crystal-lang.org/\u003e`_ (installation instructions for\nthat are `here \u003chttps://crystal-lang.org/docs/installation/\u003e`_). (You need\n`shards \u003chttps://github.com/crystal-lang/shards\u003e`_ too, but it's included by\ndefault in the Crystal binary distributions.)\n\nOnce you have that, the easy way to get rcmake is::\n\n  $ curl -L https://goo.gl/FQKLvw | sh\n\nIf you don't like running random internet scripts, then do it manually::\n\n  $ git clone https://github.com/kirbyfan64/rcmake.git\n  $ cd rcmake\n  $ shards build\n  $ ./install.sh /usr/local/bin\n\nHow-to\n******\n\n``rcmake`` greatly simplifies how you call CMake. In order to do so, it utilizes\na config file automatically created when you first run it (it's located at\n``~/.rcmake.yml``).\n\nHere's the most basic way to use rcmake::\n\n  rcmake build_dir\n  cd build_dir\n  ninja\n\nThat's it! By default, rcmake will use Ninja as the generator target and Clang\nas the compiler. Within rcmake, compilers are referred to as *suites*, which\nconsist of both the C compiler and the C++ compiler.\n\nIf you want to use make instead of Ninja, just run::\n\n  rcmake build_dir -g make\n\n``-g`` allows you to pick a different generator. Here, the *make* generator\n(which corresponds to CMake's *Unix Makefiles* generator) is being used instead.\n\nOn the other hand, how about using GCC instead of Clang? You can do that pretty\neasily::\n\n  rcmake build_dir -c gcc\n\nThe ``-c`` options allows you to change the compiler suite rcmake uses. Here,\nit's being changed to ``gcc``. (ZapCC is also supported.)\n\nIf you want a release build instead of debug, you can use::\n\n  rcmake build_dir -t release\n\nIn addition, you can even change the linker from the default (gold) to LLD or\nthe classic BFD linker::\n\n  rcmake build_dir -l bfd\n  rcmake build_dir -l lld\n\nWhat if there's an option rcmake doesn't cover? You can just pass it manually\nusing ``-C`` for C compiler flags, ``-X`` for C++ compiler flags, or ``-L`` for\nlinker flags::\n\n  rcmake build_dir -C=-std=c99 -X=-std=c++11 -L=-B/usr/bin/ld.gold\n\nYou can even pass flags straight to CMake itself::\n\n  rcmake build_dir -F=-DWHATEVER=123\n\nThe config file\n***************\n\nYou can customize the default compiler suite and the different suites themselves\nvia the config file, ``~/.rcmake.yml``. By default, it looks like this:\n\n.. code-block:: yaml\n\n  # This is the default rcmake config file.\n\n  defaults:\n    suite: clang\n    generator: ninja\n    linker: gold\n\n    # Default C/C++/linker/CMake flags would go here:\n    # cflags:\n      # - \"-std=c99\"\n    # cxxflags:\n    #   - \"-std=c++11\"\n    # lflags:\n    #   - \"-rpath .\"\n    # cmakeflags:\n    #   - \"-DFOO=BAR\"\n\n  suites:\n    clang:\n      c: clang\n      cxx: clang++\n      flavor: clang\n    gcc:\n      c: gcc\n      cxx: g++\n      flavor: gcc\n    zapcc:\n      c: zapcc\n      cxx: zapcc++\n      flavor: clang\n\nIf you want to change the default suite, just change the *defaults* section\nlike this:\n\n.. code-block:: yaml\n\n  defaults:\n    suite: gcc\n    # ...\n\nThe same goes changing the default generator and linker: just change their\nvalue inside the *defaults* section.\n\nYou can add custom suites, too. For instance, if you find yourself often\ncross-compiling for Windows, you could add a suite like this:\n\n.. code-block:: yaml\n\n  suites:\n    mingw:\n      c: i686-w64-mingw32-gcc\n      cxx: i686-w64-mingw32-g++\n      flavor: gcc\n    # ...\n\nCommand-line usage\n******************\n\n::\n\n  Usage:\n    /usr/local/bin/rcmake [flags...] \u003cdir\u003e [arg...]\n\n  rcmake is a wrapper over CMake designed to avoid having to constantly repeat\n  the same command-line arguments.\n\n  Flags:\n    --cflag, -C (default: [])                           # Pass the given flag to the C compiler\n    --cmake, -x (default: cmake)                        # The cmake executable to use\n    --cmakeflag, -F (default: [])                       # Pass the given flag to CMake\n    --config, -f (default: ~/.rcmake.yml)               # The config file to use\n    --cxxflag, -X (default: [])                         # Pass the given flag to the C++ compiler\n    --gen, -g (default: Ninja)                          # The generator to use (choices: make, ninja)\n    --help, -h (default: false)                         # Displays help for the current command.\n    --lflag, -L (default: [])                           # Pass the given flag to the linker\n    --linker, -l (default: Gold)                        # The linker to use (choices: bfd, gold, lld)\n    --source, -s (default: /home/ryan/rcmake.cr/build)  # The source directory\n    --suite, -c                                         # The compiler suite to use\n    --type, -t (default: Debug)                         # The build type (choices: debug, release, relwithdebinfo, minsizerel)\n    --version (default: false)\n\n  Arguments:\n    dir (required)                                      # The build directory to run CMake inside of\n\nContributors\n************\n\n- `kirbyfan64 \u003chttps://github.com/kirbyfan64\u003e`_ Ryan Gonzalez - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Frcmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefi64%2Frcmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Frcmake/lists"}