Hi Nexus,
thank you for your reply. I've already tried this before starting this thread, the CMakeLists.txt looks like the following:
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project("Test")
set(SOURCE_FILES
src/main.cpp
)
set(SFML_STATIC_LIBRARIES TRUE)
set(SFML_DIR "libs/sfml/")
find_package(SFML 2.5 COMPONENTS audio graphics window system REQUIRED)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} sfml-graphics)
target_link_libraries(${PROJECT_NAME} sfml-audio)
But the problem is (at least I think so) that find_package does not trigger any build process, so the SFMLConfig.cmake is not created from the SFMLConfig.cmake.in.
I should clarify that I want to integrate the SFML build process into my project. I don't like to build SFML manually in it's subfolder before I can start building my main project. I'd like to clone my project's repository, including SFML as a submodule, hit the 'build' button once and everything should be build automatically (First SFML, then my project).
As far as I understand, find_package only works if SFML was build beforehand (or at least the SFMLConfig.cmake has to be created). But I could also be absolutely wrong, unfortunately I didn't do that much with CMake yet.
To make this post complete, here's the CMake error message using the above posted CMakeLists.txt:
CMake Error at CMakeLists.txt:12 (find_package):
By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SFML", but
CMake did not find one.
Could not find a package configuration file provided by "SFML" (requested
version 2.5) with any of the following names:
SFMLConfig.cmake
sfml-config.cmake
Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
"SFML_DIR" to a directory containing one of the above files. If "SFML"
provides a separate development package or SDK, be sure it has been
installed.