i am setting up a work environment for a school project on my windows computer. We are going to make a basic game using c++ and CLion. To make a game i need to use the SFML
I believe you are missing the link_directories()
call. You can use it like this:
link_directories("C:/Path_To_Library")
This should help solve your issue.
I have successfully configured SFML with CLion on Ubuntu 16.04 and I think it will be same for Window user also.
My project name is SFML_TEST so change every occurrence of SFML_TEST with your project name.
After the following statement
add_executable(SFML_TEST ${SOURCE_FILES})
Add following lines of code
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake_modules")
find_package(SFML REQUIRED system window graphics network audio)
if (SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(SFML_TEST ${SFML_LIBRARIES})
endif()
Create a new directory /path/to/CLionProjects/[project_name]/cmake_modules/FindSFML.cmake
my fix was, that I had to change the root path of SFML in the FindSFML.cmake
so just set(SFML_ROOT Z://your_project)
after the block of comments and you are ready to go