SFML community forums

Help => General => Topic started by: J-Gamer on November 22, 2012, 04:01:13 pm

Title: Installing 2.0 together with 1.6
Post by: J-Gamer on November 22, 2012, 04:01:13 pm
The title almost says it all: I want to have a working installation of both SFML 1.6 and 2.0 on the same configuration. I have a few old projects that need 1.6 to compile, but I'd like to use 2.0 for a new project. 1.6 is currently installed to the default install location, and afaik, sfml 2.0 would just install over it, probably causing conflicts.

I tried using the findSFML.cmake with this command: SFMLDIR=../sfml cmake .., but it said it found a 1.x version of sfml. Shouldn't that file first search in the SFMLDIR directory before checking system-wide installations?
Title: Re: Installing 2.0 together with 1.6
Post by: eXpl0it3r on November 22, 2012, 04:17:22 pm
SFML 1.x does not come with CMake, so there's not reason in trying to do anything with CMake and SFML 1.x unless you write everything on your own.

What OS are you using? Which compiler do you use? How do you install SFML? What do you understand with 'the same configuration'?

You can easily have a folder with SFML 1.x and one with SFML 2 and then always just link what you need...
Title: Re: Installing 2.0 together with 1.6
Post by: Laurent on November 22, 2012, 04:30:30 pm
Quote
I tried using the findSFML.cmake with this command: SFMLDIR=../sfml cmake ..
The variable is SFML_ROOT (read the doc!).

Quote
SFML 1.x does not come with CMake, so there's not reason in trying to do anything with CMake and SFML 1.x unless you write everything on your own.
This doesn't prevent the FindSFML script to find SFML 1.x headers and libraries. FindXxx scripts can be written for any library, what the library was meta-compiled with doesn't make any difference, it will just search for its installed headers and libraries.
Title: Re: Installing 2.0 together with 1.6
Post by: J-Gamer on November 22, 2012, 04:42:53 pm
I'm on Ubuntu 11.04, g++ 4.7.2.

SFML 1.6 came with an installation script, which put it in /usr/local/sfml. I have a cmake configuration file called FindSFML.cmake I got from here (https://github.com/SFML/SFML/blob/master/cmake/Modules/FindSFML.cmake). I've been using that in my projects that use cmake to generate their makefiles to find sfml. It did succesfully find my 1.6 installation when I wanted it to for my older projects.
I now have a project that uses sfml 2, and I have downloaded compiled binaries from the Downloads section of the main site. I put them in the main project directory, and tried the command stated above in a build directory to generate makefiles. AFAIK, setting SFMLDIR should make the script search for sfml in the directory specified. It didn't, since I got this error:
Code: [Select]
SFML found but version too low (requested: 2, found: 1.x)
Quote
The variable is SFML_ROOT (read the doc!).
Still doesn't work.

Oops... It seems that I have an outdated version. SFMLDIR has been replaced with SFML_ROOT. Will edit this post after I tried it out.

EDIT: Still doesn't work. I don't get why setting SFML_ROOT doesn't change where it searches. I have tried both ways: exporting SFML_ROOT to point to the SFML 2.0 directory, and defining it as a cmake variable.

EDIT2: What directory should it actually point at? It currently points to the directory where the include and lib folders are.
Title: Re: Installing 2.0 together with 1.6
Post by: J-Gamer on November 22, 2012, 06:24:49 pm
I don't know how to notify you if I edited a post, so here's me bumping the thread.
Title: Re: Installing 2.0 together with 1.6
Post by: Laurent on November 22, 2012, 08:15:40 pm
I don't know what's wrong with your environment, it should work fine.

Quote
I don't know how to notify you if I edited a post
The thread is marked has "new" even if you don't post a new message. I don't know about other notifications though (I never use them).