Not able to link SFML libraries with Cmake to C++ visual studio

  c++, c++17, cmake, sfml, visual-studio

I’ve been trying to compile SFML libraries on Visual studio using Cmake project. I’ve downloaded VCPKG and extracted SFML 64bit version of it (both bin and lib files) in my working directory (Dijakstra2). Then I tried to link libraries through cmake and when I’m trying to generate cmakelists.txt it gives an error:

Severity    Code    Description Project File    Line    Suppression State
--->Error       CMake Error at Dijakstra2/CMakeLists.txt:15 (set_property):
  set_property not given a PROPERTY <name> argument.        C:UsersnareksourcereposDijakstra2Dijakstra2/CMakeLists.txt    15  
# CMakeList.txt : CMake project for Dijakstra2, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.8)

# Add source to this project's executable.
add_executable (Dijakstra2 "Dijakstra2.cpp" "Dijakstra2.h")
target_link_libraries(Dijakstra2 $(CMAKE_SOURCE_DIR)/library/sfml-graphics.lib)
target_link_libraries(Dijakstra2 $(CMAKE_SOURCE_DIR)/library/sfml-audio.lib)
target_link_libraries(Dijakstra2 $(CMAKE_SOURCE_DIR)/library/sfml-system.lib)
target_link_libraries(Dijakstra2 $(CMAKE_SOURCE_DIR)/library/sfml-window.lib)

include_directories ($(CMAKE_SOURCE_DIR)/include)
set_property (TARGET Dijakstra2 PROPERTY CXX_STANDARD 17)
set_property (TARGET Dijakstra2 CXX_STANDARD_REQUIRED ON)
# TODO: Add tests and install targets if needed.

Source: Windows Questions C++

LEAVE A COMMENT