SFML community forums
Bindings - other languages => C => Topic started by: RobotGymnast on March 07, 2011, 02:07:43 am
-
I've built the main SFML project as static libraries (but didn't move them to any special directories), then tried configuring the CSFML project in CMake. It tells me SFML_DIR isn't found; I tried manually setting it to the build output directory of the SFML project, as well as the lib subfolder, but clicking Configure again simply caused it to give the same error message and overwrite my changes.
Can somebody help?
-
Can you please show us the exact error message?
-
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
CMake Warning (dev) at cmake/Macros.cmake:87 (target_link_libraries):
Link library type specifier "optimized" is followed by specifier "debug"
instead of a library name. The first specifier will be ignored.
Call Stack (most recent call first):
src/SFML/System/CMakeLists.txt:24 (csfml_add_library)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at cmake/Macros.cmake:87 (target_link_libraries):
The "debug" argument must be followed by a library.
Call Stack (most recent call first):
src/SFML/System/CMakeLists.txt:24 (csfml_add_library)
Do I have to set path variables (sfml_inlcude and sfml_lib)? Is there no way to just set the variables inside CMake?
-
I don't like this CMake error message, I find it confusing for users who are not used to packages errors.
In fact you can ignore the hint given by CMake, this "configuration file" thing is never used, you must instead look at the comments in FindSFML.cmake to know what to do.
# If SFML is not installed in a standard path, you can use the SFMLDIR CMake variable
# to tell CMake where SFML is.
And make sure that FindSFML.cmake is installed into your CMake directory (this is done automatically if you installed SFML).
-
How does one "install" SFML? I'm running on Ubuntu, and the project generated only seems to build the libraries.
-
make install
By the way, everything that you need to know is explained in the tutorial.
-
Oh geez, apparently it's been way too long since I was on linux.
Oh, yes, I see it now, right at the bottom. I missed it before. Sorry, and thanks!
-
I don't like this CMake error message, I find it confusing for users who are not used to packages errors.
In fact you can ignore the hint given by CMake, this "configuration file" thing is never used, you must instead look at the comments in FindSFML.cmake to know what to do.
# If SFML is not installed in a standard path, you can use the SFMLDIR CMake variable
# to tell CMake where SFML is.
And make sure that FindSFML.cmake is installed into your CMake directory (this is done automatically if you installed SFML).
What are you supposed to do? Add an entry (tried it, didn't work)? This is seriously pissing me off, I hate CMake.
http://i.imgur.com/lHF9R.png
http://i.imgur.com/svf3H.png
-
Your SFMLDIR variable is ok, what's wrong is that you didn't install FindSFML.cmake. It must be copied to <cmake_install>\share\cmake-2.8\Modules (on Windows).