-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
35 lines (27 loc) · 1.45 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
32
33
34
35
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}\"")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(DLL_POSTFIX "-d")
else()
set(DLL_POSTFIX "")
endif()
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-audio${DLL_POSTFIX}-2.dll ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-graphics${DLL_POSTFIX}-2.dll ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-system${DLL_POSTFIX}-2.dll ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/external/sfml/lib/sfml-window${DLL_POSTFIX}-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}
)