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

Author Topic: Is there a popular multiplatform SFML 2.0 dev solution?  (Read 3022 times)

0 Members and 1 Guest are viewing this topic.

vgambit

  • Newbie
  • *
  • Posts: 5
    • View Profile
Is there a popular multiplatform SFML 2.0 dev solution?
« on: December 01, 2010, 12:50:58 am »
I would like my game to compile on Windows, Mac, and Linux, without having to change the code too much between the three. Preferably, I would be able to use Visual Studio 2008 for Windows, XCode for Mac, and Eclipse for Linux.

From what I understand, the only way to ensure that there won't be any platform-specific bugs is to build on all three platforms using the same compiler, which would be GCC. I already have a Visual Studio solution that compiles fine, and I did get it to compile on the Mac a few months back, but I need a universal solution. Right now, I'm trying to compile it on Linux, and my current stumbling block is the makefile. I'm looking up how to write makefiles, but in the meantime, does anyone have any ideas?

My Linux distro is Arch Linux, by the way.

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Is there a popular multiplatform SFML 2.0 dev solution?
« Reply #1 on: December 01, 2010, 06:50:04 am »
I strongly suggest you use CMake for the build system. This is exactly what it was designed for.

vgambit

  • Newbie
  • *
  • Posts: 5
    • View Profile
Is there a popular multiplatform SFML 2.0 dev solution?
« Reply #2 on: December 01, 2010, 07:04:16 am »
Alright. I'll start here: http://goo.gl/SGuPy

Hopefully, that article will have enough info for me to come up with a build solution on every platform. Only having to set up a build system once kicks the crap out of doing it three times.

vgambit

  • Newbie
  • *
  • Posts: 5
    • View Profile
Is there a popular multiplatform SFML 2.0 dev solution?
« Reply #3 on: December 02, 2010, 10:51:55 pm »
I finally set up CMake with my VS2008 project using vcproj2cmake. The only caveat is (unless I want to keep using the buggy script that supposedly does it for you), I have to keep manually editing the CMakeLists.txt every time I add a new file to the project. There are a bunch of other issues, too, but overall, I'm happy. The next step is actually testing the build on other platforms, but I'll probably do that tomorrow. Here's what I did to get it to work:

SFML Projects from vcproj2cmake

Move the two .cmake files from the vcproj2cmake/cmake/Modules folder into your project’s source directory
Generate the cmakelists.txt using the vcproj2cmake script
Edit the cmakelists.txt:
   Remove the “.\” (or just change to “./” or “/”, not tested)
   Add the .cmake file extension to the two includes
   On the if and end if lines, remove the "CMAKE_CONFIGURATION_TYPES OR"

After configuring the build:
   Add a new entry - CMAKE_BUILD_TYPE (string) and define it as you would like (e.g. Debug or Release)

After generating the VS build:
   Copy over any dlls (if you're using dynamic linking)
   Copy over resources (e.g. sounds, textures)

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Is there a popular multiplatform SFML 2.0 dev solution?
« Reply #4 on: December 03, 2010, 04:20:40 am »
I think you should learn how to write CMakeLists.txt by hand, it is easy. Converter scripts tend to be buggy and out of date. If you don't want to manually add new source files, use AUX_SOURCE_DIRECTORY.

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Is there a popular multiplatform SFML 2.0 dev solution?
« Reply #5 on: December 06, 2010, 12:48:39 am »
I am interested in this, too. :)

Do you know of a good beginner's tutorial that will have you making simple scripts fairly quickly? (Preferably learning by example approach, like the SFML tutorials)

 

anything