Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using as CMake dependency #122

Open
CorvetteCole opened this issue Sep 27, 2022 · 7 comments
Open

Support using as CMake dependency #122

CorvetteCole opened this issue Sep 27, 2022 · 7 comments

Comments

@CorvetteCole
Copy link

CorvetteCole commented Sep 27, 2022

Another project that recently implemented this in a PR can be seen here: tplgy/cppcodec#76.

Basically, allows massively simplified project configuration. The end goal for me is that I can do something like the following in my CMakeLists.txt:

# fetch dbcppp
FetchContent_Declare(
        libdbcppp
        GIT_REPOSITORY https://github.com/xR3b0rn/dbcppp
        GIT_TAG 54ce78ad53442db94e03d16a4fd5f3b339dab193
)
FetchContent_MakeAvailable(libdbcppp)

Another project that supports this is argparse (https://github.com/p-ranav/argparse#cmake-integration).

This did not work when I tested this with your project, I tried to get it working but ran out of time and the CMake files are quite complex. Please let me know what you think about this

@CorvetteCole
Copy link
Author

The above code snippet works fine in CMake, but I can not import or access the library in my code

@CorvetteCole
Copy link
Author

I also think this could be somehow related to #96 . After seeing that, I figured it would work but unfortunately not

@Nomalah
Copy link

Nomalah commented Oct 28, 2022

Been trying to get Conan working with this library:
conan-io/conan-center-index#13826
I do have a patch file that allows it to work with the Conan packaging system, but get access violations when building as a dll.
I can see about porting over some of the functionality.

@CorvetteCole
Copy link
Author

it would be great if you managed to get the above CMake code snippet I provided above working. Would be very thankful!

@Nomalah
Copy link

Nomalah commented Oct 29, 2022

Do you have a public project I could test with?

@CorvetteCole
Copy link
Author

Do you have a public project I could test with?

@Nomalah I know this is a lot late, but here: https://github.com/CorvetteCole/dbcppp-cmake

It seems to pull it in as I'd expect, but can't find the actual import when compiling. Can not figure it out. If you comment out the dbcppp import in main.cpp it will compile properly. Would really appreciate it if you figured that out!!

@CorvetteCole
Copy link
Author

I also included argparse as an example imported in the same way (except it works)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants