forked from asiekierka/iceball
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (61 loc) · 1.86 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required (VERSION 2.8.4)
project (iceball)
set(CMAKE_SOURCE_DIR src)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-fno-strict-aliasing -Wall -Wextra -g) # keep debugging symbols even in Release builds
endif ()
include_directories(include)
if (WIN32)
if (MSVC)
set_source_files_properties(filename.c PROPERTIES LANGUAGE CXX )
endif (MSVC)
endif (WIN32)
if (MINGW)
set(CMAKE_PREFIX_PATH "dist/mingw/enet;dist/mingw/sdl2;dist/mingw/lua51;dist/mingw/sackit;dist/mingw/zlib" CACHE PATH "" FORCE)
elseif (MSVC)
set(CMAKE_PREFIX_PATH "dist/msvc/enet;dist/msvc/sdl2;dist/msvc/lua51;dist/msvc/sackit;dist/msvc/zlib" CACHE PATH "" FORCE)
endif ()
find_package(ENet REQUIRED)
find_package(SDL2 REQUIRED)
find_package(zlib REQUIRED)
find_package(Lua REQUIRED)
find_package(sackit REQUIRED)
find_package(OpenGL REQUIRED)
include_directories(
${ENet_INCLUDE_DIRS}
${sackit_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${SDL2_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
)
file(GLOB LUA_FILES src/lua*)
set(MAIN_FILES
src/dsp.c
src/img.c
src/json.c
src/logtxt.c
src/main.c
src/map.c
src/model.c
src/network.c
src/path.c
src/png.c
src/random.c
src/vecmath.c
src/wav.c
)
set(GL_FILES
src/gl/glad.c
src/gl/render.c
src/gl/render_img.c
)
source_group(gl FILES ${GL_FILES})
source_group(lua FILES ${LUA_FILES})
# iceball target
add_executable(iceball ${MAIN_FILES} ${LUA_FILES} ${GL_FILES})
target_link_libraries(iceball ${ENet_LIBRARIES} ${ZLIB_LIBRARIES} ${sackit_LIBRARY} ${LUA_LIBRARIES} ${SDL2_LIBRARIES} ${OPENGL_LIBRARIES})
# iceball-dedi target
add_executable(iceball-dedi EXCLUDE_FROM_ALL ${MAIN_FILES} ${LUA_FILES})
target_link_libraries(iceball-dedi ${ENet_LIBRARIES} ${ZLIB_LIBRARIES} ${LUA_LIBRARIES} ${SDL_LIBRARY})
set_target_properties(iceball-dedi PROPERTIES COMPILE_DEFINITIONS "DEDI")