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

Author Topic: Installing 2.0 together with 1.6  (Read 1517 times)

0 Members and 1 Guest are viewing this topic.

J-Gamer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Installing 2.0 together with 1.6
« 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10820
    • View Profile
    • development blog
    • Email
Re: Installing 2.0 together with 1.6
« Reply #1 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...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Installing 2.0 together with 1.6
« Reply #2 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.
« Last Edit: November 22, 2012, 04:44:55 pm by Laurent »
Laurent Gomila - SFML developer

J-Gamer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Installing 2.0 together with 1.6
« Reply #3 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. 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.
« Last Edit: November 22, 2012, 05:19:10 pm by J-Gamer »

J-Gamer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Installing 2.0 together with 1.6
« Reply #4 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Installing 2.0 together with 1.6
« Reply #5 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).
Laurent Gomila - SFML developer

 

anything