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

Author Topic: How to include SFML for building SFGUI in cmake?  (Read 2460 times)

0 Members and 1 Guest are viewing this topic.

Me-Myself-And-I

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
How to include SFML for building SFGUI in cmake?
« on: August 11, 2024, 04:41:20 am »
I'm trying to build SFGUI using cmake but it gives me an error that it couldn't find SFMLConfig.cmake and sfml-config.cmake. I'm sure this is just some simple noob mistake so could someone please point out to me how to properly include SFML for this? Thankyou

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10991
    • View Profile
    • development blog
    • Email
Re: How to include SFML for building SFGUI in cmake?
« Reply #1 on: August 12, 2024, 08:52:08 am »
You'll have to either set SFML_DIR to where the SFMLConfig.cmake is (usually located in lib/cmake/SFML or point SFML_ROOT to the root directory of SFML.

This assumes that SFML has been built already.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Me-Myself-And-I

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: How to include SFML for building SFGUI in cmake?
« Reply #2 on: August 17, 2024, 05:03:52 pm »
Sorry for taking so long to reply. Is the SFML source code required or can this be done with a binary? Looking in the binary lib folder I can't find any .cmake file or a cmake folder or a SFML folder in that directory.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10991
    • View Profile
    • development blog
    • Email
Re: How to include SFML for building SFGUI in cmake?
« Reply #3 on: August 20, 2024, 11:09:11 pm »
It's meant to be used with pre-built binaries and CMake config files.

Best you build the INSTALL target for SFML, which will copy all the necessary file to whatever you've set as CMAKE_INSTALL_PREFIX.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/