I want to test SFML2 with a CMake-only project, so I just write this:
cmake_minimum_required( VERSION 2.8 )
project( game )
add_subdirectory( sfml )
set( GAME_ALL_SOURCES
main.cpp
)
add_executable( game ${GAME_ALL_SOURCES} )
target_link_libraries( sfml-main sfml-system sfml-window sfml-graphics sfml-audio )
My sfml folder contain the current sfml git repository clone.
Without the last line I got no error, but with the last line I got:
CMake Error at CMakeLists.txt:13 (target_link_libraries):
Attempt to add link library "sfml-system" to target "sfml-main" which is
not built in this directory.
CMake Error at CMakeLists.txt:13 (target_link_libraries):
Attempt to add link library "sfml-window" to target "sfml-main" which is
not built in this directory.
CMake Error at CMakeLists.txt:13 (target_link_libraries):
Attempt to add link library "sfml-graphics" to target "sfml-main" which is
not built in this directory.
CMake Error at CMakeLists.txt:13 (target_link_libraries):
Attempt to add link library "sfml-audio" to target "sfml-main" which is not
built in this directory.
I'm not sure what I'm doing wrong here... ?
It looks like the sfml projects can't refer to each other once I've included the projects this way.
I dont understand... is the problem from my CMake script, or from CMake or from the SFML CMake scripts?