-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
31 lines (23 loc) · 1.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cmake_minimum_required(VERSION 3.23)
project(sorting-visualizer)
add_subdirectory(${CMAKE_SOURCE_DIR}/external/sfml)
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_SOURCE_DIR}/include/imgui)
include_directories(${CMAKE_SOURCE_DIR}/external/sfml/include)
file(GLOB SOURCES ${CMAKE_SOURCE_DIR}/src/*.cpp)
file(GLOB HEADERS ${CMAKE_SOURCE_DIR}/include/*.h)
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
target_link_libraries(${PROJECT_NAME} sfml-graphics sfml-window sfml-system sfml-audio opengl32)
target_compile_definitions(${PROJECT_NAME} PRIVATE "INSTALL_DIR=\"${CMAKE_SOURCE_DIR}\"")
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-audio-2.dll ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-graphics-2.dll ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-network-2.dll ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-system-2.dll ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-window-2.dll ${CMAKE_BINARY_DIR}
)
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/external/sfml/extlibs/bin/x64/openal32.dll ${CMAKE_BINARY_DIR}
)