Code Monkey home page Code Monkey logo

Comments (13)

duncanmmacleod avatar duncanmmacleod commented on July 21, 2024 1

Or perhaps there's a simpler solution, namely that 'binary' package builders (conda, rpm, debian) should ignore the cmake configuration and use just

install -d ${PREFIX}/include/jwt-cpp
install -p include/jwt-cpp/*.h ${PREFIX}/incude/jwt-cpp/

or something like that.

from jwt-cpp.

prince-chrismc avatar prince-chrismc commented on July 21, 2024

This option is primarily for consumers who are using a C++ package manager like Conan which is capable to generating the cmake config for you. I believe vcpkg is capable of it as well 😄

Other wise you will need to provide your own "cmake wrapper" for picojson for the find_pacakge() to work correctly.

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

There are some system directories which cmake checks for packages. You could simply put a valid cmake configuration there. But really this is something picojson should deal with.
Do you really need to use an external picojson ?
That "build" is only required for the test suite, so just adding the include dir of jwt-cpp to your project should be enough, as it is header only.

from jwt-cpp.

duncanmmacleod avatar duncanmmacleod commented on July 21, 2024

I am investigating build a conda package for jwt-cpp, and I don't want to end up with a package that bundles picojson.h, which is what happens when I don't use the -DEXTERNAL_PICOJSON option.

Is there a way to build jwt-cpp without bundling picojson that doesn't require that option?

from jwt-cpp.

duncanmmacleod avatar duncanmmacleod commented on July 21, 2024

For the record, I understand (and agree) that picojson is responsible for providing the Findpicojson.cmake file that is required, but the out-of-the-box build for that project doesn't do that.

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

I have never used conda before, but does it normally include and build test cases ?
If not just exclude the picojson file and package only the jwt include directory.

from jwt-cpp.

duncanmmacleod avatar duncanmmacleod commented on July 21, 2024

@Thalhammer, conda (conda-build specifically in this case) is very similar to rpmbuild in how it works: you just specify a shell script that does the build and install and it executes it. It produces a tarball of pre-compiled files that users can install as a dependency of their project. Since jwt-cpp is just a header file, I presumed that cmake --target install would just install that one header file.

When I execute make install from the cmake build I get the following files installed into the prefix:

jwt-cpp/jwt-cpp-config.cmake
jwt-cpp/jwt-cpp-config-version.cmake
jwt-cpp/jwt-cpp.cmake
include/jwt-cpp/base.h
include/picojson/picojson.h
include/jwt-cpp/jwt.h

Why is picojson.h being installed, and how can I stop cmake installing it (short of patching)?

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

You cant, at the moment. However I would happyly accept a pullrequest that adds this feature.
If you want to add it note it here, otherwise I'll add it some time down this week once I come around to do so.

from jwt-cpp.

duncanmmacleod avatar duncanmmacleod commented on July 21, 2024

Since picojson.h isn't needed to actually build anything (since nothing in jwt-cpp is compiled) I don't see why a this package should require picojson to provide a cmake configuration. Can EXTERNAL_PICOJSON be used to just trust that the user has an external copy of picojson on their system (i.e. not execute find_package)?

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

@prince-chrismc What do you think ?
I have to admit that I dont really use the cmake feature, so I think your opinion might be better here.

from jwt-cpp.

prince-chrismc avatar prince-chrismc commented on July 21, 2024

Since picojson.h isn't needed to actually build anything (since nothing in jwt-cpp is compiled

currently jwt-cpp has a very hard requirement on picojson, you can not use this library without providing picojson. It will not compile downstream by anything that requires this project. It needs to be made available to jwt-cpp.

I am investigating build a conda package for jwt-cpp

conda support dependencies, so if you want to make a conda-build for jwt-cpp ( and do not want to bundle picojson; which would be the "right" way ) than you must provide a conda package for picojson as well. Again, hard requirement.

For the record, I understand (and agree) that picojson is responsible for providing the Findpicojson.cmake file that is required, but the out-of-the-box build for that project doesn't do that.

I would strongly encourage you to make a contribution to the picojson repository with that contribution ❤️ I personally looked into it but haven't the time to make it. I would be greatly appreciated!

Can EXTERNAL_PICOJSON be used to just trust that the user has an external copy of picojson on their system (i.e. not execute find_package)?

The reason it's an "external dependencies" is because some external method needs to be used to provide that library, CMake native method is find_package() which is why that method is used here.

And yes! you can tell cmake where to search. you may want to read this as it provides all the details... you pass the extra flags at configuration

If you contribute a conda build I would expect that it requires/consumes/depends on a picojson conda build as well.

Or perhaps there's a simpler solution, namely that 'binary' package builders (conda, rpm, debian) should ignore the cmake configuration and use just

install -d ${PREFIX}/include/jwt-cpp
install -p include/jwt-cpp/*.h ${PREFIX}/incude/jwt-cpp/

or something like that.

If you do this, conda needs to know where picojson is as well. as to come full circle it's a hard requirement

from jwt-cpp.

duncanmmacleod avatar duncanmmacleod commented on July 21, 2024

I understand all of the above, and yes, my plan is to create a conda package for jwt-cpp that depends upon a package for picojson. I will move forward with my trivial install commands for now, since I don't have the cycles right now to figure out the syntax for a cmake config file for picojson.

Thanks for the assistance.

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

@duncanmmacleod This should allow you to disable the install of picojson by setting the cmake option NO_INSTALL_PICOJSON to TRUE.

from jwt-cpp.

Related Issues (20)

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.