find_package error: The following configuration files were considered but not accepted - what does it mean?

I’m trying to build some open source libs on Windows using cmake-gui and running into several cmake errors where find_package does find a {package}-config.cmake file, but fails to accept it! I’m at a loss what to do now. Here’s an example of the error message:

CMake Error at CMakeLists.txt:44 (find_package):
Could not find a configuration file for package “freetype” that is
compatible with requested version “”.

The following configuration files were considered but not accepted:

D:/OpenCascade/3rdparty/freetype2/lib/cmake/freetype/freetype-config.cmake, version: 2.11.1 (64bit)

The problem is that I have no idea why this file is not accepted, and therefore I’m stuck. How can I proceed? How can I resolve this error?

I suspect that your freetype is 64bit (as indicated), but you missed selecting 64bit as the target for your build trying to use it. There is also the --debug-find flag (from the command line; I don’t know if the GUI has a way to use that flag) that can help get more information.

Thanks for the hint. I checked some things to make sure that everything is set to x64, but then I noticed that the emscripten target is set to x86! Some more googling indicated that there appears to be no 64 bit compiler for emscripten (web assembly). That means I’ll have to rebuild everything for x86… :frowning:

Now I’m wondering how to set the build target to x86: cmake-gui does not show any build target, so I assume the default is x64. I guess I’ll find out eventually, but if someone reads this within the next half hour I would appreciate a tip.

There’s a “toolset”, “toolchain”, or “architecture” selector in the GUI IIRC.