forked from wheybags/freeablo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
122 lines (99 loc) · 2.84 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
cmake_minimum_required (VERSION 2.8.11)
project (Freeablo)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "/usr/local/lib/libtomcrypt.a")
set(FREETYPE_INCLUDE_DIRS "/usr/local/Cellar/freetype/2.5.3_1/include/freetype2")
endif()
Find_Package(SDL2 REQUIRED)
Find_Package(SDL2_image REQUIRED)
Find_Package(SDL2_mixer REQUIRED)
Find_Package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
Find_Package(OpenGL REQUIRED)
Find_Package(PythonLibs 2 REQUIRED)
Find_package(LibRocket REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Enet REQUIRED)
if (Qt5_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set(FA_COMPILER_FLAGS "")
if(NOT WIN32)
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 ()
else()
add_definitions(-DNOMINMAX) # http://stackoverflow.com/questions/5004858/stdmin-gives-error
endif()
find_package(Boost COMPONENTS filesystem serialization system program_options python date_time regex REQUIRED)
if ( NOT SDL2_FOUND )
message ( FATAL_ERROR "SDL2 not found!" )
endif ()
if(UNIX)
set(FA_COMPILER_FLAGS "${FA_COMPILER_FLAGS} -Wall -pedantic -Wextra -g -std=c++11 -Wno-unknown-pragmas")
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
endif()
include_directories ( SYSTEM
${Boost_INCLUDE_DIR}
${SDL2_INCLUDE_DIR}
${SDL2IMAGE_INCLUDE_DIR}
${SDL2MIXER_INCLUDE_DIR}
${OPENGL_INCLUDE_DIRS}
${PNG_INCLUDE_DIR}
${PYTHON_INCLUDE_DIR}
${ROCKET_INCLUDE_DIR}
${Qt5Widgets_INCLUDE_DIRS}
${ENET_INCLUDE_DIR}
"${PROJECT_SOURCE_DIR}/extern/StormLib/src/"
)
include_directories("${PROJECT_SOURCE_DIR}/components/")
# allow the user to specify extra include dirs and defines on the command line
if(CLI_INCLUDE_DIRS)
include_directories(${CLI_INCLUDE_DIRS})
endif()
if(CLI_DEFINES)
add_definitions(${CLI_DEFINES})
endif()
add_subdirectory (extern)
link_libraries(StormLib)
add_subdirectory (components)
link_libraries (
${SDL2_LIBRARY}
${SDL2IMAGE_LIBRARY}
${SDL2MIXER_LIBRARY}
${PNG_LIBRARY}
${OPENGL_LIBRARIES}
${ROCKET_LIBRARIES}
${PYTHON_LIBRARIES}
${Boost_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${ENET_LIBRARY}
Cel
FAIO
Levels
Misc
Render
Input
DiabloExe
StormLib
Audio
Settings
Script
Serial
)
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)
add_subdirectory(apps/launcher)
add_subdirectory(apps/fontgenerator)
add_subdirectory(apps/findpath)
add_subdirectory(test)