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

Author Topic: CSFML and cmake configuration problem  (Read 21595 times)

0 Members and 4 Guests are viewing this topic.

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
CSFML and cmake configuration problem
« on: November 18, 2010, 09:31:49 pm »
Hi!

I just saw, that sfml switched to cmake in the version 2 branch. That's great! I have a problem building CSFML, though: When trying to do the cmake configuration I get:

Code: [Select]
#:~/src/sfml2/bindings/c/build$ cmake ..
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SFML_AUDIO_LIBRARY_DEBUG
    linked by target "csfml-audio" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Audio
SFML_GRAPHICS_LIBRARY_DEBUG
    linked by target "csfml-graphics" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Graphics
SFML_NETWORK_LIBRARY_DEBUG
    linked by target "csfml-network" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Network
SFML_SYSTEM_LIBRARY_DEBUG
    linked by target "csfml-system" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/System
    linked by target "csfml-window" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Window
    linked by target "csfml-network" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Network
    linked by target "csfml-graphics" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Graphics
    linked by target "csfml-audio" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Audio
SFML_WINDOW_LIBRARY_DEBUG
    linked by target "csfml-window" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Window
    linked by target "csfml-graphics" in directory /home/shahn/src/sfml2/bindings/c/src/SFML/Graphics

-- Configuring incomplete, errors occurred!


It seems to work, when you installed both the release and the debug version of SFML. If you just want a release build, it fails like described.

Using Ubuntu 10.10, x86_64, branches/sfml2 revision 1671

(btw: is this the right place for questions like this? I didn't find an active bug tracker.)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CSFML and cmake configuration problem
« Reply #1 on: November 18, 2010, 09:36:02 pm »
Indeed, the current FindSFML.cmake searches both debug and release versions. I guess I should improve this.

Quote
is this the right place for questions like this? I didn't find an active bug tracker

Yep, the forum is the right place for everything. I prefer filtering things and updating the task tracker myself.
Laurent Gomila - SFML developer

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
CSFML and cmake configuration problem
« Reply #2 on: November 18, 2010, 10:48:10 pm »
It might be a preliminary solution to just install both the debug and the release versions of SFML by default.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CSFML and cmake configuration problem
« Reply #3 on: November 18, 2010, 11:09:09 pm »
You can't have both versions in one build.

But anyway, the solution is to fix FindSFML.cmake ;)
Laurent Gomila - SFML developer

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
CSFML and cmake configuration problem
« Reply #4 on: November 19, 2010, 06:54:03 pm »
I ran into a similar problem, this time on windows XP using minGW and msys:
Code: [Select]

$ cmake -G "MSYS Makefiles"  ..

[snip]

CMake Error at c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
  SFML_NETWORK_LIBRARY SFML_GRAPHICS_LIBRARY SFML_AUDIO_LIBRARY) (Required is
  at least version "2")
Call Stack (most recent call first):
  c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindSFML.cmake:67 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/SFML/CMakeLists.txt:22 (find_package)


, although both the "Debug" and the "Release" versions are installed. Installing SFML reported, that things where installed in
Code: [Select]
C:/Program Files/SFML/, but cmake doesn't seem to be able to find it there.

I tried to fix this, but without any success. Which is probably cause my knowledge of cmake is not very profound.

Can I fix this easily?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CSFML and cmake configuration problem
« Reply #5 on: November 19, 2010, 07:03:48 pm »
Quote
but cmake doesn't seem to be able to find it there

How is it supposed to know that? It's not a standard path, and there's nothing written in the registry or in a config file ;)

You need to add a variable in CMake, named SFMLDIR and equal to the path ("C:/Program Files/SFML/").
Laurent Gomila - SFML developer

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
CSFML and cmake configuration problem
« Reply #6 on: November 22, 2010, 01:48:18 pm »
Quote
How is it supposed to know that? It's not a standard path, and there's nothing written in the registry or in a config file Wink

I didn't tell cmake to use that path, so it seems to be the standard path in my setup. I am using msys, which caused some strange behaviour with paths before. (But cmake can generate Makefiles specifically for msys, so ideally this should just work.) What would be a standard path?

Quote
You need to add a variable in CMake, named SFMLDIR and equal to the path ("C:/Program Files/SFML/").


I added
Code: [Select]
set(SFMLDIR "C:/Program Files/SFML/") to
Code: [Select]
bindings/c/CMakeLists.txt. Is this what you meant? The result stays the same though. I also toyed around and tried
    passing -DSFMLDIR="C:/Program Files/SFML/" to cmake;

    trying the above solutions while escaping the space in the path;

    installing in a unix-like path under msys without spaces (with -DCMAKE_INSTALL_PREFIX=/usr/local);


all without success. I am a bit out of ideas, what else to try. Any advice?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CSFML and cmake configuration problem
« Reply #7 on: November 22, 2010, 02:01:14 pm »
Quote
passing -DSFMLDIR="C:/Program Files/SFML/" to cmake;

This is the right thing to do (never modify the source CMakeLists.txt!).

If you have /include and lib/ under this path, then FindSFML.cmake will be able to find SFML headers and libraries, and CSFML will be configured successfully. On Windows, you'll need to have both debug and release SFML libraries under /lib (I will fix this soon).

If it still doesn't work, show me the new error messages.
Laurent Gomila - SFML developer

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
CSFML and cmake configuration problem
« Reply #8 on: November 22, 2010, 04:43:00 pm »
Quote
(never modify the source CMakeLists.txt!).

Yes, that makes sense.

Quote
If you have /include and lib/ under this path, then FindSFML.cmake will be able to find SFML headers and libraries, and CSFML will be configured successfully.


Sadly, no. I have the include- and the lib-dir in that directory, both the Release and the Debug version. cmake still fails with the following error:

Code: [Select]
CMake Error at c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
  SFML_NETWORK_LIBRARY SFML_GRAPHICS_LIBRARY SFML_AUDIO_LIBRARY) (Required is
  at least version "2")
Call Stack (most recent call first):
  c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindSFML.cmake:67 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/SFML/CMakeLists.txt:22 (find_package)

(which is the same message as in my post from friday, as far as I see.)

I noticed one interesting thing: If I don't tell cmake to set SFMLDIR to the appropriate path I get this error message:
Code: [Select]
CMake Error at c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find SFML (missing: SFML_INCLUDE_DIR SFML_SYSTEM_LIBRARY
  SFML_WINDOW_LIBRARY SFML_NETWORK_LIBRARY SFML_GRAPHICS_LIBRARY
  SFML_AUDIO_LIBRARY) (Required is at least version "2")
Call Stack (most recent call first):
  c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindSFML.cmake:67 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/SFML/CMakeLists.txt:22 (find_package)

, which, as you can see, differs in that cmake cannot even find SFML's include dir. This leads me to the conclusion, that cmake uses SFMLDIR to search for the include dir, but ignores it when looking for the lib-dir, for some reason. Or am I wrong?

btw: I really appreciate your help and hope, we can resolve this issue.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CSFML and cmake configuration problem
« Reply #9 on: November 22, 2010, 05:03:43 pm »
What does your lib folder contain?
Laurent Gomila - SFML developer

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
CSFML and cmake configuration problem
« Reply #10 on: November 22, 2010, 05:08:49 pm »
Code: [Select]
$ ls "C:/Program Files/SFML/lib"
libsfml-audio-d.a  libsfml-graphics-d.a  libsfml-network-d.a  libsfml-system-d.a  libsfml-window-d.a
libsfml-audio.a    libsfml-graphics.a    libsfml-network.a    libsfml-system.a    libsfml-window.a

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CSFML and cmake configuration problem
« Reply #11 on: November 22, 2010, 05:51:27 pm »
I have no idea, sorry. I can't test with MSYS, but with VC++ it works for me.

Maybe you can try to debug the CMake files yourself, try to figure out what happens.
Laurent Gomila - SFML developer

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
CSFML and cmake configuration problem
« Reply #12 on: November 22, 2010, 06:30:17 pm »
I'll do that, if I find the time. Thanks for your help.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
CSFML and cmake configuration problem
« Reply #13 on: November 24, 2010, 12:25:15 am »
Same problem here. Building sfml went fine with VS2010 x86 + x64 versions.
But csfml is reluctant. Even after specifying the sfml install path where bin include and lib is.

Quote
CMake Error at F:/cmake-2.8.2-win32-x86/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE):
  Could NOT find SFML (missing: SFML_INCLUDE_DIR SFML_SYSTEM_LIBRARY
  SFML_WINDOW_LIBRARY SFML_NETWORK_LIBRARY SFML_GRAPHICS_LIBRARY
  SFML_AUDIO_LIBRARY)
Call Stack (most recent call first):
  F:/cmake-2.8.2-win32-x86/share/cmake-2.8/Modules/FindSFML.cmake:67 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/SFML/CMakeLists.txt:22 (find_package)


EDIT: Had to manually specify all of the paths to make it work :(
Remember that you must use '/' separators instead of '\' or you might get some error like me:
Quote
CMake Error at cmake/Macros.cmake:55 (csfml_parse_arguments):
  Syntax error in cmake code at

    ð;É8ë7ð;ÉrojeèÂÀeclipse/work:55

  when parsing string

    SOURCES;G:/Daten/.........;G:\Daten\D-Projekte\eclipse\workspace\sfml2\install\lib;debug;G:\Daten\D-Projekte\eclipse\workspace\sfml2\install\lib

  Invalid escape sequence \D
Call Stack (most recent call first):
  src/SFML/System/CMakeLists.txt:24 (csfml_add_library)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
CSFML and cmake configuration problem
« Reply #14 on: November 24, 2010, 08:23:41 am »
If even SFML_INCLUDE_DIR is not found, then the SFML path you provided is probably wrong. How did you do that exactly?
Laurent Gomila - SFML developer

 

anything