Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 1033 lines (878 sloc) 30.954 kB
6dd3c00 @dscharrer [cmake] Relax minimum CMake version requirement for non-MSVC compilers.
dscharrer authored
1 project(ArxLibertatis)
2
3 if(MSVC)
4 # CMake 2.8.5 or newer is needed for CMAKE_LIBRARY_ARCHITECTURE support.
5 cmake_minimum_required(VERSION 2.8.5)
6 # Change CMAKE_LIBRARY_ARCHITECTURE to ensure the right libs are used
7 if(CMAKE_CL_64)
8 set(CMAKE_LIBRARY_ARCHITECTURE "x64")
9 else()
10 set(CMAKE_LIBRARY_ARCHITECTURE "x86")
11 endif(CMAKE_CL_64)
12 else()
13 cmake_minimum_required(VERSION 2.8)
14 endif()
9c3e84d @lubosz stubby cmake build
lubosz authored
15
cbf67dd @dscharrer Use boost::filesystem to load non-packed asset files.
dscharrer authored
16 # For custom cmake modules.
17 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
18
12825f4 @dscharrer Check size of char in CMakeLists.txt
dscharrer authored
19 include(CheckTypeSize)
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
20 include(CheckSymbolExists)
21 include(CheckCXXSourceCompiles)
22
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
23 include(BuildSystem)
cbf67dd @dscharrer Use boost::filesystem to load non-packed asset files.
dscharrer authored
24 include(CompileCheck)
1ea3ead @dscharrer Automatically generate a version string at build time.
dscharrer authored
25 include(VersionString)
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
26 include(StyleCheck)
27 include(PrintConfiguration)
28 include(CreateSourceGroups)
5c2d73a @SebastienLussier Fixed VC2010 warnings/errors/projects
SebastienLussier authored
29
1f84e23 @SebastienLussier Added support for unity build (set env var "ARX_USE_UNITYBUILD=1" to …
SebastienLussier authored
30 ##############################################################################
31
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
32 option(BUILD_TESTS "Build tests" OFF)
33 option(BUILD_TOOLS "Build tools" ON)
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
34 option(BUILD_CRASHREPORTER "Build the crash reporter" ON)
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
35 option(BUILD_EDITOR "Build editor" OFF)
36 option(BUILD_EDIT_LOADSAVE "Build save/load functions only used by the editor" ON)
37 option(UNITY_BUILD "Unity build" OFF)
38 option(DEBUG_EXTRA "Expensive debug options" OFF)
39 option(USE_OPENAL "Build the OpenAL audio backend." ON)
40 option(USE_DSOUND "Build the DirectSound audio backend." ON)
41 option(USE_OPENGL "Build the OpenGL renderer backend." ON)
42 option(USE_D3D9 "Build the Direct3D 9 renderer backend." ON)
43 option(USE_SDL "Build the SDL windowing backend." ON)
44 option(USE_DINPUT8 "Build the DirectInput 8 input backend." ON)
6d193a3 @dscharrer Add a USE_NATIVE_FS cmake flag to allow testing the boost::filesystem…
dscharrer authored
45 option(USE_NATIVE_FS "Use the native (POSIX / Win32) filesystem backend instead of boost." ON)
e067d34 @dscharrer Add a ARX_FORCE_32BIT option to force a 32-bit build on 64-bit systems.
dscharrer authored
46
7de379a @dscharrer Disable DirectX backends on linux; remove the ARX_FORCE_32BIT option;…
dscharrer authored
47 if((NOT LAST_CMAKE_CXX_FLAGS STREQUAL CMAKE_CXX_FLAGS) OR (NOT LAST_CMAKE_CXX_COMPILER STREQUAL CMAKE_CXX_COMPILER))
e067d34 @dscharrer Add a ARX_FORCE_32BIT option to force a 32-bit build on 64-bit systems.
dscharrer authored
48 force_recheck_library(DevIL IL)
49 force_recheck_library(ZLIB)
50 force_recheck_library(Freetype)
51 force_recheck_library(Threads)
3d874d1 @dscharrer Check if we can actually link against teh found OpenAL library.
dscharrer authored
52 force_recheck_library(OpenAL)
c5fb0d8 @dscharrer Check if we can link against the OpenGL library.
dscharrer authored
53 force_recheck_library(OpenGL)
d140a05 @dscharrer Start implementing OpenGLRenderer.
dscharrer authored
54 force_recheck_library(GLEW)
519b7f1 @dscharrer Add Boost as a dependency.
dscharrer authored
55 force_recheck_library(Boost)
276f796 @dscharrer CMake: Check for OpenSSL and Qt library architecture compatibility on…
dscharrer authored
56 force_recheck_library(QtCore QT_QTCORE)
57 force_recheck_library(QtGui QT_QTGUI)
4d7cf61 @SebastienLussier Crash reporter now creates issues on the bug tracker
SebastienLussier authored
58 force_recheck_library(QtNetwork QT_QTNETWORK)
519b7f1 @dscharrer Add Boost as a dependency.
dscharrer authored
59 unset(Boost_INCLUDE_DIR CACHE)
7de379a @dscharrer Disable DirectX backends on linux; remove the ARX_FORCE_32BIT option;…
dscharrer authored
60 set(LAST_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE INTERNAL "The last C++ compiler flags.")
61 set(LAST_CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER}" CACHE INTERNAL "The last C++ compiler.")
e067d34 @dscharrer Add a ARX_FORCE_32BIT option to force a 32-bit build on 64-bit systems.
dscharrer authored
62 endif()
a36e2b1 @SebastienLussier Sort the unity build files list + changed ARX_USE_UNITYBUILD to a cma…
SebastienLussier authored
63
1c5f4e9 @dscharrer Fix wine build.
dscharrer authored
64 if(WINE)
65 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U_WIN32 -U__CYGWIN__ -U__WIN32__ -UWIN32")
66 set(HAVE_WINAPI 1)
67 elseif(WIN32)
e544dd3 @dscharrer Fix mingw32 build.
dscharrer authored
68 if(NOT MSVC)
69 # We need to define WINVER for MinGW32 when requiring anything newer than Win95 / WinNT
70 add_definitions(-DWINVER=0x0500) # Require at least Windows 2000
71 endif()
8a115ab @dscharrer Don't check for OpenGL libraries when using winelib.
dscharrer authored
72 set(HAVE_WINAPI 1)
73 else()
74 set(HAVE_WINAPI 0)
75 endif()
76
77 if(NOT HAVE_WINAPI)
78 # The is no DirectX under linux
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
79 set(USE_D3D9 OFF)
80 set(USE_DSOUND OFF)
81 set(USE_DINPUT8 OFF)
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
82 else()
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
83 if(USE_D3D9 OR USE_DINPUT8)
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
84 find_package(DirectX REQUIRED)
85 endif()
8a115ab @dscharrer Don't check for OpenGL libraries when using winelib.
dscharrer authored
86 endif()
87
9ca39c4 @SebastienLussier Added freetype using find_package() in CMakeList.txt
SebastienLussier authored
88 find_package(Freetype REQUIRED)
734fab0 @dscharrer Use find_package in CMakeLists.txt instead of hardcoding library name…
dscharrer authored
89 find_package(DevIL REQUIRED)
90 find_package(ZLIB REQUIRED)
91 find_package(Threads REQUIRED)
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
92 if(USE_OPENGL)
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
93 find_package(OpenGL)
94 find_package(GLEW)
c105d07 @dscharrer Make building the OpenGLRenderer optional, disabled by default.
dscharrer authored
95 endif()
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
96 if(USE_OPENAL)
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
97 find_package(OpenAL 1.1)
b43b234 @dscharrer Make the OpenAL effect extension optional so we can build against old…
dscharrer authored
98 find_package(OpenALEFX)
41d57f0 @dscharrer Make building the OpenAL and DirectSound backends optional.
dscharrer authored
99 endif()
734fab0 @dscharrer Use find_package in CMakeLists.txt instead of hardcoding library name…
dscharrer authored
100 find_package(Doxygen)
101 find_package(PythonInterp)
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
102 if(USE_SDL)
1c49525 @SebastienLussier Updated CMakeLists.txt to add 64-bit support under Windows + misc cha…
SebastienLussier authored
103 set(SDL_BUILDING_LIBRARY 1) # Required to avoid linking with SDLmain...
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
104 find_package(SDL 1.2 EXACT)
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
105 endif()
734fab0 @dscharrer Use find_package in CMakeLists.txt instead of hardcoding library name…
dscharrer authored
106
8c6e31b @SebastienLussier Link statically with Boost under msvc
SebastienLussier authored
107 if(MSVC)
108 # Link statically with Boost under Windows
109 set(Boost_USE_STATIC_LIBS ON)
110 endif(MSVC)
b574763 @dscharrer Add a POSIX filesystem implementation that will be used if Boost file…
dscharrer authored
111
b2c3ef7 @dscharrer Add a separate fs::path class for filesystem paths.
dscharrer authored
112 set(BOOST_COMPONENTS program_options)
bde3224 @dscharrer Clarify required boost version.
dscharrer authored
113 find_package(Boost 1.39 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
734fab0 @dscharrer Use find_package in CMakeLists.txt instead of hardcoding library name…
dscharrer authored
114
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
115 set(HAVE_CRASHREPORTER 0)
116 if(BUILD_CRASHREPORTER)
117 # Needed by the crash reporter
01cf618 @dscharrer CMake: Remove OpenSSL dependency.
dscharrer authored
118 add_definitions(-DQT_NO_DEBUG)
119 find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork)
120 if(QT_FOUND)
121 if(MSVC)
122 find_package(DbgHelp)
123 if(DBGHELP_FOUND)
a9fc7cf @dscharrer CMake: Fix and cleanup capability checking for the POSIX crash handle…
dscharrer authored
124 set(HAVE_CRASHREPORTER 1)
125 include(${QT_USE_FILE})
126 endif()
01cf618 @dscharrer CMake: Remove OpenSSL dependency.
dscharrer authored
127 endif()
128 set(HAVE_CRASHREPORTER 1)
129 include(${QT_USE_FILE})
130 endif()
131 else()
132 remove_definitions(-DQT_DEBUG)
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
133 endif()
134
734fab0 @dscharrer Use find_package in CMakeLists.txt instead of hardcoding library name…
dscharrer authored
135 mark_as_advanced(IL_INCLUDE_DIR)
136 mark_as_advanced(ILUT_LIBRARIES)
137 mark_as_advanced(ILU_LIBRARIES)
138 mark_as_advanced(IL_LIBRARIES)
3e661ac @lubosz options for not buildings tests and tools
lubosz authored
139
7a4b058 @lubosz fixed formatting and include folder
lubosz authored
140 set(SRC_DIR src)
5c2d73a @SebastienLussier Fixed VC2010 warnings/errors/projects
SebastienLussier authored
141
1c49525 @SebastienLussier Updated CMakeLists.txt to add 64-bit support under Windows + misc cha…
SebastienLussier authored
142 if(MSVC)
9c8ee72 Now builds under Windows with MSVC. Removed a lot of warnings, but a …
slussier authored
143 # Disable deprecation warnings
90b2db2 @SebastienLussier Updated CMakeLists.txt to generate nicer vs project
SebastienLussier authored
144 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
9c8ee72 Now builds under Windows with MSVC. Removed a lot of warnings, but a …
slussier authored
145 add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
a918ef4 @SebastienLussier Fixed sources groups to fit new folder structure
SebastienLussier authored
146 add_definitions(-D_SCL_SECURE_NO_WARNINGS)
4ef1483 @SebastienLussier Use boost auto linking feature when building with MSVC
SebastienLussier authored
147 add_definitions(/wd4995) # 'func': name was marked as #pragma deprecated
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
148
d0d4145 @SebastienLussier * Switched to lowercase types (ex: s32 instead of S32)
SebastienLussier authored
149 # TEMP - disable warning caused by the F2L removal
4ef1483 @SebastienLussier Use boost auto linking feature when building with MSVC
SebastienLussier authored
150 add_definitions(/wd4244) # Conversion from 'float' to 'long', possible loss of data
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
151
1c49525 @SebastienLussier Updated CMakeLists.txt to add 64-bit support under Windows + misc cha…
SebastienLussier authored
152 # TEMP - disable warning caused by conversion from a 64-bit type to a 32-bit one...
153 if(CMAKE_CL_64)
e06a3ea @SebastienLussier Disable warning C4201: nonstandard extension used : nameless struct/u…
SebastienLussier authored
154 add_definitions(/wd4267) # Conversion from 'size_t' to 'xxx', possible loss of data
1c49525 @SebastienLussier Updated CMakeLists.txt to add 64-bit support under Windows + misc cha…
SebastienLussier authored
155 endif()
0a51801 @SebastienLussier msvc - Removed some costly checks when building without ARX_DEBUG_EXTRA
SebastienLussier authored
156
43e7630 @SebastienLussier Disabled warning C4127: conditional expression is constant
SebastienLussier authored
157 add_definitions(/wd4127) # warning C4127: conditional expression is constant
e06a3ea @SebastienLussier Disable warning C4201: nonstandard extension used : nameless struct/u…
SebastienLussier authored
158 add_definitions(/wd4201) # warning C4201: nonstandard extension used : nameless struct/union
f2175e5 @SebastienLussier Disable warning related to long decorated name
SebastienLussier authored
159 add_definitions(/wd4503) # warning C4503: 'xxx' : decorated name length exceeded, name was truncated
43e7630 @SebastienLussier Disabled warning C4127: conditional expression is constant
SebastienLussier authored
160
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
161 if(NOT DEBUG_EXTRA)
0a51801 @SebastienLussier msvc - Removed some costly checks when building without ARX_DEBUG_EXTRA
SebastienLussier authored
162 add_definitions(-D_HAS_ITERATOR_DEBUGGING=0)
163 add_definitions(-D_SECURE_SCL=0)
164 add_definitions(-D_SECURE_SCL_THROWS=0)
165 add_definitions(-D_ITERATOR_DEBUG_LEVEL=0)
166 endif()
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
167
1d0faae @SebastienLussier Disabled exception handling and RTTI
SebastienLussier authored
168 # Disable exceptions & rtti
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
169 add_definitions(/GR-) # No RTTI
170
171 # Enable multiprocess build
172 add_definitions(/MP)
43619b9 @SebastienLussier Define _WIN32_WINNT=0x502 so that we get errors when trying to use so…
SebastienLussier authored
173
174 # Ensure we aren't using functionalities not found under Window XP SP1
175 add_definitions(-D_WIN32_WINNT=0x0502)
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
176
9b4702b @SebastienLussier Modified options when building the release target with MSVC
SebastienLussier authored
177 foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE)
fd62179 @SebastienLussier Disable run time checks when building with MSVC
SebastienLussier authored
178 # Disable Run time checks
179 string(REGEX REPLACE "/RTC1" "" ${flag_var} "${${flag_var}}")
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
180
1c49525 @SebastienLussier Updated CMakeLists.txt to add 64-bit support under Windows + misc cha…
SebastienLussier authored
181 # Change runtime library from "Multi-threaded Debug DLL" to "Multi-threaded DLL"
4ef1483 @SebastienLussier Use boost auto linking feature when building with MSVC
SebastienLussier authored
182 string(REGEX REPLACE "/MDd" "/MD" ${flag_var} "${${flag_var}}")
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
183
184 # Remove definition of _DEBUG as it might conflict with libs we're linking with
5004296 @dscharrer Fix some mingw32 compile issues.
dscharrer authored
185 string(REGEX REPLACE "/D_DEBUG" "/DNDEBUG" ${flag_var} "${${flag_var}}")
34f6a24 @SebastienLussier MSVC now builds with warning level 4
SebastienLussier authored
186
187 # Force to always compile with warning level 4
188 string(REGEX REPLACE "/W[0-4]" "/W4" ${flag_var} "${${flag_var}}")
1c49525 @SebastienLussier Updated CMakeLists.txt to add 64-bit support under Windows + misc cha…
SebastienLussier authored
189 endforeach(flag_var)
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
190
1c49525 @SebastienLussier Updated CMakeLists.txt to add 64-bit support under Windows + misc cha…
SebastienLussier authored
191 # Avoid warning during link
192 set(CMAKE_EXE_LINKER_FLAGS /NODEFAULTLIB:LIBCMT)
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
193
9b4702b @SebastienLussier Modified options when building the release target with MSVC
SebastienLussier authored
194 # Enable compiler optimization in release
195 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox /Oi /Ot /GL /arch:SSE2 /GS- /fp:fast")
196
197 # Enable linker optimization in release
198 # /OPT:REF Eliminate unreferenced code
199 # /OPT:ICF COMDAT folding (merge functions generating the same code)
200 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF /LTCG")
201
c12620a @SebastienLussier Workaround for strange logic in FindOpenSSL (Windows only)
SebastienLussier authored
202 # This is needed to use ZLIB
1c49525 @SebastienLussier Updated CMakeLists.txt to add 64-bit support under Windows + misc cha…
SebastienLussier authored
203 add_definitions(-DZLIB_WINAPI)
517854a @SebastienLussier Enable multiprocess build (/MP)
SebastienLussier authored
204
ab07b50 @dscharrer Use consistent casing in CMakeLists.txt
dscharrer authored
205 else(MSVC)
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
206
8449180 @dscharrer Fix compile errors in 64-bit build.
dscharrer authored
207 # Check the dependencies so there won't by cryptic link errors later on when found libraries have the wrong architecture (32- vs. 64-bit)
822c9c0 @dscharrer Fix support for non-wine, non-msvc compilers (like mingw) in CMakeLis…
dscharrer authored
208 if(CMAKE_THREAD_LIBS_INIT)
209 check_link_library(Threads CMAKE_THREAD_LIBS_INIT)
210 endif()
26f3a28 @dscharrer If we cannot link to the exact libraries found by cmake try linking a…
dscharrer authored
211 check_link_library(DevIL IL_LIBRARIES IL)
212 check_link_library(ZLIB ZLIB_LIBRARIES)
213 check_link_library(Freetype FREETYPE_LIBRARIES)
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
214 if(USE_OPENAL AND OPENAL_FOUND)
41d57f0 @dscharrer Make building the OpenAL and DirectSound backends optional.
dscharrer authored
215 check_link_library(OpenAL OPENAL_LIBRARY)
216 endif()
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
217 if(USE_OPENGL AND OPENGL_FOUND)
cc9c840 @dscharrer Remove the GLU dependency for the OpenGL renderer.
dscharrer authored
218 check_link_library(OpenGL OPENGL_gl_LIBRARY)
d140a05 @dscharrer Start implementing OpenGLRenderer.
dscharrer authored
219 check_link_library(GLEW GLEW_LIBRARIES)
c105d07 @dscharrer Make building the OpenGLRenderer optional, disabled by default.
dscharrer authored
220 endif()
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
221 if(USE_SDL AND SDL_FOUND)
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
222 check_link_library(SDL SDL_LIBRARY)
223 endif()
734fab0 @dscharrer Use find_package in CMakeLists.txt instead of hardcoding library name…
dscharrer authored
224
276f796 @dscharrer CMake: Check for OpenSSL and Qt library architecture compatibility on…
dscharrer authored
225 if(HAVE_CRASHREPORTER)
226 check_link_library(QtCore QT_QTCORE_LIBRARY_RELEASE QT_QTCORE)
227 check_link_library(QtGui QT_QTGUI_LIBRARY_RELEASE QT_QTGUI)
4d7cf61 @SebastienLussier Crash reporter now creates issues on the bug tracker
SebastienLussier authored
228 check_link_library(QtNetwork QT_QTNETWORK_LIBRARY_RELEASE QT_QTNETWORK)
276f796 @dscharrer CMake: Check for OpenSSL and Qt library architecture compatibility on…
dscharrer authored
229 endif()
230
d61b3e8 @dscharrer CMake: Always define -D_POSIX_C_SOURCE=200809L and -D_XOPEN_SOURCE=60…
dscharrer authored
231 set(CMAKE_REQUIRED_DEFINITIONS "-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600")
232 add_definitions(-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600)
233
8460870 @dscharrer [cmake] Don't try to link -lrt when looking for nanosleep.
dscharrer authored
234 check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP_FUNC)
235
8ed9392 @dscharrer Implement setting the thread name under non-windows systems and inclu…
dscharrer authored
236 check_symbol_exists(pthread_setname_np "pthread.h" HAVE_PTHREAD_SETNAME_NP)
237 check_symbol_exists(pthread_set_name_np "pthread.h" HAVE_PTHREAD_SET_NAME_NP)
238 check_symbol_exists(prctl "sys/prctl.h" HAVE_PRCTL)
239 check_symbol_exists(PR_SET_NAME "linux/prctl.h" HAVE_PR_SET_NAME)
240
15b454e @dscharrer crashreporter: Fill in system information under linux.
dscharrer authored
241 check_symbol_exists(uname "sys/utsname.h" HAVE_UNAME)
242 check_symbol_exists(getrusage "sys/resource.h" HAVE_GETRUSAGE)
8ed9392 @dscharrer Implement setting the thread name under non-windows systems and inclu…
dscharrer authored
243
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
244 set(CMAKE_REQUIRED_LIBRARIES "-lrt")
245 check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
246 unset(CMAKE_REQUIRED_LIBRARIES)
8460870 @dscharrer [cmake] Don't try to link -lrt when looking for nanosleep.
dscharrer authored
247 if(HAVE_CLOCK_GETTIME)
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
248 set(TIME_LIBRARIES "-lrt")
8460870 @dscharrer [cmake] Don't try to link -lrt when looking for nanosleep.
dscharrer authored
249 elseif(NOT HAVE_WINAPI)
e6284eb @dscharrer Time: Implement Time::getMs() and Time::getUs() for Mac OS X.
dscharrer authored
250 check_include_files("mach/clock.h;mach/clock_types.h;mach/mach_host.h" HAVE_MACH_CLOCK)
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
251 endif()
252
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
253 check_include_file("wordexp.h" HAVE_WORDEXP_H)
3ebc8d6 @dscharrer Fix mingw32 build.
dscharrer authored
254
6ea23a6 @dscharrer Fix MinGW32 build, improve the crash handler.
dscharrer authored
255 check_symbol_exists(fork "unistd.h" HAVE_FORK)
256 check_symbol_exists(readlink "unistd.h" HAVE_READLINK)
257 check_symbol_exists(dup2 "unistd.h" HAVE_DUP2)
a9fc7cf @dscharrer CMake: Fix and cleanup capability checking for the POSIX crash handle…
dscharrer authored
258 check_symbol_exists(execl "unistd.h" HAVE_EXECL)
6ea23a6 @dscharrer Fix MinGW32 build, improve the crash handler.
dscharrer authored
259 check_symbol_exists(execlp "unistd.h" HAVE_EXECLP)
69c6305 @dscharrer Fix mingw32 build.
dscharrer authored
260 if(NOT WIN32)
261 check_symbol_exists(isatty "unistd.h" HAVE_ISATTY)
262 endif()
fbfbc3d @dscharrer Add missing #cmakedefine HAVE_FPATHCONF in Configure.h.cmake and clea…
dscharrer authored
263
f48b658 @dscharrer Check for sched_getscheduler in CMakeLists.txt
dscharrer authored
264 check_symbol_exists(sched_getscheduler "sched.h" HAVE_SCHED_GETSCHEDULER)
265
6ea23a6 @dscharrer Fix MinGW32 build, improve the crash handler.
dscharrer authored
266 check_symbol_exists(kill "signal.h" HAVE_KILL)
fbfbc3d @dscharrer Add missing #cmakedefine HAVE_FPATHCONF in Configure.h.cmake and clea…
dscharrer authored
267
6ea23a6 @dscharrer Fix MinGW32 build, improve the crash handler.
dscharrer authored
268 check_symbol_exists(backtrace "execinfo.h" HAVE_BACKTRACE)
fdcc384 @dscharrer CrashHandlerPOSIX: Don't try to execute gdb on startup, attach a basi…
dscharrer authored
269 check_symbol_exists(backtrace_symbols "execinfo.h" HAVE_BACKTRACE_SYMBOLS)
9490540 @dscharrer Add a crash handler that prints very detailed stack traces if gdb is …
dscharrer authored
270
6c773aa @dscharrer crash handler: Don't use internal boost types and functions.
dscharrer authored
271 check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
272 check_symbol_exists(getpid "unistd.h" HAVE_GETPID)
273
6d193a3 @dscharrer Add a USE_NATIVE_FS cmake flag to allow testing the boost::filesystem…
dscharrer authored
274 if(USE_NATIVE_FS)
275
276 check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
277 check_include_file("sys/errno.h" HAVE_SYS_ERRNO_H)
278 check_include_file("dirent.h" HAVE_DIRENT_H)
279
280 check_symbol_exists(fpathconf "unistd.h" HAVE_FPATHCONF)
281 check_symbol_exists(_PC_NAME_MAX "unistd.h" HAVE_PC_NAME_MAX)
282
283 check_symbol_exists(dirfd "dirent.h" HAVE_DIRFD)
284
285 check_symbol_exists(fstatat "sys/stat.h" HAVE_FSTATAT)
286
287 check_symbol_exists(NAME_MAX "dirent.h" HAVE_NAME_MAX)
288
289 if(HAVE_DIRFD AND HAVE_SYS_STAT_H AND HAVE_SYS_ERRNO_H AND HAVE_DIRENT_H AND HAVE_FSTATAT)
290 if((HAVE_FPATHCONF AND HAVE_PC_NAME_MAX) OR (HAVE_NAME_MAX))
291 set(HAVE_POSIX_FILESYSTEM 1)
292 endif()
fbfbc3d @dscharrer Add missing #cmakedefine HAVE_FPATHCONF in Configure.h.cmake and clea…
dscharrer authored
293 endif()
6d193a3 @dscharrer Add a USE_NATIVE_FS cmake flag to allow testing the boost::filesystem…
dscharrer authored
294
fbfbc3d @dscharrer Add missing #cmakedefine HAVE_FPATHCONF in Configure.h.cmake and clea…
dscharrer authored
295 endif()
296
5c954b9 @dscharrer Enable more warnings on gcc.
dscharrer authored
297 # Warning level
13ce969 @dscharrer Check if compiler options are supported in CMakeLists.txt
dscharrer authored
298 add_cxxflag("-Wall")
299 add_cxxflag("-Wextra")
300 add_cxxflag("-Wformat=2")
301 add_cxxflag("-Wundef")
302 add_cxxflag("-Wpointer-arith")
303 add_cxxflag("-Wcast-qual")
304 add_cxxflag("-Woverloaded-virtual")
305 add_cxxflag("-Wlogical-op")
306
307 add_cxxflag("-Wliteral-conversion")
308 add_cxxflag("-Wshift-overflow")
ec867ea @dscharrer Add more warning switches.
dscharrer authored
309 add_cxxflag("-Woverflow")
310 add_cxxflag("-Wbool-conversions")
13ce969 @dscharrer Check if compiler options are supported in CMakeLists.txt
dscharrer authored
311
312 # TODO enable:
313 # add_cxxflag("-Wconversion") # very noisy
314 # add_cxxflag("-Wsign-conversion") # very noisy
315 # add_cxxflag("-Wmissing-declarations") # to catch functions that should be marked as static
316 # add_cxxflag("-Wredundant-decls") # to catch extern definitions in .cpp files (with UNITYBUILD)
7a9b106 @dscharrer Add debug option in CMakeLists.txt
dscharrer authored
317
618c743 @dscharrer CMake: Set the build type to Release if empty.
dscharrer authored
318 if(CMAKE_BUILD_TYPE STREQUAL "")
319 set(CMAKE_BUILD_TYPE "Release")
320 endif()
321
322 if(CMAKE_BUILD_TYPE STREQUAL "Debug")
68f8415 @dscharrer [cmake] Make sure there is always only one -g* compiler option.
dscharrer authored
323
7a9b106 @dscharrer Add debug option in CMakeLists.txt
dscharrer authored
324 #Debug
5c2d73a @SebastienLussier Fixed VC2010 warnings/errors/projects
SebastienLussier authored
325 add_definitions(-D_DEBUG)
68f8415 @dscharrer [cmake] Make sure there is always only one -g* compiler option.
dscharrer authored
326
327 check_compiler_flag(RESULT "-g3")
328 if(NOT RESULT STREQUAL "")
329 string(REGEX REPLACE "-g(|[0-9]|gdb)" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
330 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RESULT}")
331 endif()
332
333 check_compiler_flag(RESULT "-O0")
334 string(REGEX REPLACE "-O[0-9]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
335 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RESULT}")
336
7a9b106 @dscharrer Add debug option in CMakeLists.txt
dscharrer authored
337 endif()
f9b122d @lubosz define HAVE_PTHREADS in cmake
lubosz authored
338
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
339 if(DEBUG_EXTRA)
b8f5ed0 @dscharrer Enable more runtime checks for ARX_DEBUG_EXTRA.
dscharrer authored
340 add_cxxflag("-ftrapv") # to add checks for (undefined) signed integer overflow
ec867ea @dscharrer Add more warning switches.
dscharrer authored
341 add_cxxflag("-fbounds-checking")
7a9d913 @dscharrer CMake: remove explicit checks for clang
dscharrer authored
342 add_cxxflag("-fcatch-undefined-behavior")
1741740 @dscharrer CMake: Add aggressive strict aluasing warnings to the DEBUG_EXTRA build.
dscharrer authored
343 add_cxxflag("-Wstrict-aliasing=1")
0c66651 @dscharrer Remove the _WIN32 added by winegcc so that headers of native librarie…
dscharrer authored
344 else()
cfffed9 @dscharrer Disable unitialized variable warnings on normal builds because of fa…
dscharrer authored
345 # -Wuninitialized causes too many false positives
13ce969 @dscharrer Check if compiler options are supported in CMakeLists.txt
dscharrer authored
346 add_cxxflag("-Wno-uninitialized")
621a4e1 @dscharrer [clang] Ignore -Wconstant-logical-operand warnings.
dscharrer authored
347 # (clang only) Conflicts with using const variables for configuration.
7a9d913 @dscharrer CMake: remove explicit checks for clang
dscharrer authored
348 add_cxxflag("-Wno-constant-logical-operand")
7a9b106 @dscharrer Add debug option in CMakeLists.txt
dscharrer authored
349 endif()
bc5eff0 @dscharrer Add -fwhole-program for unity build on gcc.
dscharrer authored
350
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
351 if(UNITY_BUILD)
13ce969 @dscharrer Check if compiler options are supported in CMakeLists.txt
dscharrer authored
352 add_cxxflag("-fwhole-program")
0f6542a @dscharrer Add an option for link-time optimizations to CMakeLists.txt
dscharrer authored
353 endif()
354
42b09f2 @dscharrer Add workaround for issues with ekopath and -fno-rtti.
dscharrer authored
355 if(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale")
356 # The standard library shipped with ekopath failes to compile with -fno-rtti
357 # See https://github.com/pathscale/stdcxx/issues/3
358 add_definitions(-D_RWSTD_NO_DYNAMIC_CAST)
359 endif()
c7fc4d4 @dscharrer Disable strict aliasing again since there are still many problems.
dscharrer authored
360
ab07b50 @dscharrer Use consistent casing in CMakeLists.txt
dscharrer authored
361 endif(MSVC)
c058032 @lubosz build debug
lubosz authored
362
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
363 if(WIN32 AND NOT WINE)
c74b937 @SebastienLussier Use "%FOLDERID_SavedGames%\Arx Libertatis" as the default user/data d…
SebastienLussier authored
364 # Define default user and data directories.
365 if(NOT DEFINED DATA_DIR)
366 set(DATA_DIR "Arx Libertatis")
367 endif()
368 if(NOT DEFINED USER_DIR)
369 set(USER_DIR "Arx Libertatis")
370 endif()
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
371 if(NOT DEFINED USER_DIR_PREFIXES)
38eaeb0 @SebastienLussier Changed default user directories on Windows to better match the stand…
SebastienLussier authored
372 set(USER_DIR_PREFIXES "%FOLDERID_SavedGames%")
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
373 endif()
374 else()
c74b937 @SebastienLussier Use "%FOLDERID_SavedGames%\Arx Libertatis" as the default user/data d…
SebastienLussier authored
375 # Define default user and data directories.
376 if(NOT DEFINED DATA_DIR)
377 set(DATA_DIR "arx")
378 endif()
379 if(NOT DEFINED USER_DIR)
380 set(USER_DIR "arx")
381 endif()
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
382 if(NOT DEFINED DATA_DIR_PREFIXES)
383 set(DATA_DIR_PREFIXES "${CMAKE_INSTALL_PREFIX}/share:$XDG_DATA_DIRS")
384 endif()
385 if(NOT DEFINED USER_DIR_PREFIXES)
386 set(USER_DIR_PREFIXES "$XDG_DATA_HOME")
387 endif()
0ffea62 @dscharrer Time(linux): Fallback to CLOCK_REALTIME if CLOCK_MONOTONIC is not ava…
dscharrer authored
388 endif()
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
389 if(DATA_DIR STREQUAL "")
390 unset(DATA_DIR)
391 endif()
392 if(USER_DIR STREQUAL "")
393 unset(USER_DIR)
394 endif()
395 if(DATA_DIR_PREFIXES STREQUAL "")
396 unset(DATA_DIR_PREFIXES)
397 endif()
398 if(USER_DIR_PREFIXES STREQUAL "")
399 unset(USER_DIR_PREFIXES)
400 endif()
401
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
402 # Check that all required functionality is available.
6c773aa @dscharrer crash handler: Don't use internal boost types and functions.
dscharrer authored
403 if(CMAKE_USE_PTHREADS_INIT AND HAVE_SYS_TYPES_H AND HAVE_GETPID)
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
404 set(HAVE_PTHREADS 1)
405 endif()
20b0067 @lubosz added mingw as option, removed wine header include for wine gcc, updated
lubosz authored
406
90b2db2 @SebastienLussier Updated CMakeLists.txt to generate nicer vs project
SebastienLussier authored
407 # Preprocessor definitions
66d2e6d @dscharrer Don't add windows.h-specific defines under linux.
dscharrer authored
408 if(HAVE_WINAPI)
409 add_definitions(-DNOMINMAX)
410 add_definitions(-DWIN32_LEAN_AND_MEAN)
411 endif(HAVE_WINAPI)
d86c3fb @dscharrer Enable debug output and fix related errors.
dscharrer authored
412
f748b9d @dscharrer Fix unity build.
dscharrer authored
413 # Sources
414 set(AI_SOURCES
415 src/ai/PathFinder.cpp
416 src/ai/PathFinderManager.cpp
417 src/ai/Paths.cpp
418 )
419
420 set(ANIMATION_SOURCES
421 src/animation/Animation.cpp
422 src/animation/AnimationRender.cpp
423 src/animation/Cinematic.cpp
424 src/animation/CinematicKeyframer.cpp
425 src/animation/Intro.cpp
426 )
427
428 set(AUDIO_SOURCES
429 src/audio/Ambiance.cpp
430 src/audio/Audio.cpp
431 src/audio/AudioEnvironment.cpp
432 src/audio/AudioGlobal.cpp
433 src/audio/AudioResource.cpp
434 src/audio/AudioSource.cpp
435 src/audio/Mixer.cpp
436 src/audio/Sample.cpp
437 src/audio/Stream.cpp
438 src/audio/codec/ADPCM.cpp
439 src/audio/codec/RAW.cpp
440 src/audio/codec/WAV.cpp
441 )
442
443 set(AUDIO_OPENAL_SOURCES
444 src/audio/openal/OpenALBackend.cpp
445 src/audio/openal/OpenALSource.cpp
0cd1d4c @dscharrer Improve OpenAL error messages.
dscharrer authored
446 src/audio/openal/OpenALUtils.cpp
f748b9d @dscharrer Fix unity build.
dscharrer authored
447 )
448
449 set(AUDIO_DSOUND_SOURCES
450 src/audio/dsound/DSoundBackend.cpp
451 src/audio/dsound/DSoundSource.cpp
452 )
453
454 set(CORE_SOURCES
455 src/core/Application.cpp
a97d5de @dscharrer Rename Win32Application.{cpp,h} to ArxGame.{cpp,h}
dscharrer authored
456 src/core/ArxGame.cpp
f748b9d @dscharrer Fix unity build.
dscharrer authored
457 src/core/Config.cpp
458 src/core/Core.cpp
459 src/core/GameTime.cpp
460 src/core/Localisation.cpp
844cfbe @dscharrer Store savegames in the user directory.
dscharrer authored
461 src/core/SaveGame.cpp
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
462 src/core/Startup.cpp
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
463 )
464
f748b9d @dscharrer Fix unity build.
dscharrer authored
465 set(EDITOR_SOURCES
466 src/core/Dialog.cpp
467 src/script/ScriptDebugger.cpp
468 src/script/ScriptDebuggerDialog.cpp
469 )
470
471 set(GAME_SOURCES
472 src/game/Damage.cpp
473 src/game/Equipment.cpp
474 src/game/Inventory.cpp
475 src/game/Levels.cpp
476 src/game/Map.cpp
477 src/game/Missile.cpp
478 src/game/NPC.cpp
479 src/game/Player.cpp
480 src/game/Spells.cpp
481 )
482
483 set(GRAPHICS_SOURCES
484 src/graphics/Draw.cpp
485 src/graphics/GraphicsModes.cpp
486 src/graphics/GraphicsUtility.cpp
487 src/graphics/Math.cpp
488 src/graphics/Renderer.cpp
489 src/graphics/data/CinematicTexture.cpp
490 src/graphics/data/FTL.cpp
491 src/graphics/data/Mesh.cpp
492 src/graphics/data/MeshManipulation.cpp
493 src/graphics/data/Progressive.cpp
494 src/graphics/data/TextureContainer.cpp
495 src/graphics/effects/CinematicEffects.cpp
496 src/graphics/effects/DrawEffects.cpp
497 src/graphics/effects/Fog.cpp
498 src/graphics/effects/SpellEffects.cpp
499 src/graphics/font/Font.cpp
500 src/graphics/font/FontCache.cpp
501 src/graphics/image/Image.cpp
502 src/graphics/particle/Particle.cpp
503 src/graphics/particle/ParticleEffects.cpp
504 src/graphics/particle/ParticleManager.cpp
505 src/graphics/particle/ParticleSystem.cpp
506 src/graphics/spells/Spells01.cpp
507 src/graphics/spells/Spells02.cpp
508 src/graphics/spells/Spells03.cpp
509 src/graphics/spells/Spells04.cpp
510 src/graphics/spells/Spells05.cpp
511 src/graphics/spells/Spells06.cpp
512 src/graphics/spells/Spells07.cpp
513 src/graphics/spells/Spells08.cpp
514 src/graphics/spells/Spells09.cpp
515 src/graphics/spells/Spells10.cpp
516 src/graphics/texture/PackedTexture.cpp
517 src/graphics/texture/Texture.cpp
518 src/graphics/texture/TextureStage.cpp
519 )
a996870 @SebastienLussier [DX7] Removed all dx7 backends (please don't cry)
SebastienLussier authored
520
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
521 set(GRAPHICS_D3D9_SOURCES
522 src/graphics/d3d9/D3D9Renderer.cpp
523 src/graphics/d3d9/D3D9Texture2D.cpp
524 src/graphics/d3d9/D3D9TextureStage.cpp
525 )
f748b9d @dscharrer Fix unity build.
dscharrer authored
526 set(GRAPHICS_OPENGL_SOURCES
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
527 src/graphics/opengl/GLTexture2D.cpp
528 src/graphics/opengl/GLTextureStage.cpp
f748b9d @dscharrer Fix unity build.
dscharrer authored
529 src/graphics/opengl/OpenGLRenderer.cpp
530 )
531
532 set(GUI_SOURCES
533 src/gui/Credits.cpp
534 src/gui/Interface.cpp
535 src/gui/Menu.cpp
536 src/gui/MenuPublic.cpp
537 src/gui/MenuWidgets.cpp
538 src/gui/MiniMap.cpp
539 src/gui/Speech.cpp
540 src/gui/Text.cpp
541 src/gui/TextManager.cpp
542 )
543
544 set(INPUT_SOURCES src/input/Input.cpp)
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
545 set(INPUT_DINPUT8_SOURCES src/input/DInput8Backend.cpp)
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
546 set(INPUT_SDL_SOURCES src/input/SDLInputBackend.cpp)
b175ff2 @dscharrer Only build one of FilesystemPOSIX.cpp, FilesystemWindows.cpp, Filesys…
dscharrer authored
547
548 set(IO_SOURCES
549 src/io/Blast.cpp
550 src/io/CinematicLoad.cpp
551 src/io/Implode.cpp
552 src/io/IniReader.cpp
553 src/io/IniSection.cpp
554 src/io/IniWriter.cpp
555 src/io/IO.cpp
556 src/io/SaveBlock.cpp
557 src/io/Screenshot.cpp
f748b9d @dscharrer Fix unity build.
dscharrer authored
558 )
9c928c0 @dscharrer Support log backends, add a file log backend.
dscharrer authored
559 set(IO_LOGGER_SOURCES
560 src/io/log/ConsoleLogger.cpp
561 src/io/log/FileLogger.cpp
52aaad0 @dscharrer [log] Share formatting between ConsoleLogger, FileLogger and MsvcLogger.
dscharrer authored
562 src/io/log/LogBackend.cpp
9c928c0 @dscharrer Support log backends, add a file log backend.
dscharrer authored
563 src/io/log/Logger.cpp
564 )
b69d7b3 @dscharrer Rename fs::path to res::path.
dscharrer authored
565 set(IO_RESOURCE_SOURCES
566 src/io/resource/PakEntry.cpp
567 src/io/resource/PakReader.cpp
568 src/io/resource/ResourcePath.cpp
569 )
9c928c0 @dscharrer Support log backends, add a file log backend.
dscharrer authored
570 set(IO_LOGGER_POSIX_SOURCES src/io/log/ColorLogger.cpp)
571 set(IO_LOGGER_WINDOWS_SOURCES src/io/log/MsvcLogger.cpp)
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
572 set(IO_FILESYSTEM_SOURCES
b2c3ef7 @dscharrer Add a separate fs::path class for filesystem paths.
dscharrer authored
573 src/io/fs/FilePath.cpp
574 src/io/fs/FileStream.cpp
575 src/io/fs/Filesystem.cpp
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
576 )
b2c3ef7 @dscharrer Add a separate fs::path class for filesystem paths.
dscharrer authored
577 set(IO_FILESYSTEM_BOOST_SOURCES src/io/fs/FilesystemBoost.cpp)
578 set(IO_FILESYSTEM_POSIX_SOURCES src/io/fs/FilesystemPOSIX.cpp)
579 set(IO_FILESYSTEM_WINDOWS_SOURCES src/io/fs/FilesystemWindows.cpp)
f748b9d @dscharrer Fix unity build.
dscharrer authored
580
3e3d00b @SebastienLussier Moved platform/Random.h|cpp to math/Random.h|cpp
SebastienLussier authored
581 set(MATH_SOURCES
582 src/math/Angle.cpp
583 src/math/Random.cpp
584 )
f748b9d @dscharrer Fix unity build.
dscharrer authored
585
586 set(PHYSICS_SOURCES
587 src/physics/Anchors.cpp
588 src/physics/Attractors.cpp
589 src/physics/Box.cpp
590 src/physics/Clothes.cpp
591 src/physics/Collisions.cpp
592 src/physics/CollisionShapes.cpp
593 src/physics/Physics.cpp
b175ff2 @dscharrer Only build one of FilesystemPOSIX.cpp, FilesystemWindows.cpp, Filesys…
dscharrer authored
594 )
595
f748b9d @dscharrer Fix unity build.
dscharrer authored
596 set(PLATFORM_SOURCES
9490540 @dscharrer Add a crash handler that prints very detailed stack traces if gdb is …
dscharrer authored
597 src/platform/CrashHandler.cpp
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
598 src/platform/Environment.cpp
f748b9d @dscharrer Fix unity build.
dscharrer authored
599 src/platform/Lock.cpp
600 src/platform/Platform.cpp
601 src/platform/String.cpp
602 src/platform/Thread.cpp
603 src/platform/Time.cpp
5251ef2 @SebastienLussier More cleanup - Isolated Windows specific crash handling stuff and rem…
SebastienLussier authored
604 src/platform/crashhandler/CrashHandlerImpl.cpp
f748b9d @dscharrer Fix unity build.
dscharrer authored
605 )
559b93f @dscharrer <WIP>
dscharrer authored
606 set(PLATFORM_CRASHHANDLER_POSIX_SOURCES src/platform/crashhandler/CrashHandlerPOSIX.cpp)
5251ef2 @SebastienLussier More cleanup - Isolated Windows specific crash handling stuff and rem…
SebastienLussier authored
607 set(PLATFORM_CRASHHANDLER_WINDOWS_SOURCES src/platform/crashhandler/CrashHandlerWindows.cpp)
608
f748b9d @dscharrer Fix unity build.
dscharrer authored
609 set(SCENE_SOURCES
610 src/scene/ChangeLevel.cpp
611 src/scene/CinematicSound.cpp
612 src/scene/GameSound.cpp
613 src/scene/Interactive.cpp
614 src/scene/Light.cpp
615 src/scene/LinkedObject.cpp
616 src/scene/LoadLevel.cpp
617 src/scene/Object.cpp
618 src/scene/Scene.cpp
619 )
620
621 set(SCRIPT_SOURCES
622 src/script/Script.cpp
623 src/script/ScriptedAnimation.cpp
624 src/script/ScriptedCamera.cpp
625 src/script/ScriptedControl.cpp
626 src/script/ScriptedConversation.cpp
627 src/script/ScriptedInterface.cpp
628 src/script/ScriptedInventory.cpp
629 src/script/ScriptedIOControl.cpp
630 src/script/ScriptedIOProperties.cpp
631 src/script/ScriptedItem.cpp
632 src/script/ScriptedLang.cpp
633 src/script/ScriptedNPC.cpp
634 src/script/ScriptedPlayer.cpp
635 src/script/ScriptedVariable.cpp
636 src/script/ScriptEvent.cpp
637 src/script/ScriptUtils.cpp
638 )
9c3e84d @lubosz stubby cmake build
lubosz authored
639
6c9db46 @dscharrer Move windowing code into a separate subdirectory.
dscharrer authored
640 set(WINDOW_SOURCES
641 src/window/RenderWindow.cpp
642 src/window/Window.cpp
643 )
644 set(WINDOW_SDL_SOURCES src/window/SDLWindow.cpp)
645 set(WINDOW_WIN32_SOURCES src/window/Win32Window.cpp)
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
646 set(WINDOW_D3D9_SOURCES src/window/D3D9Window.cpp)
6c9db46 @dscharrer Move windowing code into a separate subdirectory.
dscharrer authored
647
f748b9d @dscharrer Fix unity build.
dscharrer authored
648 file(GLOB_RECURSE ALL_INCLUDES ${SRC_DIR}/*.h)
41d57f0 @dscharrer Make building the OpenAL and DirectSound backends optional.
dscharrer authored
649
3837bcb @dscharrer [make style] Fix include warnings.
dscharrer authored
650 include_directories(${SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/tools)
519b7f1 @dscharrer Add Boost as a dependency.
dscharrer authored
651 include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS} ${IL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
41d57f0 @dscharrer Make building the OpenAL and DirectSound backends optional.
dscharrer authored
652
4ef1483 @SebastienLussier Use boost auto linking feature when building with MSVC
SebastienLussier authored
653 # Setting the BOOST_ROOT will result in linking failures on Visual Studio as found release and debug
654 # libs get mixed up. On windows we will empty out the Boost_LIBRARIES list and count on the
655 # auto-linking feature boost provides. http://www.boost.org/doc/libs/1_47_0/more/getting_started/windows.html#auto-linking
656 if (MSVC)
657 # Reset libraries list so VC will perform auto-linking.
658 set (Boost_LIBRARIES "")
659
660 # Not needed anymore as BOOST_ROOT finds these properly.
661 # Didnt remove yet eiher so nothing breaks, added empty checks instead to not add duplicated.
662 if ("${Boost_INCLUDE_DIRS}" STREQUAL "")
663 set (Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} $ENV{BOOST_ROOT}/include)
664 endif ()
665 if ("${Boost_LIBRARY_DIRS}" STREQUAL "")
666 set (Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} $ENV{BOOST_ROOT}/lib)
667 endif ()
668
669 # Add boost lib directory to the list of libraries paths
670 link_directories(${Boost_LIBRARY_DIRS})
671 endif ()
672
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
673 set(ARX_LIBRARIES ${FREETYPE_LIBRARIES} ${ZLIB_LIBRARIES} ${IL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES})
4ef1483 @SebastienLussier Use boost auto linking feature when building with MSVC
SebastienLussier authored
674
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
675 if(TIME_LIBRARIES)
676 list(APPEND ARX_LIBRARIES ${TIME_LIBRARIES})
677 endif()
678 if(HAVE_WINAPI)
679 list(APPEND ARX_LIBRARIES gdi32 shell32 comdlg32 ole32 comctl32)
680 endif()
681
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
682 if(USE_OPENAL AND OPENAL_FOUND)
6c9db46 @dscharrer Move windowing code into a separate subdirectory.
dscharrer authored
683 list(APPEND AUDIO_SOURCES ${AUDIO_OPENAL_SOURCES})
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
684 list(APPEND ARX_LIBRARIES ${OPENAL_LIBRARY})
b1323e6 @dscharrer Mark include paths of external projects as SYSTEM to disable warnings.
dscharrer authored
685 include_directories(SYSTEM ${OPENAL_INCLUDE_DIR})
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
686 set(HAVE_OPENAL 1)
b43b234 @dscharrer Make the OpenAL effect extension optional so we can build against old…
dscharrer authored
687 if(OPENALEFX_FOUND)
b1323e6 @dscharrer Mark include paths of external projects as SYSTEM to disable warnings.
dscharrer authored
688 include_directories(SYSTEM ${OPENAL_EFX_INCLUDE_DIR})
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
689 set(HAVE_OPENAL_EFX 1)
b43b234 @dscharrer Make the OpenAL effect extension optional so we can build against old…
dscharrer authored
690 endif()
41d57f0 @dscharrer Make building the OpenAL and DirectSound backends optional.
dscharrer authored
691 endif()
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
692 if(USE_DSOUND)
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
693 # TODO does this need DIRECTX_FOUND? if so, the find_package(DirectX) should also be run if USE_DSOUND is set but USE_D3D9 isn't
6c9db46 @dscharrer Move windowing code into a separate subdirectory.
dscharrer authored
694 list(APPEND AUDIO_SOURCES ${AUDIO_DSOUND_SOURCES})
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
695 set(HAVE_DSOUND 1)
41d57f0 @dscharrer Make building the OpenAL and DirectSound backends optional.
dscharrer authored
696 endif()
f748b9d @dscharrer Fix unity build.
dscharrer authored
697
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
698 if(USE_D3D9 AND DIRECTX_FOUND)
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
699 list(APPEND GRAPHICS_SOURCES ${GRAPHICS_D3D9_SOURCES})
700 list(APPEND WINDOW_SOURCES ${WINDOW_WIN32_SOURCES} ${WINDOW_D3D9_SOURCES})
701
4864792 @SebastienLussier Cleaned DirectX libraries inclusion in CMake
SebastienLussier authored
702 list(APPEND ARX_LIBRARIES ${DIRECTX_D3D9_LIBRARY} ${DIRECTX_D3DX9_LIBRARY} ${DIRECTX_D3DCOMPILER_LIBRARY} ${DIRECTX_DXERR9_LIBRARY})
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
703 include_directories(SYSTEM ${DIRECTX_INCLUDE_DIR})
704
705 set(HAVE_D3D9 1)
706 endif()
707
cc9c840 @dscharrer Remove the GLU dependency for the OpenGL renderer.
dscharrer authored
708 if(USE_OPENGL AND OPENGL_FOUND AND GLEW_FOUND)
6c9db46 @dscharrer Move windowing code into a separate subdirectory.
dscharrer authored
709 list(APPEND GRAPHICS_SOURCES ${GRAPHICS_OPENGL_SOURCES})
cc9c840 @dscharrer Remove the GLU dependency for the OpenGL renderer.
dscharrer authored
710 list(APPEND ARX_LIBRARIES ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARIES})
d140a05 @dscharrer Start implementing OpenGLRenderer.
dscharrer authored
711 include_directories(SYSTEM ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR})
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
712 set(HAVE_OPENGL 1)
d140a05 @dscharrer Start implementing OpenGLRenderer.
dscharrer authored
713 add_definitions(-DGL_GLEXT_PROTOTYPES)
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
714 endif()
715
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
716 if(USE_SDL AND HAVE_OPENGL AND SDL_FOUND)
6c9db46 @dscharrer Move windowing code into a separate subdirectory.
dscharrer authored
717 list(APPEND WINDOW_SOURCES ${WINDOW_SDL_SOURCES})
718 list(APPEND INPUT_SOURCES ${INPUT_SDL_SOURCES})
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
719 list(APPEND ARX_LIBRARIES ${SDL_LIBRARY})
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
720 include_directories(SYSTEM ${SDL_INCLUDE_DIR})
721 set(HAVE_SDL 1)
c105d07 @dscharrer Make building the OpenGLRenderer optional, disabled by default.
dscharrer authored
722 endif()
9c3e84d @lubosz stubby cmake build
lubosz authored
723
7c025c3 @dscharrer Relax backend selection in CMake: don't fail if a backend that was en…
dscharrer authored
724 if(USE_DINPUT8 AND DIRECTX_FOUND)
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
725 list(APPEND INPUT_SOURCES ${INPUT_DINPUT8_SOURCES})
4864792 @SebastienLussier Cleaned DirectX libraries inclusion in CMake
SebastienLussier authored
726 list(APPEND ARX_LIBRARIES ${DIRECTX_DINPUT8_LIBRARY} ${DIRECTX_DXGUID_LIBRARY} ${DIRECTX_DXERR9_LIBRARY})
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
727 set(HAVE_DINPUT8 1)
a996870 @SebastienLussier [DX7] Removed all dx7 backends (please don't cry)
SebastienLussier authored
728 if(WINE)
953612b @dscharrer Add a workaround for missing symbols in wine's dinput8.dll.so
dscharrer authored
729 # TODO(broken-wine) work around missing symbols in wine's dinput8
730 list(APPEND ARX_LIBRARIES dinput)
731 endif()
365d73b @SebastienLussier First working implementation of Arx using DirectX 9 (D3D9 & DInput8)
SebastienLussier authored
732 endif()
733
9c928c0 @dscharrer Support log backends, add a file log backend.
dscharrer authored
734 if(HAVE_ISATTY)
735 list(APPEND IO_LOGGER_SOURCES ${IO_LOGGER_POSIX_SOURCES})
736 endif()
737 if(HAVE_WINAPI)
69c6305 @dscharrer Fix mingw32 build.
dscharrer authored
738 list(APPEND IO_LOGGER_SOURCES ${IO_LOGGER_WINDOWS_SOURCES})
9c928c0 @dscharrer Support log backends, add a file log backend.
dscharrer authored
739 endif()
740 list(APPEND IO_SOURCES ${IO_LOGGER_SOURCES})
741
b69d7b3 @dscharrer Rename fs::path to res::path.
dscharrer authored
742 list(APPEND IO_SOURCES ${IO_RESOURCE_SOURCES})
743
f748b9d @dscharrer Fix unity build.
dscharrer authored
744 if(HAVE_POSIX_FILESYSTEM)
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
745 list(APPEND IO_FILESYSTEM_SOURCES ${IO_FILESYSTEM_POSIX_SOURCES})
6d193a3 @dscharrer Add a USE_NATIVE_FS cmake flag to allow testing the boost::filesystem…
dscharrer authored
746 elseif(USE_NATIVE_FS AND HAVE_WINAPI)
f748b9d @dscharrer Fix unity build.
dscharrer authored
747 add_definitions(-DHAVE_WINDOWS_FILESYSTEM)
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
748 list(APPEND IO_FILESYSTEM_SOURCES ${IO_FILESYSTEM_WINDOWS_SOURCES})
6d193a3 @dscharrer Add a USE_NATIVE_FS cmake flag to allow testing the boost::filesystem…
dscharrer authored
749 set(HAVE_WIN32_FILESYSTEM 1)
f748b9d @dscharrer Fix unity build.
dscharrer authored
750 elseif((Boost_MAJOR_VERSION GREATER 1) OR (NOT Boost_MINOR_VERSION LESS 44))
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
751 find_package(Boost 1.44 REQUIRED COMPONENTS ${BOOST_COMPONENTS} filesystem system)
f748b9d @dscharrer Fix unity build.
dscharrer authored
752 set(HAVE_BOOST_FILESYSTEM_V3 1)
753 add_definitions(-DBOOST_FILESYSTEM_VERSION=3)
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
754 list(APPEND IO_FILESYSTEM_SOURCES ${IO_FILESYSTEM_BOOST_SOURCES})
d9d146c @dscharrer Fix linking errors when compiling agains boost filesystem.
dscharrer authored
755 list(APPEND ARX_LIBRARIES ${Boost_LIBRARIES})
f748b9d @dscharrer Fix unity build.
dscharrer authored
756 else()
240e2f5 @dscharrer Add missing check for fstatat in FilesystemPOSIX.
dscharrer authored
757 message(FATAL_ERROR "You need either Boost >= 1.44 or Windows API or enough POSIX functionality; Found boost version ${Boost_VERSION}")
f748b9d @dscharrer Fix unity build.
dscharrer authored
758 endif()
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
759 list(APPEND IO_SOURCES ${IO_FILESYSTEM_SOURCES})
f748b9d @dscharrer Fix unity build.
dscharrer authored
760
a9fc7cf @dscharrer CMake: Fix and cleanup capability checking for the POSIX crash handle…
dscharrer authored
761 if((HAVE_EXECLP OR HAVE_EXECL) AND HAVE_FORK AND HAVE_KILL)
559b93f @dscharrer <WIP>
dscharrer authored
762 list(APPEND PLATFORM_SOURCES ${PLATFORM_CRASHHANDLER_POSIX_SOURCES})
763 set(HAVE_CRASHHANDLER_POSIX 1)
1463b31 @dscharrer Only enable the windows crash handler for MSVC.
dscharrer authored
764 elseif(MSVC)
559b93f @dscharrer <WIP>
dscharrer authored
765 list(APPEND PLATFORM_SOURCES ${PLATFORM_CRASHHANDLER_WINDOWS_SOURCES})
766 set(HAVE_CRASHHANDLER_WINDOWS 1)
a9fc7cf @dscharrer CMake: Fix and cleanup capability checking for the POSIX crash handle…
dscharrer authored
767 else()
768 # Don't bother building arxcrashreporter if it will never be used.
769 #unset(HAVE_CRASHREPORTER)
559b93f @dscharrer <WIP>
dscharrer authored
770 endif()
5251ef2 @SebastienLussier More cleanup - Isolated Windows specific crash handling stuff and rem…
SebastienLussier authored
771
f748b9d @dscharrer Fix unity build.
dscharrer authored
772 if(NOT MSVC)
773 check_link_library(Boost Boost_LIBRARIES)
774 endif()
775
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
776 set(ARX_SOURCES ${AI_SOURCES} ${ANIMATION_SOURCES} ${AUDIO_SOURCES} ${CORE_SOURCES} ${GAME_SOURCES} ${GRAPHICS_SOURCES} ${GUI_SOURCES} ${INPUT_SOURCES} ${IO_SOURCES} ${MATH_SOURCES} ${PHYSICS_SOURCES} ${PLATFORM_SOURCES} ${SCENE_SOURCES} ${SCRIPT_SOURCES} ${WINDOW_SOURCES})
f748b9d @dscharrer Fix unity build.
dscharrer authored
777
c3d008e @SebastienLussier Add an icon to the arx exe for Windows
SebastienLussier authored
778 # Set the icon for the Windows executable by adding this resource file to the sources
779 if(MSVC)
780 SET(ARX_SOURCES ${ARX_SOURCES} data/icons/arx-libertatis.rc)
41d57f0 @dscharrer Make building the OpenAL and DirectSound backends optional.
dscharrer authored
781 endif()
c3d008e @SebastienLussier Add an icon to the arx exe for Windows
SebastienLussier authored
782
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
783 if(BUILD_EDITOR)
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
784 list(APPEND ARX_SOURCES ${EDITOR_SOURCES})
05cc8a6 @dscharrer Make building .scn file support optional. (raw unprocessed scenes, no…
dscharrer authored
785 endif()
9c3e84d @lubosz stubby cmake build
lubosz authored
786
cc565fb @dscharrer Fix compile errors when using older boost versions (tested 1.37 and 1…
dscharrer authored
787 add_definitions(-DBOOST_FILESYSTEM_NO_DEPRECATED)
788
5c2d73a @SebastienLussier Fixed VC2010 warnings/errors/projects
SebastienLussier authored
789 #create source groups
b7b0735 @SebastienLussier [CMake] Changed create_source_groups() to create a hierarchy that rep…
SebastienLussier authored
790 list(APPEND ALL_FILES_FOR_GROUPS ${ALL_INCLUDES} ${ARX_SOURCES})
791 create_source_groups(ALL_FILES_FOR_GROUPS)
5c2d73a @SebastienLussier Fixed VC2010 warnings/errors/projects
SebastienLussier authored
792
4db4d9c @dscharrer Detect user/data directory locations.
dscharrer authored
793 configure_file("${SRC_DIR}/Configure.h.cmake" "Configure.h" ESCAPE_QUOTES)
7fa9f82 @dscharrer Write configure options to a header instead of passing them on the co…
dscharrer authored
794
1ea3ead @dscharrer Automatically generate a version string at build time.
dscharrer authored
795 version_file("${SRC_DIR}/core/Version.cpp.cmake" "${CMAKE_BINARY_DIR}/Version.cpp" "VERSION" ".git")
796 list(APPEND ARX_SOURCES "${CMAKE_BINARY_DIR}/Version.cpp")
9c3e84d @lubosz stubby cmake build
lubosz authored
797
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
798
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
799 # Add executables
800
736121e @SebastienLussier Build Arx as a Win32 application (no more console)
SebastienLussier authored
801 add_executable_shared(arx WIN32 "${ARX_SOURCES}" "${ARX_LIBRARIES}" "${ALL_INCLUDES}")
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
802
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
803 if(HAVE_CRASHREPORTER)
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
804
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
805 set(arxcrashreporter_SOURCES
806 tools/crashreporter/main.cpp
807 tools/crashreporter/errorreport.h
808 tools/crashreporter/errorreport.cpp
809 tools/crashreporter/utilities_win32.h
810 tools/crashreporter/utilities_win32.cpp
811 tools/crashreporter/qhexedit/commands.h
812 tools/crashreporter/qhexedit/commands.cpp
813 tools/crashreporter/qhexedit/qhexedit.h
814 tools/crashreporter/qhexedit/qhexedit.cpp
815 tools/crashreporter/qhexedit/qhexedit_p.h
816 tools/crashreporter/qhexedit/qhexedit_p.cpp
817 tools/crashreporter/qhexedit/xbytearray.h
818 tools/crashreporter/qhexedit/xbytearray.cpp
819 tools/crashreporter/ui/errorreportdialog.h
820 tools/crashreporter/ui/errorreportdialog.cpp
821 tools/crashreporter/xmlhighlighter/xmlhighlighter.h
822 tools/crashreporter/xmlhighlighter/xmlhighlighter.cpp
4d7cf61 @SebastienLussier Crash reporter now creates issues on the bug tracker
SebastienLussier authored
823 tools/crashreporter/tbg/tbg.h
824 tools/crashreporter/tbg/tbg.cpp
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
825 ${PLATFORM_SOURCES}
826 ${IO_FILESYSTEM_SOURCES}
827 ${IO_LOGGER_SOURCES}
828 )
829
830 set(arxcrashreporter_UIs
831 tools/crashreporter/ui/errorreportdialog.ui
832 )
833
834 set(arxcrashreporter_MOC_HEADERS
835 tools/crashreporter/ui/errorreportdialog.h
836 tools/crashreporter/qhexedit/qhexedit.h
837 tools/crashreporter/qhexedit/qhexedit_p.h
838 )
839
840 set(arxcrashreporter_RESOURCES
841 tools/crashreporter/resources/crashreporter.qrc
842 )
843
0baa898 @dscharrer Don't run style checks for autogenerated sources (moc, ui, qrc).
dscharrer authored
844 set(arxcrashreporter_MANUAL_SOURCES "${arxcrashreporter_SOURCES}")
845
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
846 qt4_wrap_ui(arxcrashreporter_SOURCES ${arxcrashreporter_UIs})
847 qt4_wrap_cpp(arxcrashreporter_SOURCES ${arxcrashreporter_MOC_HEADERS})
848 qt4_add_resources(arxcrashreporter_SOURCES ${arxcrashreporter_RESOURCES})
849
850 set(SRC_DIR tools/crashreporter/)
851
852 create_source_groups(arxcrashreporter_SOURCES)
853
854 set(arxcrashreporter_LIBRARIES
855 ${QT_QTCORE_LIBRARY_RELEASE}
856 ${QT_QTGUI_LIBRARY_RELEASE}
4d7cf61 @SebastienLussier Crash reporter now creates issues on the bug tracker
SebastienLussier authored
857 ${QT_QTNETWORK_LIBRARY_RELEASE}
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
858 ${Boost_LIBRARIES}
859 )
860 if(MSVC)
861 list(APPEND arxcrashreporter_LIBRARIES winmm psapi imm32)
579fb39 @SebastienLussier Improved the Windows crash reporter to include the callstack + added …
SebastienLussier authored
862 list(APPEND arxcrashreporter_LIBRARIES ${DBGHELP_LIBRARIES})
863 include_directories(SYSTEM ${DBGHELP_INCLUDE_DIR})
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
864 endif()
865
866 add_executable_shared(arxcrashreporter WIN32 "${arxcrashreporter_SOURCES}"
867 "${arxcrashreporter_LIBRARIES}" "")
868
869 endif()
e71dc88 @SebastienLussier Arx crash reporter (WIP)
SebastienLussier authored
870
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
871 if(BUILD_TOOLS)
872
873 set(arxsavetool_SOURCES
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
874 ${IO_FILESYSTEM_SOURCES}
9c928c0 @dscharrer Support log backends, add a file log backend.
dscharrer authored
875 ${IO_LOGGER_SOURCES}
b69d7b3 @dscharrer Rename fs::path to res::path.
dscharrer authored
876 ${IO_RESOURCE_SOURCES}
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
877 src/core/Localisation.cpp
878 src/io/Blast.cpp
879 src/io/SaveBlock.cpp
880 src/io/IniReader.cpp
881 src/io/IniSection.cpp
882 src/platform/String.cpp
883 src/platform/Platform.cpp
6e6bfe4 @dscharrer Make the new Logger threadsafe.
dscharrer authored
884 src/platform/Lock.cpp
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
885 tools/savetool/savetool.cpp
886 tools/savetool/SaveFix.cpp
887 tools/savetool/SaveView.cpp
888 )
889
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
890 set(arxsavetool_LIBRARIES ${ZLIB_LIBRARIES} ${Boost_LIBRARIES})
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
891
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
892 add_executable_shared(arxsavetool "" "${arxsavetool_SOURCES}" "${arxsavetool_LIBRARIES}" "")
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
893
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
894
895 set(arxunpak_SOURCES
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
896 ${IO_FILESYSTEM_SOURCES}
9c928c0 @dscharrer Support log backends, add a file log backend.
dscharrer authored
897 ${IO_LOGGER_SOURCES}
b69d7b3 @dscharrer Rename fs::path to res::path.
dscharrer authored
898 ${IO_RESOURCE_SOURCES}
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
899 src/io/Blast.cpp
9c928c0 @dscharrer Support log backends, add a file log backend.
dscharrer authored
900 src/io/log/ColorLogger.cpp
901 src/io/log/ConsoleLogger.cpp
902 src/io/log/Logger.cpp
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
903 src/platform/String.cpp
904 src/platform/Platform.cpp
6e6bfe4 @dscharrer Make the new Logger threadsafe.
dscharrer authored
905 src/platform/Lock.cpp
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
906 tools/unpak/unpak.cpp
907 )
908
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
909 set(arxunpak_LIBRARIES ${Boost_LIBRARIES})
910
911 add_executable_shared(arxunpak "" "${arxunpak_SOURCES}" "${arxunpak_LIBRARIES}" "")
e71dc88 @SebastienLussier Arx crash reporter (WIP)
SebastienLussier authored
912
c105d07 @dscharrer Make building the OpenGLRenderer optional, disabled by default.
dscharrer authored
913 endif()
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
914
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
915
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
916 # Build and link executables
917
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
918 if(UNITY_BUILD)
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
919 unity_build()
920 else()
921 shared_build()
ec98148 @dscharrer Add stub SDL Window and InputBackend and OpenGL Renderer implementati…
dscharrer authored
922 endif()
7c677ae @lubosz added remake flag
lubosz authored
923
f67374f @dscharrer Merge tools build into the main CMakeLists.txt and automatically extr…
dscharrer authored
924
925 # Custom make targets
926
7c677ae @lubosz added remake flag
lubosz authored
927 add_custom_target(remake
7a4b058 @lubosz fixed formatting and include folder
lubosz authored
928 #clean and compile with 1 thread per core
929 COMMAND make clean && rm CMakeCache.txt && cmake ${CMAKE_SOURCE_DIR} -G\"Unix Makefiles\" && make -j`getconf _NPROCESSORS_ONLN`
7c677ae @lubosz added remake flag
lubosz authored
930 )
335f4bf @dscharrer Add tool for PAK file decompression.
dscharrer authored
931
734fab0 @dscharrer Use find_package in CMakeLists.txt instead of hardcoding library name…
dscharrer authored
932 if(DOXYGEN_EXECUTABLE)
933 add_custom_target(doc
934 #build the documentation
ac9fe80 @dscharrer [cmake] Update doxygen configuration.
dscharrer authored
935 COMMAND cd ${CMAKE_SOURCE_DIR}/src && ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/doc/Doxyfile
734fab0 @dscharrer Use find_package in CMakeLists.txt instead of hardcoding library name…
dscharrer authored
936 )
937 endif()
766a3e9 @lubosz added doxyfile and doc build to cmake. see readme.
lubosz authored
938
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
939 file(GLOB_RECURSE TOOLS_INCLUDES ${CMAKE_SOURCE_DIR}/tools/*.h)
0baa898 @dscharrer Don't run style checks for autogenerated sources (moc, ui, qrc).
dscharrer authored
940 set(STYLE_CHECKED_SOURCES
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
941 ${ARX_SOURCES}
942 ${arxsavetool_SOURCES}
943 ${arxunpak_SOURCES}
0baa898 @dscharrer Don't run style checks for autogenerated sources (moc, ui, qrc).
dscharrer authored
944 ${arxcrashreporter_MANUAL_SOURCES}
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
945 )
0baa898 @dscharrer Don't run style checks for autogenerated sources (moc, ui, qrc).
dscharrer authored
946 set(STYLE_CHECKED_INCLUDES
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
947 ${ALL_INCLUDES}
948 ${TOOLS_INCLUDES}
949 )
950
0baa898 @dscharrer Don't run style checks for autogenerated sources (moc, ui, qrc).
dscharrer authored
951 add_style_check_target(style "${STYLE_CHECKED_SOURCES}" "${STYLE_CHECKED_INCLUDES}")
e9bb76b @lubosz style check and make target
lubosz authored
952
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
953 if(BUILD_TESTS)
3e661ac @lubosz options for not buildings tests and tools
lubosz authored
954 add_subdirectory(tests ${CMAKE_SOURCE_DIR}/bin/tests)
955 endif()
813c161 @dscharrer Provide a configuration summary at the end of the CMake run.
dscharrer authored
956
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
957
958 # Print a configuration summary
813c161 @dscharrer Provide a configuration summary at the end of the CMake run.
dscharrer authored
959
960 message("")
961 message("Configuration:")
ddeecb9 @dscharrer Don't print the build type in the configuration summary for MSVC.
dscharrer authored
962 if(NOT MSVC)
963 if(UNITY_BUILD)
964 set(BUILD_TYPE_SUFFIX " (unity build)")
965 else()
966 set(BUILD_TYPE_SUFFIX "")
967 endif()
968 if(CMAKE_BUILD_TYPE STREQUAL "")
969 message(" - Build type: Release${BUILD_TYPE_SUFFIX}")
970 else()
971 message(" - Build type: ${CMAKE_BUILD_TYPE}${BUILD_TYPE_SUFFIX}")
972 endif()
973 endif(NOT MSVC)
813c161 @dscharrer Provide a configuration summary at the end of the CMake run.
dscharrer authored
974 print_configuration("Filesystem backend" FIRST
975 HAVE_POSIX_FILESYSTEM "POSIX"
6d193a3 @dscharrer Add a USE_NATIVE_FS cmake flag to allow testing the boost::filesystem…
dscharrer authored
976 HAVE_WIN32_FILESYSTEM "Win32"
813c161 @dscharrer Provide a configuration summary at the end of the CMake run.
dscharrer authored
977 1 "Boost"
978 )
979 print_configuration("Renderer"
980 HAVE_OPENGL "OpenGL"
981 HAVE_D3D9 "Direct3D 9"
982 )
983 print_configuration("Audio backend"
984 HAVE_OPENAL "OpenAL"
985 HAVE_DSOUND "Direct Sound"
986 )
987 print_configuration("Input backend"
988 HAVE_SDL "SDL"
989 HAVE_DINPUT8 "DirectInput 8"
990 )
991 print_configuration("Windowing"
992 HAVE_SDL "SDL"
993 HAVE_D3D9 "Win32"
994 )
8aa51cd @dscharrer Merge branch 'master' into slussier_misc and get it to compile under …
dscharrer authored
995 print_configuration("Crash handler"
996 HAVE_CRASHHANDLER_POSIX "POSIX"
997 HAVE_CRASHHANDLER_WINDOWS "Win32"
998 )
9fdb80e @dscharrer CMake: Add an option to disable the crash reporter.
dscharrer authored
999 print_configuration("Crash reporter" FIRST
1000 HAVE_CRASHREPORTER "enabled"
1001 1 "disabled"
1002 )
1003 print_configuration("Tools" FIRST
1004 BUILD_TOOLS "enabled"
1005 1 "disabled"
1006 )
d43db2c @dscharrer Merge branch 'master' into slussier_misc
dscharrer authored
1007 message("")
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
1008
4cd5bf1 @dscharrer CMake: Move helper functions and macros out of the main CMakeLists.txt
dscharrer authored
1009
1010 # Detect configuration errors
1011
6c773aa @dscharrer crash handler: Don't use internal boost types and functions.
dscharrer authored
1012 if(NOT (HAVE_PTHREADS OR HAVE_WINAPI))
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
1013 message(SEND_ERROR "No supported thread libraries found.")
1014 endif()
ea9d77a @dscharrer Only enable the OpenGL backend if GLEW was found, fail if either no r…
dscharrer authored
1015 if(NOT (HAVE_OPENGL OR HAVE_D3D9))
1016 message(SEND_ERROR "No renderer available - need either OpenGL and GLEW or Direct3D 9")
1017 endif()
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
1018 if(NOT (HAVE_OPENAL OR HAVE_DSOUND))
ea9d77a @dscharrer Only enable the OpenGL backend if GLEW was found, fail if either no r…
dscharrer authored
1019 message(WARNING "No audio backend enabled - need either OpenAL or Direct Sound")
1020 endif()
1021 if(NOT (HAVE_SDL OR HAVE_DINPUT8))
1022 message(SEND_ERROR "No input backend available - need either SDL or DirectInput 8")
1023 endif()
1024 if(NOT (HAVE_SDL OR HAVE_WINAPI))
1025 message(SEND_ERROR "No windowing backend available - need either SDL or Windows")
52ac19b @dscharrer Remove the ARX_ prefix from configure options.
dscharrer authored
1026 endif()
1027 if(NOT (HAVE_NANOSLEEP_FUNC OR HAVE_WINAPI))
1028 message(SEND_ERROR "Need either nanosleep or WIN32.")
1029 endif()
1030 if(NOT (HAVE_CLOCK_GETTIME OR HAVE_WINAPI OR HAVE_MACH_CLOCK))
1031 message(SEND_ERROR "Need either clock_gettime or WIN32 or mach clock_get_time.")
1032 endif()
Something went wrong with that request. Please try again.