CPM.cmake icon indicating copy to clipboard operation
CPM.cmake copied to clipboard

Adding packages with conflicting args

Open kelbon opened this issue 5 months ago • 2 comments

I encountered problem: when one dependency defines 'Boost' as a dependency with some required components, and later a second library downloads a package with same dependency name 'Boost', but with different required components, the second download is ignored, but the required libraries (despite the fact that they are REQUIRED) are not there.

Is there or is there a plan to solve such problems? For example, optionally make an error second CPMAddPackage if its arguments differ from previous one, so user can manually make a package with the sum of the required components BEFORE all dependencies?

kelbon avatar Jul 09 '25 06:07 kelbon

No plans yet to reconcile such clashes (no ideas too, AFAIK).

The workaround is to add boost before those packages with the union of libraries that's actually needed.

There is a warning for clashing versions. Maybe we could add a warning for clashing args... or at least select args.

iboB avatar Jul 09 '25 16:07 iboB

I think some warning for conflicting options would be awesome.

josephbirkner avatar Sep 11 '25 06:09 josephbirkner