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

Author Topic: CMAKE failure  (Read 14137 times)

0 Members and 1 Guest are viewing this topic.

c-jay

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
CMAKE failure
« on: August 09, 2016, 09:49:31 pm »
Hi,

i'd like to generate build files with cmake. It generates this failure:

CMake Error at src/SFML/CMakeLists.txt:28 (find_package):
  By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SFML", but
  CMake did not find one.

  Could not find a package configuration file provided by "SFML" (requested
  version 2) with any of the following names:

    SFMLConfig.cmake
    sfml-config.cmake

  Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
  "SFML_DIR" to a directory containing one of the above files.  If "SFML"
  provides a separate development package or SDK, be sure it has been
  installed.

I don't understand the reported solutions:
1) Where is the CMAKE_MODULE_PATH to put the "FindSFML.cmake" into?
2) How could i add the installation prefix of "SFML" to CMAKE_PREFIX_PATH?
3) Where are the directory of the files SFMLConfig.cmake and sfml-config.cmake?

I am very thankful for every solution.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10930
    • View Profile
    • development blog
    • Email
AW: CMAKE failure
« Reply #1 on: August 09, 2016, 09:55:00 pm »
The problem is that CMake can't find the FindSFML.cmake. CMake searches the directory set by CMAKE_MODULE_PREFIX, which by default is empty. For your CMake script you can set it to the directory where the FindSFML.cmake is located or you can let the user define it when using SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

c-jay

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: CMAKE failure
« Reply #2 on: August 09, 2016, 10:00:14 pm »
thank you for your reply.
I'm the user ;-)
1)How could i figure out which directory is set by CMAKE_MODULE_PREFIX ?
2)How could i set it to the right directory?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10930
    • View Profile
    • development blog
    • Email
AW: CMAKE failure
« Reply #3 on: August 09, 2016, 10:21:28 pm »
Sorry, I made a mistake it's of course CMAKE_MODULE_PATH not prefix.
You can.just use the set function in your CMake script.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

c-jay

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: CMAKE failure
« Reply #4 on: August 10, 2016, 06:24:13 pm »
Thank you.

I don't know very much about cmake files. Do you have a snipped of code which i have to paste in the skript?

c-jay

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Re: CMAKE failure
« Reply #5 on: August 10, 2016, 06:48:21 pm »
I found the solution.

1) Copy FindSFML.cmake from SFML-Master/cmake/ to CSFML-Master/
2) add
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/" ${CMAKE_MODULE_PATH})
to CSFML-Master/src/SFML/CMakeLists.txt

My next question: Why isn't this write down in the csfml-documentation for ubuntu-beginner like me?


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: CMAKE failure
« Reply #6 on: August 10, 2016, 07:26:04 pm »
Quote
Why isn't this write down in the csfml-documentation for ubuntu-beginner like me?
I agree, but the thing is that there's no tutorial for CSFML. The only available documentation is the API doc auto-generated from source code.
Laurent Gomila - SFML developer

 

anything