{"id":15566717,"url":"https://github.com/tanner-davison/cmake_commands_notes","last_synced_at":"2026-01-08T11:05:03.510Z","repository":{"id":255113853,"uuid":"848582768","full_name":"Tanner-Davison/cmake_commands_notes","owner":"Tanner-Davison","description":"a markdown file with cmake commands I can reference","archived":false,"fork":false,"pushed_at":"2024-08-28T03:24:50.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T14:50:06.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/Tanner-Davison.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-08-28T02:59:48.000Z","updated_at":"2024-12-27T10:23:21.000Z","dependencies_parsed_at":"2024-08-28T04:21:18.771Z","dependency_job_id":"4d431fdb-77df-4489-b2a3-4443f7ce91d9","html_url":"https://github.com/Tanner-Davison/cmake_commands_notes","commit_stats":null,"previous_names":["tanner-davison/cmake_commands_notes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanner-Davison%2Fcmake_commands_notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanner-Davison%2Fcmake_commands_notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanner-Davison%2Fcmake_commands_notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanner-Davison%2Fcmake_commands_notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tanner-Davison","download_url":"https://codeload.github.com/Tanner-Davison/cmake_commands_notes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140590,"owners_count":20729802,"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-10-02T17:05:42.981Z","updated_at":"2026-01-08T11:05:03.478Z","avatar_url":"https://github.com/Tanner-Davison.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"![Static Badge](https://img.shields.io/badge/Contact-tanner.davison95%40gmail.com-highcontrast%2F)\n\n\n\n# 📚 CMake Command Reference\n\nA comprehensive reference for essential CMake commands to assist in configuring, building, and managing your C++ projects.\n\nCreated by: Tanner Davison\n\n# 🛠️ Basic CMake Commands\n\n### 🔧 Configure the Project\n```bash\ncmake -S . -B build\n# -S .: Specifies the source directory (where CMakeLists.txt is located).\n# -B build: Specifies the build directory where CMake will generate build files.\n```\n### 🏗️ Build the Project\n```bash\ncmake --build build\n# Compiles and builds your project using the build system generated by CMake.\n```\n### 🧹 Clean the Build\n```bash\nrm -rf build\n# Manually deletes the build directory, allowing you to start fresh.\n```\n### ⚙️ CMake Configuration Options\n🛠️ Set Build Type (Debug/Release)\n```bash\ncmake -S . -B build -DCMAKE_BUILD_TYPE=Release\n# CMAKE_BUILD_TYPE can be set to Debug, Release, RelWithDebInfo, or MinSizeRel.\n```\n### 🧰 Set a Custom Compiler\n```bash\ncmake -S . -B build -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++\n# Allows you to specify a custom compiler for C and C++.\n```\n### 📂 Specify Installation Directory\n```bash\ncmake -S . -B build -DCMAKE_INSTALL_PREFIX=/path/to/install\n# Sets the directory where the project will be installed.\n```\n # 🧪 Testing and Packaging\n### 🧪 Run Tests (if configured)\n```bash\nctest\n# Runs tests defined in your project.\n```\n### 📦 Create a Package\n```bash\ncpack\n# Packages your project according to the configuration specified in CMakeLists.txt.\n```\n# 🚀 Advanced Commands\n### 🛠️ Generate Compilation Database (for IDEs like VSCode)\n```bash\ncmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON\n# Generates a compile_commands.json file in the build directory, useful for IDEs that support it.\n```\n### 🎛️ Use Presets (CMake 3.19+)\n```bash\ncmake --preset debug\n# Presets allow predefined configurations (e.g., debug, release) in a CMakePresets.json file.\n```\n### 📂 Install the Project\n```bash\ncmake --install build\n# Installs the project to the directory specified by CMAKE_INSTALL_PREFIX.\n```\n# 🧐 Diagnostic Commands\n### 📋 Show Available CMake Variables\n```bash\ncmake -LAH\n# Displays all available CMake cache variables, useful for debugging or configuring the project.\n```\n### 📝 Check CMake Version\n```bash\ncmake --version\n# Displays the installed version of CMake.\n```\n### ❓ Display Help\n```bash\ncmake --help\n# Shows a help message with commonly used commands and options.\n```\n# 🖥️ Interactive Use\n### 🖼️ CMake GUI\n```bash\ncmake-gui\n# Launches a graphical user interface for configuring CMake projects interactively.\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanner-davison%2Fcmake_commands_notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanner-davison%2Fcmake_commands_notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanner-davison%2Fcmake_commands_notes/lists"}