SFML community forums

Bindings - other languages => C => Topic started by: Echtolion on March 26, 2011, 04:11:37 am

Title: Problem configuring csfml2 with cmake
Post by: Echtolion on March 26, 2011, 04:11:37 am
I followed the tutorial to build SFML without issue(and installed it), however whenever I try to use cmake with csfml project I get the error


Code: [Select]
CMake Error at G:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find SFML (missing: SFML_INCLUDE_DIR SFML_SYSTEM_LIBRARY
  SFML_WINDOW_LIBRARY SFML_NETWORK_LIBRARY SFML_GRAPHICS_LIBRARY
  SFML_AUDIO_LIBRARY) (Required is at least version "2")
Call Stack (most recent call first):
  G:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  G:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindSFML.cmake:105 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/SFML/CMakeLists.txt:22 (find_package)


I'm new to SFML so I'm probably missing something relatively obvious  :oops:

I looked all around and searched but couldn't find an answer for this.
On windows 7 64-bit.
This is from the latest SVN revision, BTW.
Title: Problem configuring csfml2 with cmake
Post by: Laurent on March 26, 2011, 08:57:50 am
You must create a CMake variable named SFMLDIR and which contains the path to your SFML installation (the directory which contains /include and /lib).

This, and more details, is explained in FindSFML.cmake
Title: Problem configuring csfml2 with cmake
Post by: computerquip on April 05, 2011, 02:30:07 pm
Where would this file be located exactly?

I had to add each library name by hand. Not that big a deal but just saying. :/
Title: Problem configuring csfml2 with cmake
Post by: Laurent on April 05, 2011, 03:26:26 pm
Quote
Where would this file be located exactly?

Which file?
Title: Problem configuring csfml2 with cmake
Post by: computerquip on April 05, 2011, 03:34:17 pm
FindSFML.cmake
Title: Problem configuring csfml2 with cmake
Post by: Laurent on April 05, 2011, 03:36:56 pm
It's under SFML/cmake/Modules, and it installs automatically to your CMake installation when you install SFML 2.
Title: Problem configuring csfml2 with cmake
Post by: computerquip on April 05, 2011, 03:49:03 pm
Okay, I'm confused apparently. When you move to build CSFML with Cmake, even if you hand define all of the library variables (despite defining the library directory or SFMLDIR which both didn't work and returned that the libraries weren't found), cmake doesn't generate anything for me. Am I missing something?
Title: Problem configuring csfml2 with cmake
Post by: Laurent on April 05, 2011, 03:54:44 pm
I can't guess what you did, tell me what commands you executed, what CMake variables you defined, with what values, tell me how/where SFML 2 is installed, etc. etc..
Title: Problem configuring csfml2 with cmake
Post by: computerquip on April 05, 2011, 03:58:46 pm
Figured it out! Seems that I need to use static libraries, not dynamic which is why it couldn't find the libraries, etc. After building and moving them to SFMLDIR, all works fine.
Title: Problem configuring csfml2 with cmake
Post by: Laurent on April 05, 2011, 04:10:49 pm
Yes, sorry I forgot to mention that, CSFML links to SFML release static libraries.
Title: Problem configuring csfml2 with cmake
Post by: Richy19 on May 05, 2011, 08:55:39 pm
Dont want to make a new thread for basically same kind of problem.
Im trying to use CMake to create Codeblocks files using MinGW, however specifying the compiler as TCC but i get these errors

Quote

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: Could not find cmake module file:F:/tcc/c/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:F:/tcc/c/build/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Configuring incomplete, errors occurred!


I have also tried other options but they all still give errors
Title: Problem configuring csfml2 with cmake
Post by: Laurent on May 05, 2011, 11:09:38 pm
The path to the gcc executable must be in the PATH environment variable so that CMake can find it.
Title: Problem configuring csfml2 with cmake
Post by: Richy19 on May 06, 2011, 06:54:06 pm
Quote from: "Laurent"
The path to the gcc executable must be in the PATH environment variable so that CMake can find it.


Where exactly do i find it?
I have lookes all over the gui and in the cmakelist but cant find anything
Title: Problem configuring csfml2 with cmake
Post by: Laurent on May 06, 2011, 07:21:55 pm
I'm talking about the OS environment variables, which have nothing to do with CMake.

The best way is to add it locally, so that your global PATH is not polluted with your compiler path when you're not using CMake.

It is explained in the tutorial (http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php): open a console, and type the following command
Code: [Select]
set PATH=%PATH%;<mingw>/bin
Where <mingw> is the directory where you installed MinGW. Then, from the same console, launch cmake-gui
Code: [Select]
cmake-gui
Title: Problem configuring csfml2 with cmake
Post by: Richy19 on May 07, 2011, 12:45:58 am
Ahhh that worked great but now i get this error

Quote

CMake Error at src/SFML/CMakeLists.txt:22 (find_package):
  Could not find module FindSFML.cmake or a configuration file for package
  SFML.

  Adjust CMAKE_MODULE_PATH to find FindSFML.cmake or set SFML_DIR to the
  directory containing a CMake configuration file for SFML.  The file will
  have one of the following names:

    SFMLConfig.cmake
    sfml-config.cmake
Title: Problem configuring csfml2 with cmake
Post by: Laurent on May 07, 2011, 10:16:53 am
You must have installed SFML 2 before, and if you did it successfully, the FindSFML.cmake file should have been copied to your CMake directory.
Title: Problem configuring csfml2 with cmake
Post by: atomen on June 10, 2011, 06:29:17 pm
Sorry for reviving a thread, buy may I ask exactly what you mean by this:
Quote
the FindSFML.cmake file should have been copied to your CMake directory.

I am having trouble as well with compiling the C binding of sfml. I am receiving the same error as Richy19:
Code: [Select]
CMake Error at src/SFML/CMakeLists.txt:22 (find_package):
Could not find module FindSFML.cmake or a configuration file for package
SFML.

Adjust CMAKE_MODULE_PATH to find FindSFML.cmake or set SFML_DIR to the
directory containing a CMake configuration file for SFML. The file will
have one of the following names:

SFMLConfig.cmake
sfml-config.cmake

The steps I took to compile CSFML was to first compile SFML2 (latest snapshot) with CMake-Gui using "Visual Studio 9 2008".

After that I had two different outputs, sfml-build in the sfml snapshot folder and %APPDATA%/SFML. These two folders
contained solutions to build the projects for Visual Studio 2008. The one in %APPDATA% compiled successfully whilst the one
in the SFML-Build folder only succeeded with two out of 5 projects.

I can't find the SFMLConfig nor sfml-config in neither of these directories, therefore I am wondering where this cmake file i supposed to be located!

Thanks in beforehand!
Title: Problem configuring csfml2 with cmake
Post by: Laurent on June 10, 2011, 09:02:18 pm
To install SFML correctly you must execute the "install" target. If you generated a Visual Studio solution, this is a project of the solution. The install target locates your CMake install folder and copies FindSFML.cmake in it.

If, for some reason, you don't want to execute the "install" target, you can manually copy the cmake/Modules/FindSFML.cmake to cmake_install_dir/share/Modules. cmake_install_dir is of course the directory where you installed CMake.
Title: Problem configuring csfml2 with cmake
Post by: atomen on June 10, 2011, 10:43:10 pm
Thanks for you reply!

Now after further researching, I've discovered that I do have a file named "FindSFML.cmake" in the directory/folder from the snapshot in this (relative)
directory sfml/cmake/Modules/. Now the problem is, how do I inform (if this is the correct cmake file) cmake that the file is located in this directory?

I've attempted to change the SFML_DIR name/variable to both the sfml/ directory and the sfml/Modules/ directory but none of them have worked.
Any tips?
Title: Problem configuring csfml2 with cmake
Post by: Laurent on June 10, 2011, 10:49:59 pm
Hum... did you actually read my previous answer? :|
Title: Problem configuring csfml2 with cmake
Post by: atomen on June 10, 2011, 11:33:29 pm
Quote from: "Laurent"
Hum... did you actually read my previous answer? :|

After further research, no I did not.

Though now I have an additional problem, this is the output when I attempt to compile the C binding: (long text, scrollbars anyhow?)
Code: [Select]
CMake Error at C:/Program Files (x86)/CMake/share/cmake-2.8/Modules/FindSFML.cmake:52 (math):
  math cannot parse the expression:
  "////////////////////////////////////////////////////////////

  //

  // SFML - Simple and Fast Multimedia Library

  // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)

  //

  // This software is provided 'as-is', without any express or implied
  warranty.

  // In no event will the authors be held liable for any damages arising from
  the use of this software.

  //

  // Permission is granted to anyone to use this software for any purpose,

  // including commercial applications, and to alter it and redistribute it
  freely,

  // subject to the following restrictions:

  //

  // 1.  The origin of this software must not be misrepresented;

  // you must not claim that you wrote the original software.

  // If you use this software in a product, an acknowledgment

  // in the product documentation would be appreciated but is not required.

  //

  // 2.  Altered source versions must be plainly marked as such,

  // and must not be misrepresented as being the original software.

  //

  // 3.  This notice may not be removed or altered from any source
  distribution.

  //

  ////////////////////////////////////////////////////////////

 

  #ifndef SFML_CONFIG_HPP

  #define SFML_CONFIG_HPP

 

  ////////////////////////////////////////////////////////////

  // Identify the operating system

  ////////////////////////////////////////////////////////////

  #if defined(_WIN32) || defined(__WIN32__)

 

      // Windows
      #define SFML_SYSTEM_WINDOWS
      #ifndef WIN32_LEAN_AND_MEAN
          #define WIN32_LEAN_AND_MEAN
      #endif
      #ifndef NOMINMAX
          #define NOMINMAX
      #endif

 

  #elif defined(linux) || defined(__linux)

 

      // Linux
      #define SFML_SYSTEM_LINUX

 

  #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) ||
  defined(Macintosh)

 

      // MacOS
      #define SFML_SYSTEM_MACOS

 

  #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)

 

      // FreeBSD
      #define SFML_SYSTEM_FREEBSD

 

  #else

 

      // Unsupported system
      #error This operating system is not supported by SFML library

 

  #endif

 

 

  ////////////////////////////////////////////////////////////

  // Define a portable debug macro

  ////////////////////////////////////////////////////////////

  #if !defined(NDEBUG)

 

      #define SFML_DEBUG

 

  #endif

 

 

  ////////////////////////////////////////////////////////////

  // Define portable import / export macros

  ////////////////////////////////////////////////////////////

  #if defined(SFML_SYSTEM_WINDOWS)

 

      #ifdef SFML_DYNAMIC

 

          // Windows platforms
          #ifdef SFML_EXPORTS

 

              // From DLL side, we must export
              #define SFML_API __declspec(dllexport)

 

          #else

 

              // From client application side, we must import
              #define SFML_API __declspec(dllimport)

 

          #endif

 

          // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
          // You can read lots ot different things about it, but the point is the code will
          // just work fine, and so the simplest way to get rid of this warning is to disable it
          #ifdef _MSC_VER

 

              #pragma warning(disable : 4251)

 

          #endif

 

      #else

 

          // No specific directive needed for static build
          #define SFML_API

 

      #endif

 

  #else

 

      // Other platforms don't need to define anything
      #define SFML_API

 

  #endif

 

 

  ////////////////////////////////////////////////////////////

  // Define portable fixed-size types

  ////////////////////////////////////////////////////////////

  #include <climits>

 

  namespace sf

  {

      // 8 bits integer types
      #if UCHAR_MAX == 0xFF
          typedef signed   char Int8;
          typedef unsigned char Uint8;
      #else
          #error No 8 bits integer type for this platform
      #endif

 

      // 16 bits integer types
      #if USHRT_MAX == 0xFFFF
          typedef signed   short Int16;
          typedef unsigned short Uint16;
      #elif UINT_MAX == 0xFFFF
          typedef signed   int Int16;
          typedef unsigned int Uint16;
      #elif ULONG_MAX == 0xFFFF
          typedef signed   long Int16;
          typedef unsigned long Uint16;
      #else
          #error No 16 bits integer type for this platform
      #endif

 

      // 32 bits integer types
      #if USHRT_MAX == 0xFFFFFFFF
          typedef signed   short Int32;
          typedef unsigned short Uint32;
      #elif UINT_MAX == 0xFFFFFFFF
          typedef signed   int Int32;
          typedef unsigned int Uint32;
      #elif ULONG_MAX == 0xFFFFFFFF
          typedef signed   long Int32;
          typedef unsigned long Uint32;
      #else
          #error No 32 bits integer type for this platform
      #endif

 

  } // namespace sf

 

 

  #endif // SFML_CONFIG_HPP

   * 10 + ////////////////////////////////////////////////////////////

  //

  // SFML - Simple and Fast Multimedia Library

  // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)

  //

  // This software is provided 'as-is', without any express or implied
  warranty.

  // In no event will the authors be held liable for any damages arising from
  the use of this software.

  //

  // Permission is granted to anyone to use this software for any purpose,

  // including commercial applications, and to alter it and redistribute it
  freely,

  // subject to the following restrictions:

  //

  // 1.  The origin of this software must not be misrepresented;

  // you must not claim that you wrote the original software.

  // If you use this software in a product, an acknowledgment

  // in the product documentation would be appreciated but is not required.

  //

  // 2.  Altered source versions must be plainly marked as such,

  // and must not be misrepresented as being the original software.

  //

  // 3.  This notice may not be removed or altered from any source
  distribution.

  //

  ////////////////////////////////////////////////////////////

 

  #ifndef SFML_CONFIG_HPP

  #define SFML_CONFIG_HPP

 

  ////////////////////////////////////////////////////////////

  // Identify the operating system

  ////////////////////////////////////////////////////////////

  #if defined(_WIN32) || defined(__WIN32__)

 

      // Windows
      #define SFML_SYSTEM_WINDOWS
      #ifndef WIN32_LEAN_AND_MEAN
          #define WIN32_LEAN_AND_MEAN
      #endif
      #ifndef NOMINMAX
          #define NOMINMAX
      #endif

 

  #elif defined(linux) || defined(__linux)

 

      // Linux
      #define SFML_SYSTEM_LINUX

 

  #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) ||
  defined(Macintosh)

 

      // MacOS
      #define SFML_SYSTEM_MACOS

 

  #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)

 

      // FreeBSD
      #define SFML_SYSTEM_FREEBSD

 

  #else

 

      // Unsupported system
      #error This operating system is not supported by SFML library

 

  #endif

 

 

  ////////////////////////////////////////////////////////////

  // Define a portable debug macro

  ////////////////////////////////////////////////////////////

  #if !defined(NDEBUG)

 

      #define SFML_DEBUG

 

  #endif

 

 

  ////////////////////////////////////////////////////////////

  // Define portable import / export macros

  ////////////////////////////////////////////////////////////

  #if defined(SFML_SYSTEM_WINDOWS)

 

      #ifdef SFML_DYNAMIC

 

          // Windows platforms
          #ifdef SFML_EXPORTS

 

              // From DLL side, we must export
              #define SFML_API __declspec(dllexport)

 

          #else

 

              // From client application side, we must import
              #define SFML_API __declspec(dllimport)

 

          #endif

 

          // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
          // You can read lots ot different things about it, but the point is the code will
          // just work fine, and so the simplest way to get rid of this warning is to disable it
          #ifdef _MSC_VER

 

              #pragma warning(disable : 4251)

 

          #endif

 

      #else

 

          // No specific directive needed for static build
          #define SFML_API

 

      #endif

 

  #else

 

      // Other platforms don't need to define anything
      #define SFML_API

 

  #endif

 

 

  ////////////////////////////////////////////////////////////

  // Define portable fixed-size types

  ////////////////////////////////////////////////////////////

  #include <climits>

 

  namespace sf

  {

      // 8 bits integer types
      #if UCHAR_MAX == 0xFF
          typedef signed   char Int8;
          typedef unsigned char Uint8;
      #else
          #error No 8 bits integer type for this platform
      #endif

 

      // 16 bits integer types
      #if USHRT_MAX == 0xFFFF
          typedef signed   short Int16;
          typedef unsigned short Uint16;
      #elif UINT_MAX == 0xFFFF
          typedef signed   int Int16;
          typedef unsigned int Uint16;
      #elif ULONG_MAX == 0xFFFF
          typedef signed   long Int16;
          typedef unsigned long Uint16;
      #else
          #error No 16 bits integer type for this platform
      #endif

 

      // 32 bits integer types
      #if USHRT_MAX == 0xFFFFFFFF
          typedef signed   short Int32;
          typedef unsigned short Uint32;
      #elif UINT_MAX == 0xFFFFFFFF
          typedef signed   int Int32;
          typedef unsigned int Uint32;
      #elif ULONG_MAX == 0xFFFFFFFF
          typedef signed   long Int32;
          typedef unsigned long Uint32;
      #else
          #error No 32 bits integer type for this platform
      #endif

 

  } // namespace sf

 

 

  #endif // SFML_CONFIG_HPP

  ": syntax error, unexpected exp_DIVIDE, expecting exp_OPENPARENT or
  exp_NUMBER (1)
Call Stack (most recent call first):
  src/SFML/CMakeLists.txt:22 (find_package)


Found SFML: C:/Program Files (x86)/Microsoft Visual Studio/VC/include
Configuring incomplete, errors occurred!
Title: Problem configuring csfml2 with cmake
Post by: Laurent on June 10, 2011, 11:39:11 pm
This may be a bug in FindSFML.cmake. I'll check this as soon as I can.
Title: Problem configuring csfml2 with cmake
Post by: Laurent on June 11, 2011, 12:05:23 pm
Should be fixed now.
Title: Problem configuring csfml2 with cmake
Post by: atomen on June 11, 2011, 12:18:11 pm
Quote from: "Laurent"
Should be fixed now.
Thank you for fixing that!

Though I do still have one problem, when I try to compile the solution now, I receive this error (latest snapshot):
Code: [Select]
CMake Error at %APPDATA%/CMake/share/cmake-2.8/Modules/FindSFML.cmake:153 (message):
  SFML found but version too low (requested: 2.0, found: 1.x)
Call Stack (most recent call first):
  src/SFML/CMakeLists.txt:22 (find_package)
Title: Problem configuring csfml2 with cmake
Post by: Laurent on June 11, 2011, 06:55:30 pm
The message says it all: you're tring to link CSFML 2 to SFML 1. You must of course use SFML 2.
Title: Problem configuring csfml2 with cmake
Post by: atomen on June 11, 2011, 07:49:08 pm
Quote from: "Laurent"
The message says it all: you're tring to link CSFML 2 to SFML 1. You must of course use SFML 2.

Now, excuse me if I sound dumb, but does the latest snapshot even include SFML 1?
The PostFX class/header and source files doesn't even exists, only the shader class.
Title: Problem configuring csfml2 with cmake
Post by: Laurent on June 11, 2011, 09:00:05 pm
Quote
Now, excuse me if I sound dumb, but does the latest snapshot even include SFML 1?

No.
But the Config.hpp file that we can see in your error message is clearly not from a recent SFML 2 revision.

How do you specify the SFML root directory? Do you use the SDMLDIR CMake variable? The SFMLDIR environment variable? Something else?
Title: Problem configuring csfml2 with cmake
Post by: MelancholyMechanic on February 09, 2012, 11:31:28 pm
I'm also having trouble configuring CSFML. I built and installed SFML2 successfully in "C:/dev/libs/SFML" using MinGW and MSYS and the current files from GitHub. However when trying to build CSFML, I get the following error message:
Code: [Select]
CMake Error at c:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindSFML.cmake:165 (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:22 (find_package)


This is my configuration (using cmake-gui):

(http://www10.pic-upload.de/thumb/09.02.12/1m9c7gz1iln.png) (http://www.pic-upload.de/view-12920159/csfml.png.html)

Did I forget to define a variable?

Btw: mingw32-make install didn't install the Find*.cmake files in the corresponding directory of my CMake installation - I had to copy them myself.
Title: Problem configuring csfml2 with cmake
Post by: Laurent on February 10, 2012, 07:51:05 am
Did you compile SFML first?

Quote
Btw: mingw32-make install didn't install the Find*.cmake files in the corresponding directory of my CMake installation - I had to copy them myself.

This is the expected behaviour.
Title: Problem configuring csfml2 with cmake
Post by: MelancholyMechanic on February 10, 2012, 09:31:20 am
Quote
Did you compile SFML first?

Yes, I have all the sfml-*-2.dll files in "C:/dev/libs/SFML/bin" and all the libsfml-*.a (without the 2 suffix - is that correct?) files in "C:/dev/libs/SFML/lib".

Quote
This is the expected behaviour.

Ah, I misinterpreted this statement then: "You must have installed SFML 2 before, and if you did it successfully, the FindSFML.cmake file should have been copied to your CMake directory."
Title: Problem configuring csfml2 with cmake
Post by: Laurent on February 10, 2012, 09:49:14 am
Quote
Yes, I have all the sfml-*-2.dll files in "C:/dev/libs/SFML/bin" and all the libsfml-*.a (without the 2 suffix - is that correct?) files in "C:/dev/libs/SFML/lib"

Looks ok. In the CMake variables that you show above, which ones did you define, and which ones where automatically created by the configure step?

Quote
Ah, I misinterpreted this statement then: "You must have installed SFML 2 before, and if you did it successfully, the FindSFML.cmake file should have been copied to your CMake directory."

This was true before, but it has changed. Where did you read that?
Title: Problem configuring csfml2 with cmake
Post by: MelancholyMechanic on February 10, 2012, 10:34:53 am
I got it to work now! The problem was, that I should have compiled SFML into a static library (see line 19 in the CSFML/src/SFML/CMakeLists.txt).

Thanks for your help!

Quote
Where did you read that?

You posted it here: http://www.sfml-dev.org/forum/viewtopic.php?p=31246#31246
Title: Problem configuring csfml2 with cmake
Post by: Laurent on February 10, 2012, 11:02:04 am
Ah yes, sorry I totally forgot about that :)
Title: Re: Problem configuring csfml2 with cmake
Post by: mscofield on April 02, 2013, 03:17:43 pm
Hi, sorry for bumping.
Quote
Ah, I misinterpreted this statement then: "You must have installed SFML 2 before, and if you did it successfully, the FindSFML.cmake file should have been copied to your CMake directory."
This was true before, but it has changed. Where did you read that?

Right now, the .cmake files are installed in "/usr/local/share/SFML/cmake/Modules/" (instead of "/usr/share/cmake-X.Y/Modules/") and we have to move them manually , is this the intended way ?
If so, would be nice to mention it somewhere  ;)
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on April 02, 2013, 03:20:05 pm
Quote
is this the intended way ?
Yes.

Quote
If so, would be nice to mention it somewhere
Done, 3 lines above ;D
Title: Re: Problem configuring csfml2 with cmake
Post by: mscofield on April 02, 2013, 03:27:00 pm
I meant somewhere during the installation process, since 100% of the people not familiar with cmake will need to know this.
Why not copy them automatically ?
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on April 02, 2013, 03:53:04 pm
Quote
I meant somewhere during the installation process, since 100% of the people not familiar with cmake will need to know this.
It was just a joke ;)

Quote
Why not copy them automatically ?
Permission issues on Linux.
Title: Re: Problem configuring csfml2 with cmake
Post by: mscofield on April 02, 2013, 04:55:00 pm
Quote
I meant somewhere during the installation process, since 100% of the people not familiar with cmake will need to know this.
It was just a joke ;)
^^'

Quote
Why not copy them automatically ?
Permission issues on Linux.
Well the permissions on /usr/share and /usr/local/share are the same by default (755, ie need root to write), aren't they ?
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on April 02, 2013, 06:53:51 pm
You will always find someone with less permissions than the "default". Especially students in universities.

In the past, the SFML installation copied FindSFML.cmake to the CMake directory, like you suggested. And this was removed because of permission problems on Linux (real users reporting real problems) ;)
Title: Re: Problem configuring csfml2 with cmake
Post by: FRex on April 02, 2013, 07:21:29 pm
Quote
You will always find someone with less permissions than the "default". Especially students in universities.
I'd like to add that from my experience this is usually very very lost cause. ;D
Title: Re: Problem configuring csfml2 with cmake
Post by: mscofield on April 02, 2013, 07:52:35 pm
Got it ;).
Title: Re: Problem configuring csfml2 with cmake
Post by: Shados on May 30, 2013, 02:10:25 pm
So, I gather from reading this thread that I should just be able to copy the FindSFML.cmake file to my cmake/Modules directory? Because when I do that and then run configure, I get:

CMake Error at C:/.../cmake-2.8.11-win32-x86/share/cmake-2.8/Modules/FindSFML.cmake:199 (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:27 (find_package)


Configuring incomplete, errors occurred!

Am I missing something here?
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on May 30, 2013, 02:17:16 pm
Where is SFML? If not in a standard path, did you define the SFML_ROOT CMake variable?
Title: Re: Problem configuring csfml2 with cmake
Post by: Shados on May 30, 2013, 02:18:36 pm
I let it install to the default path at C:\Program Files (x86)\SFML, I haven't set SFML_ROOT
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on May 30, 2013, 02:52:20 pm
Quote
I haven't set SFML_ROOT
You should. "C:\Program Files\SFML" is certainly not a standard path for your compiler ;)
Title: Re: Problem configuring csfml2 with cmake
Post by: Shados on May 30, 2013, 03:04:31 pm
Setting SFML_ROOT to C:\Program Files (x86)\SFML, where `mingw32-make install` installed SFML to by default, didn't help - I'm getting exactly the same error output. The DLLs & .a files are definitely in there under bin/ and lib/, respectively.
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on May 30, 2013, 03:06:43 pm
How did you set SFML_ROOT? Have you cleared the CMake cache and tried again from scratch?
Title: Re: Problem configuring csfml2 with cmake
Post by: Shados on May 30, 2013, 03:18:36 pm
Here's what I did (from cmake-gui, with source/build directories set):
1. File->Delete Cache
2. Hit configure
3. Add Entry -> Name: SFML_ROOT, Type: Path, Value: C:/Program Files (x86)/SFML, left 'Description' blank
4. Hit configure again, get error output posted previously

Is there any other information you might need?
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on May 30, 2013, 03:27:15 pm
You must define SFML_ROOT before configuring.
Title: Re: Problem configuring csfml2 with cmake
Post by: Shados on May 30, 2013, 03:30:26 pm
Alright, just tried deleting the cache & defining SFML_ROOT as before hitting configure, same error output q.q
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on May 30, 2013, 03:40:47 pm
Do you have a recent version of FindSFML.cmake? You should check inside if the name of the variable is SFML_ROOT; a while ago it was a different name.
Title: Re: Problem configuring csfml2 with cmake
Post by: Shados on May 30, 2013, 03:45:11 pm
Yep, the name of the variable used in FindSFML.cmake on my system is SFML_ROOT.

Just tested something a friend mentioned to me, and manually setting the SFML_..._LIBRARY_RELEASE variables to their respective .a file paths and the SFML_INCLUDE_DIR path appropriately does let the configure/generation process work, and I can compile from that. Hope that helps?
Title: Re: Problem configuring csfml2 with cmake
Post by: Laurent on May 30, 2013, 03:47:55 pm
Yes it works, but it's not a clean solution. find_package(SFML) should work.