Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Solved: Can't get CMake to find config files  (Read 3442 times)

0 Members and 1 Guest are viewing this topic.

monjamp

  • Newbie
  • *
  • Posts: 1
    • View Profile
Solved: Can't get CMake to find config files
« on: February 03, 2020, 09:04:02 am »
I am struggling to get CMake to work with SFML on Windows for my personal project or on any other SFML project that uses CMake. For reference I cloned this repo: https://github.com/ifexception/sfml-modern-cmake-example

Upon running `cmake -G "Visual Studio 16 2019" ..` I get the following error:
Quote
CMake Error at CMakeLists.txt:4 (find_package):
  Could not find a configuration file for package "SFML" that is compatible
  with requested version "2.5".

  The following configuration files were considered but not accepted:

    C:/MinGW/lib/cmake/SFML/SFMLConfig.cmake, version: 2.5.1 (32bit)
    C:/SFML-2.5.1/lib/cmake/SFML/SFMLConfig.cmake, version: 2.5.1 (32bit)

SFML is installed in the directory `C:/SFML-2-5.1`. It should be using the file `SFMLConfig.cmake` within that directory to find the SFML libraries but CMake keeps rejecting it.

Solved! Turns out with the generator for Visual Studio 19 is 64bit by default. Using the 32bit generator allows CMake to use the config file.
« Last Edit: February 03, 2020, 09:39:17 am by monjamp »

 

anything