1
C / Why can't CMAKE find my SFML libraries in CLion?
« on: June 12, 2016, 01:07:40 pm »
Hey, I'm trying to use CLion with SFML, which means I have to use CMake. This is my CMakeLists.txt file:
Any help would be appreciated.
cmake_minimum_required(VERSION 2.6)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()
project(Polymorphism)
set(SOURCE_FILES main.cpp)
add_executable(Polymorphism ${SOURCE_FILES})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Modules" ${CMAKE_MODULE_PATH})
find_package(SFML REQUIRED system window graphics network audio)
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${main.cpp} ${SFML_LIBRARIES})
endif()
This is the error I am getting:if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()
project(Polymorphism)
set(SOURCE_FILES main.cpp)
add_executable(Polymorphism ${SOURCE_FILES})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Modules" ${CMAKE_MODULE_PATH})
find_package(SFML REQUIRED system window graphics network audio)
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${main.cpp} ${SFML_LIBRARIES})
endif()
Error:Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)
Any help would be appreciated.