-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
executable file
·58 lines (50 loc) · 1.66 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
cmake_minimum_required(VERSION 3.11)
project(IndieStudio VERSION 0.1)
# set(CMAKE_VERBOSE_MAKEFILE ON)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "-W -Wall -Wextra")
endif()
# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_BUILD_TYPE Debug)
# modules
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
set(Irrlicht_DIR "${CMAKE_SOURCE_DIR}/modules/Irrlicht/")
set(SFMLAudio_DIR "${CMAKE_SOURCE_DIR}/modules/SFMLAudio/")
find_package(Irrlicht REQUIRED)
include_directories("${CMAKE_SOURCE_DIR}/include")
include_directories (${Irrlicht_INCLUDE_DIRS})
if(NOT WIN32)
message("Linux")
find_package(OpenGL REQUIRED)
find_package(SFML 2.5 COMPONENTS audio REQUIRED)
include_directories (${SFML_INCLUDE_DIR})
else()
find_package(SFMLAudio REQUIRED)
include_directories (${SFMLAudio_INCLUDE_DIRS})
endif()
# files
FILE(GLOB SRC
src/*.cpp
src/particle/*.cpp
src/interface/*.cpp
src/component/*.cpp
src/entity/*.cpp
src/class/*.cpp
src/scene/*.cpp
)
add_executable(bomberman
${SRC}
)
file(COPY "assets" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "save" DESTINATION ${CMAKE_BINARY_DIR})
if(WIN32)
file(COPY "${Irrlicht_DIR}/Irrlicht.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${SFMLAudio_DIR}/sfml-audio-d-2.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${SFMLAudio_DIR}/sfml-system-d-2.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${SFMLAudio_DIR}/openal32.dll" DESTINATION ${CMAKE_BINARY_DIR})
target_link_libraries(bomberman ${OPENGL_LIBRARIES} ${Irrlicht_LIBRARIES} ${SFMLAudio_LIBRARIES})
else()
target_link_libraries(bomberman ${OPENGL_LIBRARIES} ${Irrlicht_LIBRARIES} sfml-audio)
endif()