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

Issues with specific packages #275

Open
cfabrito opened this issue Jul 4, 2021 · 4 comments
Open

Issues with specific packages #275

cfabrito opened this issue Jul 4, 2021 · 4 comments

Comments

@cfabrito
Copy link

cfabrito commented Jul 4, 2021

Hello! I've been using cpm to manage packages for my project and I adore the concept! Unfortunately I use some libraries with somewhat quirky CMake behaviors that CPM doesn't seem to like.
gl3w - Has an OUTPUT custom command to execute a python script which builds a *.c file. This seems to only happen when building so add_executable complains that the file doesn't exist at configuration time.
globjects & glbinding - This pair of libraries define targets with the same name, leading to a fatal CMake error. ☹️
Are there any possible workarounds?

Thanks

@TheLartians
Copy link
Member

Hey @cfabrito, thanks for using CPM.cmake!

Unfortunately, if a library's CMakeLists isn't designed for being used as a subdirectory by other CMake projects, there is a chance that there will be conflicts. In those cases I don't think there is much we can do except for fixing or re-writing the dependency's CMakeLists to support inclusion as a subdirectory. For now, you could create issues in the according repos explaining the error to make the library authors aware of the use-case.

@cfabrito
Copy link
Author

cfabrito commented Jul 5, 2021

Ok, thanks, sounds like a plan! 😄
I don't really know what I'm talking about, but maybe there could be some sort of patching support in CPM that had some way of modifying targets in dependencies? I can't imagine that'd be easy to implement though...
All the best!

@cfabrito
Copy link
Author

cfabrito commented Jul 5, 2021

Done!

@TheLartians
Copy link
Member

I don't really know what I'm talking about, but maybe there could be some sort of patching support in CPM that had some way of modifying targets in dependencies?

Yeah I agree that something like that would be great, however it's highly nontrivial as there are an infinite number of ways to structure a CMake project. Imo best we can currently do is to preach good project conventions that work well either installed or as a subdirectory.

flaviut added a commit to flaviut/fpm that referenced this issue Oct 22, 2022
flaviut added a commit to flaviut/fpm that referenced this issue Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants