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

Author Topic: CMAKE error missing dependencies of SFML  (Read 274 times)

0 Members and 1 Guest are viewing this topic.

Kvaz1r

  • Newbie
  • *
  • Posts: 31
    • View Profile
    • Email
CMAKE error missing dependencies of SFML
« on: October 14, 2020, 04:01:27 pm »
I want to use SFML with CMAKE but get error:

Quote
CMake Error at /SFML-2.5.1/build/SFMLConfig.cmake:139 (message):
  SFML found but some of its dependencies are missing ( FreeType OpenAL
  VorbisFile VorbisEnc Vorbis Ogg FLAC)
Call Stack (most recent call first):
  CMakeLists.txt:11 (find_package)


CMake Error at CMakeLists.txt:11 (find_package):
  Found package configuration file:

    /SFML-2.5.1/build/SFMLConfig.cmake

  but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT
  FOUND.


Configuring incomplete, errors occurred!

CMake file:

cmake_minimum_required(VERSION 3.1)

project(SFMLTest)

## If you want to link SFML statically
set(SFML_STATIC_LIBRARIES TRUE)

## In most cases better set in the CMake cache
set(SFML_DIR "SFML-2.5.1\\build")

find_package(SFML 2.5.1 COMPONENTS graphics audio REQUIRED)
add_executable(SFMLTest appl.cpp)
target_link_libraries(SFMLTest sfml-graphics)

I use static SFML 2.5.1 that built myself with CMAKE.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9720
    • View Profile
    • development blog
    • Email
Re: CMAKE error missing dependencies of SFML
« Reply #1 on: October 14, 2020, 06:12:07 pm »
Looks like you don't have static libraries built.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Kvaz1r

  • Newbie
  • *
  • Posts: 31
    • View Profile
    • Email
Re: CMAKE error missing dependencies of SFML
« Reply #2 on: October 14, 2020, 06:35:36 pm »
If I define paths manually:
Quote
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "SFML-2.5.1\\extlibs\\headers")   
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "SFML-2.5.1\\extlibs\\libs-msvc\\x86")   
CMAKE generate project files.

 

anything