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

Author Topic: SFML_DIR not found (SFML2)  (Read 9805 times)

0 Members and 1 Guest are viewing this topic.

RobotGymnast

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
SFML_DIR not found (SFML2)
« on: March 07, 2011, 02:07:43 am »
I've built the main SFML project as static libraries (but didn't move them to any special directories), then tried configuring the CSFML project in CMake. It tells me SFML_DIR isn't found; I tried manually setting it to the build output directory of the SFML project, as well as the lib subfolder, but clicking Configure again simply caused it to give the same error message and overwrite my changes.

Can somebody help?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML_DIR not found (SFML2)
« Reply #1 on: March 07, 2011, 07:28:31 am »
Can you please show us the exact error message?
Laurent Gomila - SFML developer

RobotGymnast

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
SFML_DIR not found (SFML2)
« Reply #2 on: March 07, 2011, 01:03:45 pm »
Code: [Select]
CMake Error at src/SFML/CMakeLists.txt:22 (find_package):
  Could not find module FindSFML.cmake or a configuration file for package
  SFML.

  Adjust CMAKE_MODULE_PATH to find FindSFML.cmake or set SFML_DIR to the
  directory containing a CMake configuration file for SFML.  The file will
  have one of the following names:

    SFMLConfig.cmake
    sfml-config.cmake



CMake Warning (dev) at cmake/Macros.cmake:87 (target_link_libraries):
  Link library type specifier "optimized" is followed by specifier "debug"
  instead of a library name.  The first specifier will be ignored.
Call Stack (most recent call first):
  src/SFML/System/CMakeLists.txt:24 (csfml_add_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at cmake/Macros.cmake:87 (target_link_libraries):
  The "debug" argument must be followed by a library.
Call Stack (most recent call first):
  src/SFML/System/CMakeLists.txt:24 (csfml_add_library)


Do I have to set path variables (sfml_inlcude and sfml_lib)? Is there no way to just set the variables inside CMake?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML_DIR not found (SFML2)
« Reply #3 on: March 07, 2011, 01:11:54 pm »
I don't like this CMake error message, I find it confusing for users who are not used to packages errors.

In fact you can ignore the hint given by CMake, this "configuration file" thing is never used, you must instead look at the comments in FindSFML.cmake to know what to do.

Quote from: "FindSFML.cmake"
# If SFML is not installed in a standard path, you can use the SFMLDIR CMake variable
# to tell CMake where SFML is.


And make sure that FindSFML.cmake is installed into your CMake directory (this is done automatically if you installed SFML).
Laurent Gomila - SFML developer

RobotGymnast

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
SFML_DIR not found (SFML2)
« Reply #4 on: March 08, 2011, 02:41:20 am »
How does one "install" SFML? I'm running on Ubuntu, and the project generated only seems to build the libraries.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML_DIR not found (SFML2)
« Reply #5 on: March 08, 2011, 07:27:21 am »
Quote
make install


By the way, everything that you need to know is explained in the tutorial.
Laurent Gomila - SFML developer

RobotGymnast

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
SFML_DIR not found (SFML2)
« Reply #6 on: March 08, 2011, 12:57:39 pm »
Oh geez, apparently it's been way too long since I was on linux.

Oh, yes, I see it now, right at the bottom. I missed it before. Sorry, and thanks!

TheMagicNumber

  • Jr. Member
  • **
  • Posts: 64
    • View Profile
SFML_DIR not found (SFML2)
« Reply #7 on: April 27, 2011, 11:41:38 pm »
Quote from: "Laurent"
I don't like this CMake error message, I find it confusing for users who are not used to packages errors.

In fact you can ignore the hint given by CMake, this "configuration file" thing is never used, you must instead look at the comments in FindSFML.cmake to know what to do.

Quote from: "FindSFML.cmake"
# If SFML is not installed in a standard path, you can use the SFMLDIR CMake variable
# to tell CMake where SFML is.


And make sure that FindSFML.cmake is installed into your CMake directory (this is done automatically if you installed SFML).

What are you supposed to do? Add an entry (tried it, didn't work)? This is seriously pissing me off, I hate CMake.

http://i.imgur.com/lHF9R.png
http://i.imgur.com/svf3H.png

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML_DIR not found (SFML2)
« Reply #8 on: April 28, 2011, 07:43:40 am »
Your SFMLDIR variable is ok, what's wrong is that you didn't install FindSFML.cmake. It must be copied to <cmake_install>\share\cmake-2.8\Modules (on Windows).
Laurent Gomila - SFML developer

 

anything