Git Product home page Git Product logo

katusk / cmakenugettools Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 5.0 148 KB

CMake functions for adding NuGet package dependencies with CMake exports or native .targets files, generating and merging .nuspec files, calling nuget pack, and more. WIP.

License: MIT License

CMake 81.97% C 5.62% C++ 11.28% PowerShell 1.13%
cmake nuget git package-version cmake-functions cmake-exports cross-platform native package-management nuget-package

cmakenugettools's People

Contributors

katusk avatar mcsmit avatar wjspoel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cmakenugettools's Issues

How do I know the Target name?

Here is your example

# Call this once before any other nuget_* calls.
nuget_initialize()

# NuGet install icu and flatbuffers packages, and import their CMake export files.
nuget_add_dependencies(
    PACKAGE flatbuffers.x64-windows.vcpkg-export VERSION 1.11.0-1 CMAKE_PREFIX_PATHS installed/x64-windows
    PACKAGE icu.x64-windows.vcpkg-export PUBLIC VERSION 65.1.0-2 CMAKE_PREFIX_PATHS installed/x64-windows
)

# After the above nuget_add_dependencies(), you can:
find_package(ICU REQUIRED COMPONENTS data uc io)
find_package(Flatbuffers CONFIG REQUIRED)
)

I know flatbuffers.x64-windows.vcpkg-export is the nuget package name, but why target name is Flatbuffers?

To me, I want add the onnxruntime-gpu as a dependency to my project

nuget_initialize()
file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/installed/${HOST_PLATFORM}")
nuget_add_dependencies(
    PACKAGE Microsoft.ML.OnnxRuntime.Gpu VERSION 1.17.1 CMAKE_PREFIX_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/installed/${HOST_PLATFORM}"
)

find_package(Microsoft.ML.OnnxRuntime.Gpu CONFIG REQUIRED)

So what target should I use? And what does CMAKE_PREFIX_PATHS do? I remove this and it reports an error and the folder it specifies must exist. Right now I specify a folder that does exist "${CMAKE_CURRENT_SOURCE_DIR}/installed/${HOST_PLATFORM}", but after configuring the project I see that the folder is empty!

If NUGET_EXCLUDE_VERSION=FALSE and VERSION of a PACKAGE entry in nuget_add_dependencies() changed, then find_package() does not respect the package directory change

If NUGET_EXCLUDE_VERSION=FALSE and VERSION of a PACKAGE entry in nuget_add_dependencies() changed, then find_package() does not respect the package directory change.

E.g. if flatbuffers comes from a "pack.vcpkg" NuGet package that you refer in a nuget_add_dependencies() call with version number 1.0.10, and you change this version to 1.0.11, you are going to get errors if your CMake cache has been already generated: the find_package(Flatbuffers CONFIG REQUIRED) call caches directory locations, and if that directory path contains a version number, then it is going to become invalid. E.g. inside the CMakeCache file, under EXTERNAL cache entries, you might have:

Flatbuffers_DIR:PATH=C:/workspace/mylittleproject/packages/pack.vcpkg.1.0.10/installed/x64-windows/share/flatbuffers

This one becomes an invalid directory if you change the version to 1.0.11. All of the above is not a problem if you leave the NUGET_EXCLUDE_VERSION option to its default TRUE value as the nuget CLI does not add the version number to the directory name of the package during a nuget install if the -ExcludeVersion option is provided.

No license specified?

Hi there!

I was wondering what the intended license for this project is. I see no mention of any license in the readme or in any files in the repository. I'd like to use it, but I can't without an explicit license.

Thanks in advance!

Cheers,

Tom

CMAKE_* arguments of nuget_generate_nuspec_files() are not optional

CMAKE_* arguments of nuget_generate_nuspec_files() are not optional. Either CMAKE_OUTPUT_DIR or CMAKE_CONFIGURATIONS needs to be provided, otherwise you get parsing errors. This was not the intention, both arguments should be optional.

Notes to self: use a cleaner approach with hierarchical cmake_parse_arguments() parsing instead of "manual" parsing.

How to install

Hi,

Your project seems exactly what we need at first glance!

Could you provide some information as to how to install your package such that cmake can find it? Can I put it in my project repository and point cmake with some setting to it or do I need to place it at some specific location?

It will need to work for Windows, Linux and Mac.

Thanks!

Dieter

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.