{"id":16576197,"url":"https://github.com/emersonmello/libsaudacaocpp","last_synced_at":"2026-04-19T00:33:29.393Z","repository":{"id":70867740,"uuid":"511328478","full_name":"emersonmello/libsaudacaocpp","owner":"emersonmello","description":"Exemplo de uma biblioteca C / C++ com More Modern CMake","archived":false,"fork":false,"pushed_at":"2022-07-07T01:00:54.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-05T18:38:20.568Z","etag":null,"topics":["c","cmake","cplusplus","cpp","library","modern-cmake-template"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emersonmello.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-07T00:06:12.000Z","updated_at":"2022-07-07T11:10:30.000Z","dependencies_parsed_at":"2023-03-21T01:02:53.001Z","dependency_job_id":null,"html_url":"https://github.com/emersonmello/libsaudacaocpp","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"bcdd93c89b1c5f852475ad38e857913fc5a72592"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/emersonmello/libsaudacaocpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersonmello%2Flibsaudacaocpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersonmello%2Flibsaudacaocpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersonmello%2Flibsaudacaocpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersonmello%2Flibsaudacaocpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emersonmello","download_url":"https://codeload.github.com/emersonmello/libsaudacaocpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersonmello%2Flibsaudacaocpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31989852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"ssl_error","status_checked_at":"2026-04-18T20:23:29.375Z","response_time":103,"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":["c","cmake","cplusplus","cpp","library","modern-cmake-template"],"created_at":"2024-10-11T22:07:30.193Z","updated_at":"2026-04-19T00:33:29.367Z","avatar_url":"https://github.com/emersonmello.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exemplo de uma biblioteca C++ com CMake \n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![ubuntu, macOS, windows build](https://github.com/emersonmello/libsaudacaocpp/actions/workflows/cmake.yaml/badge.svg)](https://github.com/emersonmello/libsaudacaocpp/actions/workflows/cmake.yaml)\n\n\nNeste repositório tem-se um pequeno exemplo sobre como organizar o projeto de uma biblioteca C++ usando o CMake.\n\n## Ferramentas necessárias para compilação\n\n- [Git](https://git-scm.com/downloads)\n- [CMake](https://cmake.org) 3.14 ou superior\n- Compilador C++11 (i.e. g++)\n\n## Como gerar o sistema de construção (i.e. *Makefile*)\n\nBaixe o código presente neste repositório:\n```bash\ngit clone https://github.com/emersonmello/libsaudacaocpp.git\ncd libsaudacaocpp\n\ncmake -S . -B build\n``` \n\n## Como compilar a biblioteca e a aplicação exemplo\n\nPara construir o projeto:\n```bash\ncmake --build build\n```\nSerão gerados os seguintes arquivos:\n\n- **Biblioteca estática** (*archive*)\n    - `build/src/libsaudacao.a`\n- **Aplicação demo**\n    - `build/exemplo/demo`\n\n## Para instalar a biblioteca compilada e headers\n\nCaso queira instalar a biblioteca compilada e os arquivos de cabeçalho, faça:\n\n```bash\ncmake --install build --strip --config Release\n```\n\n## Para fazer uso desta biblioteca em outros projetos \n\nSe está escrevendo um projeto com [CMake](https://cmake.org/cmake/help/latest/index.html), é possível baixar e usar esta biblioteca por meio do [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html). Inclua as linhas abaixo dentro do arquivo `CMakeLists.txt` de seu projeto:\n\n```cmake\ninclude(FetchContent)\n\nFetchContent_Declare(saudacaocpp\n    GIT_REPOSITORY https://github.com/emersonmello/libsaudacaocpp.git\n    GIT_TAG 0.1.0\n)\n\nFetchContent_MakeAvailable(saudacaocpp)\n\n# considerando que appexemplo é o nome do alvo (target)\ntarget_link_libraries(appexemplo PRIVATE saudacaocpp)\n```\n\nAbaixo um exemplo completo do arquivo `CMakeLists.txt` para uma aplicação que faz uso desta biblioteca.\n\n```cmake\ncmake_minimum_required(VERSION 3.14)\nproject(appexemplo VERSION 0.1.0)\n\nadd_executable(appexemplo main.cpp)\ntarget_compile_features(appexemplo PRIVATE cxx_std_17)\n\ninclude(FetchContent)\nFetchContent_Declare(saudacaocpp\n    GIT_REPOSITORY https://github.com/emersonmello/libsaudacaocpp.git\n    GIT_TAG 0.1.0\n)\nFetchContent_MakeAvailable(saudacaocpp)\n\ntarget_link_libraries(appexemplo PRIVATE saudacaocpp)\n```\n\nE abaixo o código do arquivo `main.cpp`:\n\n```cpp\n#include \u003csaudacao/saudacao.hh\u003e\n#include \u003ciostream\u003e\n\nint main(int argc, char const **argv) {\n\n    std::string msg = \"mundo\";\n    if (argc == 2){\n        msg = argv[1];\n    }\n\n    saudacao::Saudacao teste(msg);\n\n    teste.ola_mundo();\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femersonmello%2Flibsaudacaocpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femersonmello%2Flibsaudacaocpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femersonmello%2Flibsaudacaocpp/lists"}