GithubHelp home page GithubHelp logo

skywalkerytx / package.cmake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fancl20/package.cmake

0.0 1.0 0.0 52 KB

Yet Another Package Manager For CMake

License: Apache License 2.0

CMake 100.00%

package.cmake's Introduction

Use CMake as a package manager

Example

Use using to add a package into you project and use target_link_libraries to link (also add include directories) to you target.

cmake_minimum_required(VERSION 3.18)
project(project_name)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_subdirectory(package.cmake)

using(ninja VERSION 1.10.2)
using(absl VERSION 20211102.0)
using(re2 VERSION 2021-11-01)
using(zlib VERSION 1.2.11)
using(boringssl VERSION a9670a8b476470e6f874fef3554e8059683e1413)
using(cares VERSION 1_18_1)
using(protobuf VERSION 3.19.1)
using(grpc VERSION 1.41.1)
using(grpcgen 
    PROTO_PATH ${PROJECT_SOURCE_DIR}
    PROTO_FILES
        path/to/proto/file1.proto
        path/to/proto/file2.proto
)
find_package(Threads REQUIRED)

add_executable(main main.cpp)
target_compile_options(main PRIVATE
    -O2 -g -Wall -Wextra -Werror
)
target_link_libraries(main
    grpcgen
    grpc::grpc++_unsecure protobuf::protobuf boringssl cares zlib
    Threads::Threads
)

The above example add grpc and its dependencies. openssl include 2 libs (libssl.a and libcrypto.a). You can specify a lib in openssl by using openssl::ssl or openssl::crypto.

Add package to repo

See the previous packages.

  • With lib: lua
  • With multiple libs: openssl
  • Header only: sol
  • With dependent package: grpc (using the dependent packages before using grpc)

package.cmake's People

Contributors

fancl20 avatar skywalkerytx avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.