forked from wheybags/freeablo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
79 lines (61 loc) · 1.62 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
74
75
76
77
78
79
cmake_minimum_required (VERSION 2.6)
project (Freeablo)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
option(USE_SDL2 "use SDL2 instead of SDL1" ON)
if(USE_SDL2)
message(STATUS "Using SDL2")
Find_Package ( SDL2 REQUIRED )
set(SDL_FOUND ${SDL2_FOUND})
set(SDL_LIBRARY ${SDL2_LIBRARY})
set(SDL_INCLUDE_DIR ${SDL2_INCLUDE_DIR})
else()
message(STATUS "Using SDL1")
Find_Package ( SDL REQUIRED )
endif()
if(WIN32)
set(Boost_USE_STATIC_LIBS ON)
else()
Find_Package ( ZLIB REQUIRED )
Find_Package ( BZip2 REQUIRED )
if ( NOT ZLIB_FOUND )
message ( FATAL_ERROR "ZLIB not found!" )
endif ()
if ( NOT BZIP2_FOUND )
message ( FATAL_ERROR "BZip2 not found!" )
endif ()
endif()
find_package(Boost COMPONENTS chrono date_time filesystem system random thread program_options atomic REQUIRED)
if ( NOT SDL_FOUND )
message ( FATAL_ERROR "SDL not found!" )
endif ()
if(UNIX)
set(FA_COMPILER_FLAGS "-Wall -pedantic -Wextra")
else()
set(FA_COMPILER_FLAGS "")
endif()
include_directories (
${SDL_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
"${PROJECT_SOURCE_DIR}/components/"
"${PROJECT_SOURCE_DIR}/extern/StormLib/src/"
)
add_subdirectory (extern)
link_libraries(StormLib)
add_subdirectory (components)
link_libraries (
${SDL_LIBRARY}
${Boost_LIBRARIES}
Cel
FAIO
Levels
Misc
Render
Input
DiabloExe
StormLib
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(apps/freeablo)
add_subdirectory(apps/celview)
add_subdirectory(apps/mpqtool)
add_subdirectory(apps/exedump)