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

Author Topic: SFML 2 - Cmake problems  (Read 11046 times)

0 Members and 1 Guest are viewing this topic.

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
SFML 2 - Cmake problems
« on: June 13, 2011, 08:23:52 am »
Hello!
I am trying to install SFML 2 on Codeblocks. I am following this tutorial, but Cmake is having problems building the dll's:
I managed to make it work with VS 2010, but I like Codeblocks better.

Code: [Select]

CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:D:/SFML/Build/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:D:/SFML/Build/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Configuring incomplete, errors occurred!


What I am doing wrong?
Also, would it be possible for someone to upload the dll's somewhere? :)

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
SFML 2 - Cmake problems
« Reply #1 on: June 13, 2011, 09:42:21 am »
Set the paths to your toolchain. It can't find gcc nor make. You can do that in cmake-gui.

That, or append the location to the toolchain binaries to your PATH. If you are on Windows, you can do that in "Configure Environment Variables".

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
SFML 2 - Cmake problems
« Reply #2 on: June 13, 2011, 10:10:11 am »
I've no idea how to do any of the things you listed. Can you be a little more specific?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 - Cmake problems
« Reply #3 on: June 13, 2011, 10:29:46 am »
It's explained in the tutorial...
Laurent Gomila - SFML developer

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
SFML 2 - Cmake problems
« Reply #4 on: June 13, 2011, 11:06:19 am »
I did this, it didn't work. The errors are the same.

On Windows, if you want to use gcc (MinGW), you can temporarily add the MinGW\bin directory to the PATH and then run cmake from the command shell:
> set PATH=%PATH%;your_mingw_folder\bin
> cmake

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 - Cmake problems
« Reply #5 on: June 13, 2011, 11:21:23 am »
You probably did it wrong. Can you describe what you did, which as many details as possible?
Laurent Gomila - SFML developer

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
SFML 2 - Cmake problems
« Reply #6 on: June 13, 2011, 11:29:20 am »
I wrote this in cmd, just like it says in the tutorial:
Code: [Select]

C:\Users\Cristi>set PATH=%PATH%;D:\Program Files\CodeBlocks\MinGW\bin

C:\Users\Cristi>cmake
cmake version 2.8.4


Then cmake prints about two pages of stuff (usage, option, generators).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 - Cmake problems
« Reply #7 on: June 13, 2011, 11:34:51 am »
The "cmake" command is supposed to launch cmake, which I explain with more details right after this paragraph. So if you use cmake-gui, you must write "cmake-gui" instead. If you use cmake from the command line, you must execute these commands from the directory where you want to build SFML.

I know it's hard to figure out for beginners, but sometimes it's also hard for me to write a tutorial that you can just copy and paste blindly to make things work, here you need to understand a little bit what you do if you want things to work ;)
Laurent Gomila - SFML developer

cristi121

  • Newbie
  • *
  • Posts: 33
    • View Profile
SFML 2 - Cmake problems
« Reply #8 on: June 13, 2011, 12:15:10 pm »
I'll just stick to 1.6, then.
Thanks for the answers.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
SFML 2 - Cmake problems
« Reply #9 on: June 13, 2011, 03:39:15 pm »
Don't stick with 1.6. ATi Radeons running on recent drivers have major issues, which will make many people unable to use anything you make with it. At least try to figure it out. I use cmake -i, which might be helpful. You can also look up CMake generators to create project files for Code::Blocks, Visual Studio, etc.
I use the latest build of SFML2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 - Cmake problems
« Reply #10 on: June 13, 2011, 05:43:52 pm »
Quote
I'll just stick to 1.6, then.
Thanks for the answers.

It's not complicated, really. Give it a try.
But if you don't want to learn anything and just copy and paste other people's stuff... it's up to you. I don't mean to be rude, I just don't like to see people giving up so easily without trying to understand.
Laurent Gomila - SFML developer

lakunar

  • Newbie
  • *
  • Posts: 20
    • View Profile
SFML 2 - Cmake problems
« Reply #11 on: June 13, 2011, 06:23:10 pm »
Maybe you should add one more screen to the tutorial which shows, what you have to do if cmake couldn't find the compiler.
Enter it yourself!
Example:
http://projectbase.pr.funpic.de/cmakeCompiler.JPG
Just enter all these paths

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 - Cmake problems
« Reply #12 on: June 13, 2011, 06:26:02 pm »
This is not the right solution. The clean solution is to make your compiler tools available, ie. in the PATH environment variable, so that CMake can detect everything automatically.
Laurent Gomila - SFML developer

lakunar

  • Newbie
  • *
  • Posts: 20
    • View Profile
SFML 2 - Cmake problems
« Reply #13 on: June 13, 2011, 06:32:48 pm »
Quote from: "Laurent"
The clean solution is to make your compiler tools available

Of course you're right but it is quite useful if you have 32 & 64 bit compiler.

And before he gives up ...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 - Cmake problems
« Reply #14 on: June 13, 2011, 06:36:15 pm »
Quote
Of course you're right but it is quite useful if you have 32 & 64 bit compiler.

If you have several compilers, don't put them permanently in the PATH, do like the tutorial says instead.
Laurent Gomila - SFML developer