author | Ryan C. Gordon <icculus@icculus.org> |
Mon, 22 Oct 2012 23:24:16 -0400 | |
branch | stable-2.0 |
changeset 1303 | 9d642cc86b85 |
parent 1298 | 3d9ab131709a |
child 1306 | bf155bd2127b |
permissions | -rw-r--r-- |
798 | 1 |
# PhysicsFS; a portable, flexible file i/o abstraction. |
2 |
# Copyright (C) 2007 Ryan C. Gordon. |
|
3 |
# |
|
809
116b8fe30371
Renamed LICENSE to LICENSE.txt
Ryan C. Gordon <icculus@icculus.org>
parents:
805
diff
changeset
|
4 |
# Please see the file LICENSE.txt in the source's root directory. |
798 | 5 |
|
804
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
6 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.4) |
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
7 |
|
798 | 8 |
PROJECT(PhysicsFS) |
1303
9d642cc86b85
Bumped version to 2.0.3.
Ryan C. Gordon <icculus@icculus.org>
parents:
1298
diff
changeset
|
9 |
SET(PHYSFS_VERSION 2.0.3) |
950 | 10 |
|
11 |
# Increment this if/when we break backwards compatibility. |
|
952
bbe76b085d4d
Screw it, change this back.
Ryan C. Gordon <icculus@icculus.org>
parents:
950
diff
changeset
|
12 |
SET(PHYSFS_SOVERSION 1) |
798 | 13 |
|
14 |
# I hate that they define "WIN32" ... we're about to move to Win64...I hope! |
|
15 |
IF(WIN32 AND NOT WINDOWS) |
|
16 |
SET(WINDOWS TRUE) |
|
17 |
ENDIF(WIN32 AND NOT WINDOWS) |
|
18 |
||
19 |
# Bleh, let's do it for "APPLE" too. |
|
20 |
IF(APPLE AND NOT MACOSX) |
|
21 |
SET(MACOSX TRUE) |
|
22 |
ENDIF(APPLE AND NOT MACOSX) |
|
23 |
||
1172
1a5ccd9dc5a0
Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
1157
diff
changeset
|
24 |
# For now, Haiku and BeOS are the same, as far as the build system cares. |
1a5ccd9dc5a0
Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
1157
diff
changeset
|
25 |
IF(HAIKU AND NOT BEOS) |
1a5ccd9dc5a0
Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
1157
diff
changeset
|
26 |
SET(BEOS TRUE) |
1a5ccd9dc5a0
Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
1157
diff
changeset
|
27 |
ENDIF(HAIKU AND NOT BEOS) |
1a5ccd9dc5a0
Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
1157
diff
changeset
|
28 |
|
798 | 29 |
INCLUDE(CheckIncludeFile) |
30 |
INCLUDE(CheckLibraryExists) |
|
31 |
INCLUDE(CheckCSourceCompiles) |
|
32 |
||
33 |
INCLUDE_DIRECTORIES(.) |
|
34 |
#INCLUDE_DIRECTORIES(platform) |
|
35 |
#INCLUDE_DIRECTORIES(archivers) |
|
36 |
||
37 |
IF(MACOSX) |
|
803 | 38 |
# Fallback to older OS X on PowerPC to support wider range of systems... |
798 | 39 |
IF(CMAKE_OSX_ARCHITECTURES MATCHES ppc) |
801
a6d25b52f2c7
Fixes to CMakeLists.txt for Intel Mac.
Ryan C. Gordon <icculus@icculus.org>
parents:
799
diff
changeset
|
40 |
ADD_DEFINITIONS(-DMAC_OS_X_VERSION_MIN_REQUIRED=1020) |
a6d25b52f2c7
Fixes to CMakeLists.txt for Intel Mac.
Ryan C. Gordon <icculus@icculus.org>
parents:
799
diff
changeset
|
41 |
SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} " -mmacosx-version-min=10.2") |
798 | 42 |
ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES ppc) |
803 | 43 |
|
44 |
# Need these everywhere... |
|
45 |
ADD_DEFINITIONS(-fno-common) |
|
801
a6d25b52f2c7
Fixes to CMakeLists.txt for Intel Mac.
Ryan C. Gordon <icculus@icculus.org>
parents:
799
diff
changeset
|
46 |
SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} " -framework Carbon -framework IOKit") |
798 | 47 |
ENDIF(MACOSX) |
48 |
||
49 |
# Add some gcc-specific command lines. |
|
50 |
IF(CMAKE_COMPILER_IS_GNUCC) |
|
51 |
# Always build with debug symbols...you can strip it later. |
|
821
c7dd97edaa4e
Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents:
818
diff
changeset
|
52 |
ADD_DEFINITIONS(-g -pipe -Werror -fsigned-char) |
c7dd97edaa4e
Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents:
818
diff
changeset
|
53 |
|
c7dd97edaa4e
Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents:
818
diff
changeset
|
54 |
# Stupid BeOS generates warnings in the system headers. |
c7dd97edaa4e
Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents:
818
diff
changeset
|
55 |
IF(NOT BEOS) |
c7dd97edaa4e
Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents:
818
diff
changeset
|
56 |
ADD_DEFINITIONS(-Wall) |
c7dd97edaa4e
Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents:
818
diff
changeset
|
57 |
ENDIF(NOT BEOS) |
798 | 58 |
|
59 |
CHECK_C_SOURCE_COMPILES(" |
|
60 |
#if ((defined(__GNUC__)) && (__GNUC__ >= 4)) |
|
61 |
int main(int argc, char **argv) { int is_gcc4 = 1; return 0; } |
|
62 |
#else |
|
63 |
#error This is not gcc4. |
|
64 |
#endif |
|
65 |
" PHYSFS_IS_GCC4) |
|
66 |
||
67 |
IF(PHYSFS_IS_GCC4) |
|
1010
13f24148b2bb
Don't use -fvisibility=hidden on several platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1007
diff
changeset
|
68 |
# Not supported on several operating systems at this time. |
13f24148b2bb
Don't use -fvisibility=hidden on several platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1007
diff
changeset
|
69 |
IF(NOT OS2 AND NOT SOLARIS AND NOT WINDOWS) |
13f24148b2bb
Don't use -fvisibility=hidden on several platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1007
diff
changeset
|
70 |
ADD_DEFINITIONS(-fvisibility=hidden) |
13f24148b2bb
Don't use -fvisibility=hidden on several platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1007
diff
changeset
|
71 |
ENDIF(NOT OS2 AND NOT SOLARIS AND NOT WINDOWS) |
798 | 72 |
ENDIF(PHYSFS_IS_GCC4) |
73 |
ENDIF(CMAKE_COMPILER_IS_GNUCC) |
|
74 |
||
836
6514fba91816
Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents:
833
diff
changeset
|
75 |
IF(MSVC) |
6514fba91816
Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents:
833
diff
changeset
|
76 |
# VS.NET 8.0 got really really anal about strcpy, etc, which even if we |
6514fba91816
Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents:
833
diff
changeset
|
77 |
# cleaned up our code, zlib, etc still use...so disable the warning. |
6514fba91816
Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents:
833
diff
changeset
|
78 |
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS=1) |
6514fba91816
Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents:
833
diff
changeset
|
79 |
ENDIF(MSVC) |
798 | 80 |
|
81 |
# Basic chunks of source code ... |
|
82 |
||
83 |
SET(ZLIB_SRCS |
|
84 |
zlib123/adler32.c |
|
85 |
zlib123/compress.c |
|
86 |
zlib123/crc32.c |
|
87 |
zlib123/deflate.c |
|
88 |
zlib123/gzio.c |
|
89 |
zlib123/infback.c |
|
90 |
zlib123/inffast.c |
|
91 |
zlib123/inflate.c |
|
92 |
zlib123/inftrees.c |
|
93 |
zlib123/trees.c |
|
94 |
zlib123/uncompr.c |
|
95 |
zlib123/zutil.c |
|
96 |
) |
|
97 |
||
98 |
SET(LZMA_SRCS |
|
919
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
99 |
lzma/C/7zCrc.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
100 |
lzma/C/Archive/7z/7zBuffer.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
101 |
lzma/C/Archive/7z/7zDecode.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
102 |
lzma/C/Archive/7z/7zExtract.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
103 |
lzma/C/Archive/7z/7zHeader.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
104 |
lzma/C/Archive/7z/7zIn.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
105 |
lzma/C/Archive/7z/7zItem.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
106 |
lzma/C/Archive/7z/7zMethodID.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
107 |
lzma/C/Compress/Branch/BranchX86.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
108 |
lzma/C/Compress/Branch/BranchX86_2.c |
932b44ae8335
Updated for lzma changes.
Ryan C. Gordon <icculus@icculus.org>
parents:
885
diff
changeset
|
109 |
lzma/C/Compress/Lzma/LzmaDecode.c |
798 | 110 |
) |
111 |
||
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
112 |
IF(BEOS) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
113 |
# We add this explicitly, since we don't want CMake to think this |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
114 |
# is a C++ project unless we're on BeOS. |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
115 |
SET(PHYSFS_BEOS_SRCS platform/beos.cpp) |
1132
ff6943f29c3e
Fixes for Haiku support, compliments of Chris Roberts.
Ryan C. Gordon <icculus@icculus.org>
parents:
1082
diff
changeset
|
116 |
FIND_LIBRARY(BE_LIBRARY be) |
ff6943f29c3e
Fixes for Haiku support, compliments of Chris Roberts.
Ryan C. Gordon <icculus@icculus.org>
parents:
1082
diff
changeset
|
117 |
FIND_LIBRARY(ROOT_LIBRARY root) |
ff6943f29c3e
Fixes for Haiku support, compliments of Chris Roberts.
Ryan C. Gordon <icculus@icculus.org>
parents:
1082
diff
changeset
|
118 |
SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY}) |
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
119 |
ENDIF(BEOS) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
120 |
|
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
121 |
# Almost everything is "compiled" here, but things that don't apply to the |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
122 |
# build are #ifdef'd out. This is to make it easy to embed PhysicsFS into |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
123 |
# another project or bring up a new build system: just compile all the source |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
124 |
# code and #define the things you want. |
798 | 125 |
SET(PHYSFS_SRCS |
126 |
physfs.c |
|
127 |
physfs_byteorder.c |
|
128 |
physfs_unicode.c |
|
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
129 |
platform/os2.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
130 |
platform/pocketpc.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
131 |
platform/posix.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
132 |
platform/unix.c |
847
5e5e6c067413
Split out Mac OS X code from unix.c and added some Carbon-specific code...
Ryan C. Gordon <icculus@icculus.org>
parents:
836
diff
changeset
|
133 |
platform/macosx.c |
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
134 |
platform/windows.c |
798 | 135 |
archivers/dir.c |
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
136 |
archivers/grp.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
137 |
archivers/hog.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
138 |
archivers/lzma.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
139 |
archivers/mvl.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
140 |
archivers/qpak.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
141 |
archivers/wad.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
142 |
archivers/zip.c |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
143 |
${PHYSFS_BEOS_SRCS} |
798 | 144 |
) |
145 |
||
146 |
||
147 |
# platform layers ... |
|
148 |
||
149 |
IF(UNIX) |
|
150 |
IF(BEOS) |
|
151 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
|
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
152 |
SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
153 |
SET(HAVE_PTHREAD_H TRUE) |
798 | 154 |
ELSE(BEOS) |
155 |
# !!! FIXME |
|
156 |
# AC_DEFINE([PHYSFS_HAVE_LLSEEK], 1, [define if we have llseek]) |
|
157 |
CHECK_INCLUDE_FILE(sys/ucred.h HAVE_UCRED_H) |
|
158 |
IF(HAVE_UCRED_H) |
|
159 |
ADD_DEFINITIONS(-DPHYSFS_HAVE_SYS_UCRED_H=1) |
|
160 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
|
161 |
ENDIF(HAVE_UCRED_H) |
|
162 |
||
163 |
CHECK_INCLUDE_FILE(mntent.h HAVE_MNTENT_H) |
|
164 |
IF(HAVE_MNTENT_H) |
|
165 |
ADD_DEFINITIONS(-DPHYSFS_HAVE_MNTENT_H=1) |
|
166 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
|
167 |
ENDIF(HAVE_MNTENT_H) |
|
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
168 |
|
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
169 |
CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
170 |
IF(HAVE_PTHREAD_H) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
171 |
SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
172 |
ENDIF(HAVE_PTHREAD_H) |
798 | 173 |
ENDIF(BEOS) |
174 |
ENDIF(UNIX) |
|
175 |
||
176 |
IF(WINDOWS) |
|
177 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
|
178 |
SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
|
179 |
ENDIF(WINDOWS) |
|
180 |
||
181 |
IF(NOT PHYSFS_HAVE_CDROM_SUPPORT) |
|
182 |
ADD_DEFINITIONS(-DPHYSFS_NO_CDROM_SUPPORT=1) |
|
183 |
MESSAGE(WARNING " ***") |
|
184 |
MESSAGE(WARNING " *** There is no CD-ROM support in this build!") |
|
185 |
MESSAGE(WARNING " *** PhysicsFS will just pretend there are no discs.") |
|
186 |
MESSAGE(WARNING " *** This may be fine, depending on how PhysicsFS is used,") |
|
187 |
MESSAGE(WARNING " *** but is this what you REALLY wanted?") |
|
188 |
MESSAGE(WARNING " *** (Maybe fix CMakeLists.txt, or write a platform driver?)") |
|
189 |
MESSAGE(WARNING " ***") |
|
190 |
ENDIF(NOT PHYSFS_HAVE_CDROM_SUPPORT) |
|
191 |
||
192 |
IF(PHYSFS_HAVE_THREAD_SUPPORT) |
|
193 |
ADD_DEFINITIONS(-D_REENTRANT -D_THREAD_SAFE) |
|
194 |
ELSE(PHYSFS_HAVE_THREAD_SUPPORT) |
|
1048
22b96d39d1a2
Catch case where we use the Unix code on a non-Unix system that lacks pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents:
1043
diff
changeset
|
195 |
ADD_DEFINITIONS(-DPHYSFS_NO_THREAD_SUPPORT=1) |
798 | 196 |
MESSAGE(WARNING " ***") |
197 |
MESSAGE(WARNING " *** There is no thread support in this build!") |
|
198 |
MESSAGE(WARNING " *** PhysicsFS will NOT be reentrant!") |
|
199 |
MESSAGE(WARNING " *** This may be fine, depending on how PhysicsFS is used,") |
|
200 |
MESSAGE(WARNING " *** but is this what you REALLY wanted?") |
|
201 |
MESSAGE(WARNING " *** (Maybe fix CMakeLists.txt, or write a platform driver?)") |
|
202 |
MESSAGE(WARNING " ***") |
|
203 |
ENDIF(PHYSFS_HAVE_THREAD_SUPPORT) |
|
204 |
||
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
205 |
CHECK_INCLUDE_FILE(assert.h HAVE_ASSERT_H) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
206 |
IF(HAVE_ASSERT_H) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
207 |
ADD_DEFINITIONS(-DHAVE_ASSERT_H=1) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
208 |
ENDIF(HAVE_ASSERT_H) |
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
209 |
|
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
210 |
|
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
211 |
|
798 | 212 |
# Archivers ... |
213 |
||
214 |
OPTION(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE) |
|
215 |
IF(PHYSFS_ARCHIVE_ZIP) |
|
216 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_ZIP=1) |
|
217 |
SET(PHYSFS_NEED_ZLIB TRUE) |
|
218 |
ENDIF(PHYSFS_ARCHIVE_ZIP) |
|
219 |
||
220 |
OPTION(PHYSFS_ARCHIVE_7Z "Enable 7zip support" TRUE) |
|
221 |
IF(PHYSFS_ARCHIVE_7Z) |
|
222 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_7Z=1) |
|
223 |
# !!! FIXME: rename to 7z.c? |
|
818
e36f23f49042
Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents:
809
diff
changeset
|
224 |
SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${LZMA_SRCS}) |
798 | 225 |
ENDIF(PHYSFS_ARCHIVE_7Z) |
226 |
||
227 |
OPTION(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE) |
|
228 |
IF(PHYSFS_ARCHIVE_GRP) |
|
229 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_GRP=1) |
|
230 |
ENDIF(PHYSFS_ARCHIVE_GRP) |
|
231 |
||
232 |
OPTION(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE) |
|
233 |
IF(PHYSFS_ARCHIVE_WAD) |
|
234 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_WAD=1) |
|
235 |
ENDIF(PHYSFS_ARCHIVE_WAD) |
|
236 |
||
237 |
OPTION(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE) |
|
238 |
IF(PHYSFS_ARCHIVE_HOG) |
|
239 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_HOG=1) |
|
240 |
ENDIF(PHYSFS_ARCHIVE_HOG) |
|
241 |
||
242 |
OPTION(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE) |
|
243 |
IF(PHYSFS_ARCHIVE_MVL) |
|
244 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_MVL=1) |
|
245 |
ENDIF(PHYSFS_ARCHIVE_MVL) |
|
246 |
||
247 |
OPTION(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE) |
|
248 |
IF(PHYSFS_ARCHIVE_QPAK) |
|
249 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_QPAK=1) |
|
250 |
ENDIF(PHYSFS_ARCHIVE_QPAK) |
|
251 |
||
252 |
||
253 |
# See if some archiver required zlib, and see about using system version. |
|
254 |
||
255 |
IF(PHYSFS_NEED_ZLIB) |
|
1007
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
256 |
FIND_PACKAGE(ZLIB) |
798 | 257 |
|
1007
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
258 |
IF(ZLIB_FOUND) |
798 | 259 |
OPTION(PHYSFS_INTERNAL_ZLIB "Link own zlib instead of system library" FALSE) |
260 |
ELSE(HAVE_SYSTEM_ZLIB) |
|
261 |
SET(PHYSFS_INTERNAL_ZLIB TRUE) |
|
1007
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
262 |
ENDIF(ZLIB_FOUND) |
798 | 263 |
|
264 |
IF(PHYSFS_INTERNAL_ZLIB) |
|
265 |
INCLUDE_DIRECTORIES(zlib123) |
|
266 |
ADD_DEFINITIONS(-DZ_PREFIX=1) |
|
267 |
SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${ZLIB_SRCS}) |
|
268 |
ELSE(PHYSFS_INTERNAL_ZLIB) |
|
1007
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
269 |
SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${ZLIB_LIBRARY}) |
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
270 |
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) |
798 | 271 |
ENDIF(PHYSFS_INTERNAL_ZLIB) |
272 |
ENDIF(PHYSFS_NEED_ZLIB) |
|
273 |
||
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
274 |
OPTION(PHYSFS_BUILD_STATIC "Build static library" TRUE) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
275 |
IF(PHYSFS_BUILD_STATIC) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
276 |
ADD_LIBRARY(physfs-static STATIC ${PHYSFS_SRCS}) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
277 |
SET_TARGET_PROPERTIES(physfs-static PROPERTIES OUTPUT_NAME "physfs") |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
278 |
SET(PHYSFS_LIB_TARGET physfs-static) |
833
b260f190aa59
Whoops, switched two strings in CMakeLists.txt
Ryan C. Gordon <icculus@icculus.org>
parents:
827
diff
changeset
|
279 |
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static") |
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
280 |
ENDIF(PHYSFS_BUILD_STATIC) |
798 | 281 |
|
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
282 |
OPTION(PHYSFS_BUILD_SHARED "Build shared library" TRUE) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
283 |
IF(PHYSFS_BUILD_SHARED) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
284 |
ADD_LIBRARY(physfs SHARED ${PHYSFS_SRCS}) |
805
b462f06edbca
Install libraries with a VERSION and SOVERSION.
Ryan C. Gordon <icculus@icculus.org>
parents:
804
diff
changeset
|
285 |
SET_TARGET_PROPERTIES(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) |
b462f06edbca
Install libraries with a VERSION and SOVERSION.
Ryan C. Gordon <icculus@icculus.org>
parents:
804
diff
changeset
|
286 |
SET_TARGET_PROPERTIES(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) |
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
287 |
TARGET_LINK_LIBRARIES(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS}) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
288 |
SET(PHYSFS_LIB_TARGET physfs) |
833
b260f190aa59
Whoops, switched two strings in CMakeLists.txt
Ryan C. Gordon <icculus@icculus.org>
parents:
827
diff
changeset
|
289 |
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs") |
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
290 |
ENDIF(PHYSFS_BUILD_SHARED) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
291 |
|
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
292 |
IF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
293 |
MESSAGE(FATAL "Both shared and static libraries are disabled!") |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
294 |
ENDIF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
295 |
|
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
296 |
# CMake FAQ says I need this... |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
297 |
IF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
298 |
SET_TARGET_PROPERTIES(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
299 |
SET_TARGET_PROPERTIES(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
300 |
ENDIF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC) |
798 | 301 |
|
878
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
302 |
OPTION(PHYSFS_BUILD_TEST "Build stdio test program." TRUE) |
798 | 303 |
MARK_AS_ADVANCED(PHYSFS_BUILD_TEST) |
304 |
IF(PHYSFS_BUILD_TEST) |
|
1007
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
305 |
FIND_PATH(READLINE_H readline/readline.h) |
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
306 |
FIND_PATH(HISTORY_H readline/history.h) |
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
307 |
IF(READLINE_H AND HISTORY_H) |
1132
ff6943f29c3e
Fixes for Haiku support, compliments of Chris Roberts.
Ryan C. Gordon <icculus@icculus.org>
parents:
1082
diff
changeset
|
308 |
FIND_LIBRARY(CURSES_LIBRARY NAMES curses ncurses) |
ff6943f29c3e
Fixes for Haiku support, compliments of Chris Roberts.
Ryan C. Gordon <icculus@icculus.org>
parents:
1082
diff
changeset
|
309 |
SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY}) |
1007
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
310 |
FIND_LIBRARY(READLINE_LIBRARY readline) |
1298
3d9ab131709a
Don't look for libhistory.
Ryan C. Gordon <icculus@icculus.org>
parents:
1172
diff
changeset
|
311 |
IF(READLINE_LIBRARY) |
798 | 312 |
SET(HAVE_SYSTEM_READLINE TRUE) |
1007
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
313 |
SET(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY}) |
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
314 |
INCLUDE_DIRECTORIES(${READLINE_H} ${HISTORY_H}) |
798 | 315 |
ADD_DEFINITIONS(-DPHYSFS_HAVE_READLINE=1) |
1298
3d9ab131709a
Don't look for libhistory.
Ryan C. Gordon <icculus@icculus.org>
parents:
1172
diff
changeset
|
316 |
ENDIF(READLINE_LIBRARY) |
1007
d6729def6251
Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
317 |
ENDIF(READLINE_H AND HISTORY_H) |
798 | 318 |
ADD_EXECUTABLE(test_physfs test/test_physfs.c) |
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
319 |
TARGET_LINK_LIBRARIES(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS}) |
804
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
320 |
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs") |
798 | 321 |
ENDIF(PHYSFS_BUILD_TEST) |
322 |
||
1157
f71c23d5493f
stable-2.0 now defaults to NOT building wxWidgets test program.
Ryan C. Gordon <icculus@icculus.org>
parents:
1150
diff
changeset
|
323 |
OPTION(PHYSFS_BUILD_WX_TEST "Build wxWidgets test program." FALSE) |
878
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
324 |
MARK_AS_ADVANCED(PHYSFS_BUILD_WX_TEST) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
325 |
IF(PHYSFS_BUILD_WX_TEST) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
326 |
SET(wxWidgets_USE_LIBS base core adv) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
327 |
SET(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
328 |
FIND_PACKAGE(wxWidgets) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
329 |
IF(wxWidgets_FOUND) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
330 |
INCLUDE(${wxWidgets_USE_FILE}) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
331 |
ADD_EXECUTABLE(wxtest_physfs test/wxtest_physfs.cpp) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
332 |
SET_SOURCE_FILES_PROPERTIES(test/wxtest_physfs.cpp COMPILE_FLAGS ${wxWidgets_CXX_FLAGS}) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
333 |
TARGET_LINK_LIBRARIES(wxtest_physfs ${PHYSFS_LIB_TARGET} ${wxWidgets_LIBRARIES} ${OTHER_LDFLAGS}) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
334 |
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";wxtest_physfs") |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
335 |
ELSE(wxWidgets_FOUND) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
336 |
MESSAGE(STATUS "wxWidgets not found. Disabling wx test app.") |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
337 |
SET(PHYSFS_BUILD_WX_TEST FALSE) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
338 |
ENDIF(wxWidgets_FOUND) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
339 |
ENDIF(PHYSFS_BUILD_WX_TEST) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
340 |
|
804
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
341 |
INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS} |
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
342 |
RUNTIME DESTINATION bin |
1141
2ad0dd5a701f
Use LIB_SUFFIX to install to lib64 instead of lib (thanks, Cristian!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1132
diff
changeset
|
343 |
LIBRARY DESTINATION lib${LIB_SUFFIX} |
2ad0dd5a701f
Use LIB_SUFFIX to install to lib64 instead of lib (thanks, Cristian!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1132
diff
changeset
|
344 |
ARCHIVE DESTINATION lib${LIB_SUFFIX}) |
804
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
345 |
INSTALL(FILES physfs.h DESTINATION include) |
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
346 |
|
798 | 347 |
FIND_PACKAGE(Doxygen) |
348 |
IF(DOXYGEN_FOUND) |
|
1150
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
349 |
SET(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
350 |
CONFIGURE_FILE( |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
351 |
"${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile" |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
352 |
"${PHYSFS_OUTPUT_DOXYFILE}" |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
353 |
COPYONLY |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
354 |
) |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
355 |
FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n") |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
356 |
FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = ${PHYSFS_VERSION}\n") |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
357 |
FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}/docs\n") |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
358 |
FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n") |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
359 |
|
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
360 |
ADD_CUSTOM_TARGET( |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
361 |
docs |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
362 |
${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}" |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
363 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
364 |
COMMENT "Building documentation in 'docs' directory..." |
72778f1e98f0
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1148
diff
changeset
|
365 |
) |
798 | 366 |
ELSE(DOXYGEN_FOUND) |
367 |
MESSAGE(STATUS "Doxygen not found. You won't be able to build documentation.") |
|
368 |
ENDIF(DOXYGEN_FOUND) |
|
369 |
||
885
e1fe7fe85939
Added a hack for "make dist" functionality.
Ryan C. Gordon <icculus@icculus.org>
parents:
878
diff
changeset
|
370 |
IF(UNIX) |
1043
44865546c38b
Merged 1042:dc9291957a5a from default branch: make dist fix.
Ryan C. Gordon <icculus@icculus.org>
parents:
1010
diff
changeset
|
371 |
SET(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.gz") |
44865546c38b
Merged 1042:dc9291957a5a from default branch: make dist fix.
Ryan C. Gordon <icculus@icculus.org>
parents:
1010
diff
changeset
|
372 |
ADD_CUSTOM_TARGET( |
44865546c38b
Merged 1042:dc9291957a5a from default branch: make dist fix.
Ryan C. Gordon <icculus@icculus.org>
parents:
1010
diff
changeset
|
373 |
dist |
44865546c38b
Merged 1042:dc9291957a5a from default branch: make dist fix.
Ryan C. Gordon <icculus@icculus.org>
parents:
1010
diff
changeset
|
374 |
hg archive -t tgz "${PHYSFS_TARBALL}" |
44865546c38b
Merged 1042:dc9291957a5a from default branch: make dist fix.
Ryan C. Gordon <icculus@icculus.org>
parents:
1010
diff
changeset
|
375 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
44865546c38b
Merged 1042:dc9291957a5a from default branch: make dist fix.
Ryan C. Gordon <icculus@icculus.org>
parents:
1010
diff
changeset
|
376 |
COMMENT "Building source tarball '${PHYSFS_TARBALL}'..." |
44865546c38b
Merged 1042:dc9291957a5a from default branch: make dist fix.
Ryan C. Gordon <icculus@icculus.org>
parents:
1010
diff
changeset
|
377 |
) |
885
e1fe7fe85939
Added a hack for "make dist" functionality.
Ryan C. Gordon <icculus@icculus.org>
parents:
878
diff
changeset
|
378 |
ENDIF(UNIX) |
798 | 379 |
|
380 |
MACRO(MESSAGE_BOOL_OPTION _NAME _VALUE) |
|
381 |
IF(${_VALUE}) |
|
382 |
MESSAGE(STATUS " ${_NAME}: enabled") |
|
383 |
ELSE(${_VALUE}) |
|
384 |
MESSAGE(STATUS " ${_NAME}: disabled") |
|
385 |
ENDIF(${_VALUE}) |
|
386 |
ENDMACRO(MESSAGE_BOOL_OPTION) |
|
387 |
||
388 |
MESSAGE(STATUS "PhysicsFS will build with the following options:") |
|
389 |
MESSAGE_BOOL_OPTION("ZIP support" PHYSFS_ARCHIVE_ZIP) |
|
390 |
MESSAGE_BOOL_OPTION("7zip support" PHYSFS_ARCHIVE_7Z) |
|
391 |
MESSAGE_BOOL_OPTION("GRP support" PHYSFS_ARCHIVE_GRP) |
|
392 |
MESSAGE_BOOL_OPTION("WAD support" PHYSFS_ARCHIVE_WAD) |
|
393 |
MESSAGE_BOOL_OPTION("HOG support" PHYSFS_ARCHIVE_HOG) |
|
394 |
MESSAGE_BOOL_OPTION("MVL support" PHYSFS_ARCHIVE_MVL) |
|
395 |
MESSAGE_BOOL_OPTION("QPAK support" PHYSFS_ARCHIVE_QPAK) |
|
396 |
MESSAGE_BOOL_OPTION("CD-ROM drive support" PHYSFS_HAVE_CDROM_SUPPORT) |
|
397 |
MESSAGE_BOOL_OPTION("Thread safety" PHYSFS_HAVE_THREAD_SUPPORT) |
|
398 |
MESSAGE_BOOL_OPTION("Build own zlib" PHYSFS_INTERNAL_ZLIB) |
|
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
399 |
MESSAGE_BOOL_OPTION("Build static library" PHYSFS_BUILD_STATIC) |
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
400 |
MESSAGE_BOOL_OPTION("Build shared library" PHYSFS_BUILD_SHARED) |
878
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
401 |
MESSAGE_BOOL_OPTION("Build wxWidgets test program" PHYSFS_BUILD_WX_TEST) |
6d65c5e0049a
Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents:
847
diff
changeset
|
402 |
MESSAGE_BOOL_OPTION("Build stdio test program" PHYSFS_BUILD_TEST) |
798 | 403 |
IF(PHYSFS_BUILD_TEST) |
404 |
MESSAGE_BOOL_OPTION(" Use readline in test program" HAVE_SYSTEM_READLINE) |
|
405 |
ENDIF(PHYSFS_BUILD_TEST) |
|
406 |
||
407 |
# end of CMakeLists.txt ... |