Fix CMake

This commit is contained in:
NaiJi ✨ 2021-01-09 11:50:26 +03:00
parent a766708147
commit 0d2143925f
1 changed files with 11 additions and 12 deletions

View File

@ -6,21 +6,20 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(SOURCES application.cpp board.cpp main.cpp) set(SOURCES application.cpp board.cpp main.cpp)
set(HEADER_FILES application.h board.h filepath_util.h output_util.h) set(HEADER_FILES application.h board.h filepath_util.h output_util.h)
add_executable(sliding-puzzle ${SOURCES} ${HEADER_FILES})
# STATIC # # STATIC #
# You need to build SFML from sources with cmake # You need to build SFML from sources with cmake
set(SFML_LIB_DIR #set(SFML_LIB_DIR
${CMAKE_SOURCE_DIR}/SFML-2.5.1/lib/libsfml-graphics.so.2.5 # ${CMAKE_SOURCE_DIR}/SFML-2.5.1/lib/libsfml-graphics.so.2.5
${CMAKE_SOURCE_DIR}/SFML-2.5.1/lib/libsfml-system.so.2.5 # ${CMAKE_SOURCE_DIR}/SFML-2.5.1/lib/libsfml-system.so.2.5
${CMAKE_SOURCE_DIR}/SFML-2.5.1/lib/libsfml-window.so.2.5) # ${CMAKE_SOURCE_DIR}/SFML-2.5.1/lib/libsfml-window.so.2.5)
set(SFML_INCL_DIR ${CMAKE_SOURCE_DIR}/SFML-2.5.1/include) #set(SFML_INCL_DIR ${CMAKE_SOURCE_DIR}/SFML-2.5.1/include)
include_directories(${SFML_INCL_DIR}) #include_directories(${SFML_INCL_DIR})
add_executable(sliding-puzzle ${SOURCES} ${HEADER_FILES} ) #add_executable(sliding-puzzle ${SOURCES} ${HEADER_FILES} )
target_link_libraries(sliding-puzzle ${SFML_LIB_DIR}) #target_link_libraries(sliding-puzzle ${SFML_LIB_DIR})
# DYNAMIC # # DYNAMIC #
# You only need to install SFML from your package manager # You only need to install SFML from your package manager
#find_package(SFML REQUIRED graphics window system) find_package(SFML REQUIRED graphics window system)
#include_directories(${SFML_INCLUDE_DIR}) target_link_libraries(sliding-puzzle sfml-system sfml-graphics sfml-network)
#target_link_libraries(sliding-puzzle ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
#add_executable(sliding-puzzle ${SOURCES} ${HEADER_FILES} )