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

Author Topic: CSFML cmake broken?  (Read 18088 times)

0 Members and 1 Guest are viewing this topic.

krzat

  • Full Member
  • ***
  • Posts: 107
    • View Profile
CSFML cmake broken?
« on: January 08, 2014, 08:45:13 pm »
I've built CSFML on windows few times and it has never been smooth (as opposed to SFML). This solution sort of works, but is ugly.

My steps:
1. Clone both repos to some folder
2. Configure, build and install SFML to C:\Program Files (x86)\SFML with VS2012 as x86 shared release.
3. Configure CSFML in cmake:
a. add CMAKE_MODULE_PATH as C:\Program Files (x86)\SFML\cmake\Modules
b. Result:  SFML found but some of its dependencies are missing ( FreeType GLEW libjpeg
c. Add SFML_ROOT as C:/Program Files (x86)/SFML - why FindSFML needs standard path?
d. Result: Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY

EDIT: Ok, I get it: SFML should be static, and CSFML shared. Perhaps some helpful message when trying to build shared on shared? And SFML_ROOT should not be needed if library is in default directory.
« Last Edit: January 08, 2014, 09:22:24 pm by krzat »
SFML.Utils - useful extensions for SFML.Net

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9672
    • View Profile
    • development blog
    • Email
AW: CSFML cmake broken?
« Reply #1 on: January 09, 2014, 08:01:27 am »
You need to understand how the C binding works. CSFML is a C library with a C API & ABI, but it includes the full C++ library within itself, thus SFML needs to be build statically. ;)

Although CMake sets a "default" path, I wouldn't ever suggest to install you libraries into the program directory. That dir is already rather cluttered with other stuff, it is intended for actual applications and you can run into permission issues.
As such I feel like there's no need to search there. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

myl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: CSFML cmake broken?
« Reply #2 on: May 21, 2014, 10:02:09 pm »
Hey.

I agree with the above. It would really be nice with a step by step guide to building CSFML. I've done it before, but it is never a breeze like SFML.

My current goal is to have the .Net binding (that uses CSFML) working on iOS. For this to happen, I've:
1. Cloned SFML repo
2. Used CMake to generate build scripts for iOS by adding the parameter IOS to true.
3. Built SFML in xcode
4. Cloned CSFML
5. I've stalled at CMake of CSFML. What parameters should be set to what exactly? I've tried adding CMAKE_MODULE_PATH to SFML/cmake/Modules where SFML is the path of cloned SFML repo. I get "Could NOT find SFML" from FindSFML.cmake .

Help is appreciated!

myl

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32452
    • View Profile
    • SFML's website
    • Email
Re: CSFML cmake broken?
« Reply #3 on: May 21, 2014, 11:01:12 pm »
Quote
My current goal is to have the .Net binding (that uses CSFML) working on iOS.
You'll never be able to do that. iOS only accepts static libraries, and CSFML / SFML.Net is full of shared libraries, and nothing can be done about it.
Laurent Gomila - SFML developer

myl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: CSFML cmake broken?
« Reply #4 on: May 22, 2014, 10:27:48 am »
You'll never be able to do that. iOS only accepts static libraries, and CSFML / SFML.Net is full of shared libraries, and nothing can be done about it.

So you are saying it will never be possible to build CSFML statically for iOS? The .Net bridge from there shouldn't cause major problems:
Quote
Xamarin.iOS supports linking with both native C libraries and Objective-C libraries.
(from http://docs.xamarin.com/guides/ios/advanced_topics/native_interop/)

myl

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32452
    • View Profile
    • SFML's website
    • Email
Re: CSFML cmake broken?
« Reply #5 on: May 22, 2014, 10:39:09 am »
Maybe it is possible, with some hacks. I don't know. I've never done it, actually. So... go ahead and try ;)
Laurent Gomila - SFML developer

myl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: CSFML cmake broken?
« Reply #6 on: May 22, 2014, 10:49:05 am »
Maybe it is possible, with some hacks. I don't know. I've never done it, actually. So... go ahead and try ;)

Hahaha, you don't sound very convinced :)

Do you mean hacks when compiling CSFML statically for iOS? Or hacks with the .Net binding?

myl

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32452
    • View Profile
    • SFML's website
    • Email
Re: CSFML cmake broken?
« Reply #7 on: May 22, 2014, 10:53:43 am »
I have no idea. The best way to know which problems you'd face is to try it ;)
Laurent Gomila - SFML developer

myl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: CSFML cmake broken?
« Reply #8 on: May 22, 2014, 11:07:24 am »
Heheh, on it!

But I've stalled at CMake of CSFML. What parameters should be set to what exactly? I've tried adding CMAKE_MODULE_PATH to SFML/cmake/Modules where SFML is the path of cloned SFML repo. I get "Could NOT find SFML" from FindSFML.cmake .

I also tried setting SFML_ROOT to the path of my freshly built SFML for iOS libs.

myl

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32452
    • View Profile
    • SFML's website
    • Email
Re: CSFML cmake broken?
« Reply #9 on: May 22, 2014, 11:12:45 am »
Quote
I also tried setting SFML_ROOT to the path of my freshly built SFML for iOS libs.
And what was the exact error message after you did it?
Laurent Gomila - SFML developer

myl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: CSFML cmake broken?
« Reply #10 on: May 22, 2014, 11:33:06 am »
The error message i get:

CMake Error at /Users/myl/Projects/beat/github/SFML/cmake/Modules/FindSFML.cmake:307 (message):
  Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
  SFML_NETWORK_LIBRARY SFML_GRAPHICS_LIBRARY SFML_AUDIO_LIBRARY)
Call Stack (most recent call first):
  src/SFML/CMakeLists.txt:24 (find_package)


Configuring incomplete, errors occurred!
See also "/Users/myl/Projects/beat/github/CSFMLiOS/CMakeFiles/CMakeOutput.log".


myl

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32452
    • View Profile
    • SFML's website
    • Email
Re: CSFML cmake broken?
« Reply #11 on: May 22, 2014, 11:43:21 am »
And what's inside the SFML_ROOT directory? Make sure it is a proper install, not just your build directory.
Laurent Gomila - SFML developer

myl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: CSFML cmake broken?
« Reply #12 on: May 22, 2014, 11:46:24 am »
That must be the problem. I am just using the build directory. Where is my Install directory (how do I install after building in XCode?).

myl

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32452
    • View Profile
    • SFML's website
    • Email
Re: CSFML cmake broken?
« Reply #13 on: May 22, 2014, 11:51:19 am »
Install directory is what you put in CMAKE_INSTALL_PREFIX.
You install by building the "Install" project in XCode.

Everything is explained in the corresponding tutorial ("Compiling SFML").
Laurent Gomila - SFML developer

myl

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: CSFML cmake broken?
« Reply #14 on: May 22, 2014, 12:40:03 pm »
Aah ok. The CSFML CMake mystery is starting to dawn on me :)

I've set the CMAKE_INSTALL_PREFIX for SFML to a custom path (SFMLiOS/lib/Install/) and built install in XCode, this produces a directory containing the headers, libs and some cmake files where I want it. So far so good.

CMake configure for CSFML is giving the same error. So just to clarify, all I've done with CSFML CMake:
CMAKE_MODULE_PATH is SFMLiOS/lib/Install/cmake/Modules
SFML_ROOT is SFMLiOS/lib/Install/

Exact error:

CMake Error at /Users/myl/Projects/beat/github/SFMLiOS/lib/Install/cmake/Modules/FindSFML.cmake:307 (message):
  Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
  SFML_NETWORK_LIBRARY SFML_GRAPHICS_LIBRARY SFML_AUDIO_LIBRARY)
Call Stack (most recent call first):
  src/SFML/CMakeLists.txt:24 (find_package)


Configuring incomplete, errors occurred!
See also "/Users/myl/Projects/beat/github/CSFMLiOS/CMakeFiles/CMakeOutput.log".


myl

 

anything