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

Author Topic: CSFML dependencies  (Read 8316 times)

0 Members and 1 Guest are viewing this topic.

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
CSFML dependencies
« on: February 12, 2015, 07:01:10 am »
I'm backtracking a bit from C++ to C so I thought I'd try out the CSFML binding.  I'm having a bit of a hard time translating the calls from SFML to CSFML, but searching the forums for code examples tends to get me solutions.  One thing I haven't found is that the current CSFML binding is to SFML2.1.  Not a problem I thought.  I downloaded the precompiled version from the download section and almost got everything working.

I'm playing with it on linux mint 17.1 and the CSFML binding is making calls to GLEW 1.5 and asking for libGLEW.so.1.5, but my this distro only has version 1.10.0-3 available.  I haven't yet looked into finding a lesser version on the libglew page mainly because going back and installing it may break a few things unless I took special effort to avoid that.  libjpeg.so.62 is also being called for by CSFML.  I can get that from the repository, but it removes the more current version of libjpeg from the system to do so, so again may break some things.  My compiled version of SFML 2.2 for one.

I was wondering if the CSFML binding is going to be updated soon since 2.2 is out, but I know that 2.3 is probably coming soon so it may be a bit of trouble to re-create the binding only to just turn around and do it again when 2.3 hits.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: CSFML dependencies
« Reply #1 on: February 12, 2015, 07:59:42 am »
I don't know if CSFML 2.2 will be released soon. I can't maintain it so I'm mostly relying on external contributions.

But don't be afraid to recompile SFML and CSFML (2.1) if GLEW and libjpeg are giving you troubles.
Laurent Gomila - SFML developer

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: CSFML dependencies
« Reply #2 on: February 12, 2015, 03:06:06 pm »
Compilation is actually the first thing I tried and couldn't get it going.  I have SFML 2.2 compiled from source installed.  Can't give an exact date on it, but it's from toward the end of January.  I downloaded the current CSFML repository and it says it's for SFML 2.1.  I gave compilation a shot, but it fails in cmake saying it can't find FindSFML.cmake.  I can point it exactly where it is on my system using the browse feature on the cmake gui, but once I get it to the directory where FindSFML.cmake is it keeps that file greyed out and won't let me select it.  I did a few forum searches here and saw others with that issue, but no suggestions that helped me.  That's why I went the prebuilt route.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: CSFML dependencies
« Reply #3 on: February 12, 2015, 03:09:43 pm »
Don't build the latest commit, but rather the 2.1 tag (for both SFML and CSFML).

The path to FindSFML.cmake must be added to the CMAKE_MODULE_PATH variable before configuring. Or you can copy FindSFML.cmake to your CMake's Module directory.
Laurent Gomila - SFML developer

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: CSFML dependencies
« Reply #4 on: February 12, 2015, 05:57:41 pm »
Don't build the latest commit, but rather the 2.1 tag (for both SFML and CSFML).

The path to FindSFML.cmake must be added to the CMAKE_MODULE_PATH variable before configuring. Or you can copy FindSFML.cmake to your CMake's Module directory.

No problem building SFML2.1, but same problem with the FindSFML.cmake file.  I know exactly where it is and browse to it with the cmake-gui version of cmake, but once the browser is in the directory everything is greyed out and nothing can be selected.  I tried checking the CMakeLists.txt file of CSFML to see if I could set it in there, but I have little knowledge of cmake thus far.  I was learning more in order to give CLion a shot and managed to get external library configuration to work, but that's about the extent of my cmake knowledge.  Whenever people ship libs with cmake as the build system it just always works for me so troubleshooting is still an issue I have.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: CSFML dependencies
« Reply #5 on: February 12, 2015, 06:20:24 pm »
Quote
I know exactly where it is and browse to it with the cmake-gui version of cmake, but once the browser is in the directory everything is greyed out and nothing can be selected. 
In which CMake variable, and of which type?
Laurent Gomila - SFML developer

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: CSFML dependencies
« Reply #6 on: February 12, 2015, 06:31:40 pm »
I have 2 cmake versions available.  Cmake 2.8.12.2 is the one installed from the repository, but recently a lib needed a higher version so I have a self contained cmake v3.1.0.  When setting up initial directories and cmake generation type there is no way to skip the initial configuration step that I know of so cmake does it's thing then reports the error of not knowing where the FindSFML.cmake file is.  On both versions the variable field named 'SFML_Dir' shows as it's target 'SFMLDIR-NOTFOUND'.  I then left click the field and that pops up the '...' browse button.  That then loads a UI for hopping through the file system.  I navigate that way to where the file actually is, but it's not selectable.  nothing in that directory is.

I believe that's the CMake variable you asked for, but not sure of 'which type'.  The 'SFML_Dir' variable field is the only one reporting an error.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: CSFML dependencies
« Reply #7 on: February 12, 2015, 08:14:25 pm »
Don't guess things. Read the docs or search ;)

What I said is:
Quote
The path to FindSFML.cmake must be added to the CMAKE_MODULE_PATH variable before configuring.

If you're using cmake-gui you can add variables before configuring. If you use the command line you must use -DCMAKE_MODULE_PATH=<path>.

Learning this kind of things is not fun but it will save you troubles next time you use CMake, so it may be worth it.
Laurent Gomila - SFML developer

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: CSFML dependencies
« Reply #8 on: February 12, 2015, 08:35:52 pm »
Don't guess things. Read the docs or search ;)
I did look over the docs.  The CSFML page clearly states there are no docs for CSFML so use the docs for SFML.  I did search the forums as well before posting.

If you're using cmake-gui you can add variables before configuring. If you use the command line you must use -DCMAKE_MODULE_PATH=<path>.
Cmake does an auto configure right after selecting which type of build files it should create.  That can't be avoided in the gui that I am aware of.  All I can do is edit after this step and before I hit the configure button myself.  I use the gui because that is the only example of use for cmake that I have found so far on the site so I am unsure of what all cmake flags I need to add on the command line.

Learning this kind of things is not fun but it will save you troubles next time you use CMake, so it may be worth it.
This is something I am working on, but for me it is hard to maneuver around the docs for specific information.  It's a bit disjointed to me so it is taking a while to test each step I am trying to recreate.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: CSFML dependencies
« Reply #9 on: February 12, 2015, 08:46:49 pm »
Quote
I did look over the docs.  The CSFML page clearly states there are no docs for CSFML so use the docs for SFML.  I did search the forums as well before posting.
I mean, the docs for the CMake stuff, not SFML. SFML doesn't explain everything about the tools that it uses ;)

Quote
Cmake does an auto configure right after selecting which type of build files it should create.  That can't be avoided in the gui that I am aware of.  All I can do is edit after this step and before I hit the configure button myself.
Nop, cmake-gui does nothing until you hit the "Configure" button for the first time. You can "Add Entry" before  "Configure".
Laurent Gomila - SFML developer

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: CSFML dependencies
« Reply #10 on: February 12, 2015, 09:31:54 pm »
Nop, cmake-gui does nothing until you hit the "Configure" button for the first time. You can "Add Entry" before  "Configure".

For me cmake does do a check right after selecting which build file type to create.  It checks for the compilers and goes through the CMakeLists.txt file and checks what is in it.  It does this on its own.  After that is done the initial status report is given and I am allowed to make changes.  This is when I 'Add Entry' to set up the options, but so far I have had no luck doing this so I am looking over the cmake docs for help.

After making changes I just hit configure to check for errors and so far I haven't been able to clear them up.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: CSFML dependencies
« Reply #11 on: February 12, 2015, 09:46:25 pm »
How do you run cmake-gui?
Laurent Gomila - SFML developer

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: CSFML dependencies
« Reply #12 on: February 12, 2015, 10:02:12 pm »
Cmake is a program listed under 'Programming' on the menuing system.  I can run it from terminal as 'cmake-gui' though.  Both yield the same results.  This version is the one from the repository.  I also have a current version of cmake I downloaded from their website.  It is not installed, but runs as a stand alone download.  Running it yields the same behaviour.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: CSFML dependencies
« Reply #13 on: February 12, 2015, 10:23:59 pm »
There must be something you or I don't understand...

Look at this video:

When the guy launches cmake-gui nothing happens... The "source directory" and "build directory" fields are all empty, nothing can happen. CMake runs only when clicking on the Configure button.
Laurent Gomila - SFML developer