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

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

0 Members and 1 Guest are viewing this topic.

Kvaz1r

  • Newbie
  • *
  • Posts: 39
    • 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: 10504
    • 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
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kvaz1r

  • Newbie
  • *
  • Posts: 39
    • 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.