SFML community forums
Help => General => Topic started by: Nexus on March 09, 2011, 07:58:14 pm
-
Hello, I am using Windows 7. My SFML installation directory has this structure:
# C:/Program Files/C++ Libraries/SFML
# include
# SFML
# lib
# sfml-window.lib
# sfml-window-d.lib
# bin
# sfml-window-2.dll
# sfml-window-d-2.dll
I have looked at the FindSFML module and written the following small script (CMakeFiles.txt) in order to find out the SFML paths:
cmake_minimum_required (VERSION 2.8)
project (Experiment)
set(SFMLDIR "C:/Program Files/C++ Libraries/SFML")
find_package(SFML REQUIRED)
message("Directory = ${SFMLDIR}")
message("Include = ${SFML_INCLUDE_DIR}")
message("Release = ${SFML_WINDOW_LIBRARY}")
message("Debug = ${SFML_WINDOW_LIBRARY_DEBUG}")
message("Libraries = ${SFML_LIBRARIES}")
When I run CMake in the directory of this file, I get the following output:
Found SFML: C:/Program Files/C++ Libraries/SFML/include
Directory = C:/Program Files/C++ Libraries/SFML
Include = C:/Program Files/C++ Libraries/SFML/include
Release =
Debug =
Libraries =
Configuring done
Why are the libraries not found? Do I have to initialize variables apart from SFMLDIR?
-
Try this:
find_package(SFML COMPONENTS window REQUIRED)
I guess I should set the components list to "all modules" if none is specified.
-
Thank you, this works :)
Is there a possibility to see whether a specific SFML component is available? The path seems not to be affected by the actual existence. I have tried SFML_window_FOUND, but as far as I see, you don't declare such a variable in FindSFML.cmake.
-
Is there a possibility to see whether a specific SFML component is available?
What about testing the corresponding library variable? Like SFML_WINDOW_LIBRARY for the window component.
-
I have tried that before, somehow I was stupid enough to just move the ".lib" files into the parent directory where they were still found :D
So that's okay now. By the way, a very low-priority issue: FindSFML.cmake contains an install rule with
PATTERN ".svn" EXCLUDE
The problem is, Windows 7 seems not to allow files/directories anymore that start with "." (or is it just me?). In TortoiseSVN, one can choose to use "_svn" instead, so maybe this is an option (I hope to escape "." correctly):
REGEX "\\.svn|_svn" EXCLUDE
Edit: ".svn" seems to be still allowed, however one cannot manually create such folders. However I remember having had problems with TurtoiseSVN because of this... But nevermind, it's probably not worth a change :)
-
You're right, I'll fix this ;)