I have a project with the following structure:
projectName-master/
data/
source/
thirdparty/ (here is placed FindSFML.cmake file)
.gitignore
CMakeLists.txt
README.md
SOURCES.md
TODO.md
I use CMake 2.8.11.1 (cmake-gui) to generate visual studio sln file. Paths are set this way:
- where is the source code: E:/projectName-master
- where to build the binaries: E:/projectName-master/source (1.Can I choose other directory or it should be set to the directory which contains source files: h, cpp etc. ?)
Next I choose: Configure -> "Specify the generator for this project = Visual Studio 11, Use default native compilers" -> Finish
Then I get an info: Error in configuration process, project files may be invalid
CMake Gui contains following informations:
Name: CMAKE_INSTALL_PREFIX Value C:/Program Files(x86)/projectName Name: SFML_INCLUDE_DIR Value SFML_INCLUDE_DIR-NOTFOUND
CMake Error at thirdparty/FindSFML.cmake:165 (message):
Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
SFML_AUDIO_LIBRARY SFML_NETWORK_LIBRARY SFML_GRAPHICS_LIBRARY)
Call Stack (most recent call first):
CMakeLists.txt:63 (find_package)
I downloaded SFML and set SFML_INCLUDE_DIR (in CMake Gui): C:/OpenGL/SFML-2.1/include/SFML but I still get that error. 2. How to fix that ? What about lib files and dll's ?
Edit1: I downloaded SFML from the official site
FindSFML.cmake from the project doesn't contain any SFML_ROOT entry, but SFML_INCLUDE_DIR looks like this:
# find the SFML include directory
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
PATH_SUFFIXES include
PATHS
${SFMLDIR}
$ENV{SFMLDIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/
/usr/
/sw # Fink
/opt/local/ # DarwinPorts
/opt/csw/ # Blastwave
/opt/)
So how to set SFML_ROOT ? Do I need to add some entries (records) to that file ? How it will look like ?
Edit2: A part of the new FindSFML.cmake with a path to SFML (C:/OpenGL/SFML-2.1/)
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
PATH_SUFFIXES include
PATHS
${SFML_ROOT}
$ENV{SFML_ROOT}
C:/OpenGL/SFML-2.1/
~/Library/Frameworks
/Library/Frameworks
/usr/local/
/usr/
/sw # Fink
/opt/local/ # DarwinPorts
/opt/csw/ # Blastwave
/opt/)
First of all,
SFML
is not CMake standard module, so it would be nice to provide link to sources. I hope you mean this product. Take a look at the FindSFML file:So you probably simply need to set
SFML_ROOT
variable, but notSFML_INCLUDE_DIR
.I think this may be helpful:
It is highly recommended to use a separate directory.