3

So I am attempting to build a cmake projects that others have been able to build successfully. The main issue is that I always end up with the classic cmake configuration error when doing a find_package():

could not find configuration for package "PKGNAME" that is compatible with requested version "x.x.x"

The following configuration files were considered but not accepted:
    Path\To\Correct\Config.cmake, version x.x.x

Now that cmake it "Considers" is the correct file that it should be using, even the versions are the same. Yet it always fails with this error even after that standard reinstall, restart, clean rebuild, literally using the same files that worked on another computer routine.

So what Im trying to find out really, is there a way to find out why it wasnt accepted specifically? Any cmake debugging that I could try out here?

This is happening on a Windows 10 machine and the cmake Im looking for is located directly on the C:\ drive if that has any bearing. Also as a point, it builds fine if I remove the specific version check in the find_package(), but I cant really be running it like that.

  • According to the [CMake source code](https://gitlab.kitware.com/cmake/cmake/blob/master/Source/cmFindPackageCommand.cxx#L819) this message only appears for incompatible versions. Why not posting the real output of CMake? That could help to answer your question. – Stanley F. Feb 13 '19 at 06:10
  • Well first it would be posting proprietary info which I cant do, but the error is exactly this, the only difference is the package name and the x's are 1.5.3 But it shows the same version for both the requested and the file that wasn't accepted. But this is the entire output I get beyond the line numbers showing where find_package is before the build fails. – Justin Dobson Feb 13 '19 at 06:17
  • Are you trying to build a `Debug` configuration of your software and the package config only provides something for `Release` configuration? – vre Feb 13 '19 at 10:24
  • Ive attempted both a debug and release. they result in the same error – Justin Dobson Feb 13 '19 at 16:50

1 Answers1

0

You may want to specify a cmake generator, with e.g.

cmake -G "NMake Makefiles"

Unfortunately, the cmake error messages is not very informative in that case.

Quant
  • 1,593
  • 14
  • 21