-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
60 lines (46 loc) · 1.31 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
59
# Specify the minimum CMAKE version required
cmake_minimum_required(VERSION 2.8)
# Your project's name
project(Community-Game)
# Make your header file accessible to the compiler
include_directories(include)
# Add all files from the source/ folder to CMake
file(GLOB_RECURSE SRC
"src/*.cpp"
"src/*.h"
"src/*.hpp"
)
# Define the executable
add_executable(${PROJECT_NAME} ${SRC})
include_directories(deps/SFML/include)
add_definitions(-DSFML_STATIC)
if(WIN32)
add_definitions( -D_CRT_SECURE_NO_WARNINGS )
endif()
enable_testing()
set(SFML_BUILD_DOC OFF CACHE BOOL "" FORCE)
set(SFML_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(CMAKE_BUILD_TYPE Debug)
add_subdirectory(deps/SFML)
#Lua include
set(LUA_SOURCE_DIR "deps/Lua/src")
include_directories(${LUA_SOURCE_DIR})
#LuaBridge include
include_directories(deps/LuaBridge)
#Lua build
add_subdirectory(${LUA_SOURCE_DIR})
# Copy static files
# Tired of manually copying it
file(COPY res/ DESTINATION Debug/res/)
target_link_libraries(${PROJECT_NAME} lualib sfml-network sfml-graphics sfml-window sfml-system sfml-audio)
# Enable C++ 14
if (NOT UNIX)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
else()
add_definitions(-std=c++14)
endif()