author | Ryan C. Gordon <icculus@icculus.org> |
Wed, 13 Nov 2013 00:38:35 -0500 | |
changeset 1338 | aae614cdd005 |
parent 1318 | 5488d36ff8b5 |
child 1391 | 06aa5aca8518 |
permissions | -rw-r--r-- |
798 | 1 |
# PhysicsFS; a portable, flexible file i/o abstraction. |
2 |
# |
|
809
116b8fe30371
Renamed LICENSE to LICENSE.txt
Ryan C. Gordon <icculus@icculus.org>
parents:
805
diff
changeset
|
3 |
# Please see the file LICENSE.txt in the source's root directory. |
798 | 4 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
5 |
cmake_minimum_required(VERSION 2.8.4) |
804
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
6 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
7 |
project(PhysicsFS) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
8 |
set(PHYSFS_VERSION 2.1.0) |
950 | 9 |
|
10 |
# Increment this if/when we break backwards compatibility. |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
11 |
set(PHYSFS_SOVERSION 1) |
798 | 12 |
|
13 |
# I hate that they define "WIN32" ... we're about to move to Win64...I hope! |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
14 |
if(WIN32 AND NOT WINDOWS) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
15 |
set(WINDOWS TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
16 |
endif() |
798 | 17 |
|
18 |
# Bleh, let's do it for "APPLE" too. |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
19 |
if(APPLE AND NOT MACOSX) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
20 |
set(MACOSX TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
21 |
endif() |
798 | 22 |
|
1171
e4ca84e1d289
Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
1159
diff
changeset
|
23 |
# For now, Haiku and BeOS are the same, as far as the build system cares. |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
24 |
if(HAIKU AND NOT BEOS) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
25 |
set(BEOS TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
26 |
endif() |
1171
e4ca84e1d289
Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
1159
diff
changeset
|
27 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
28 |
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
29 |
set(SOLARIS TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
30 |
endif() |
985 | 31 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
32 |
include(CheckIncludeFile) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
33 |
include(CheckLibraryExists) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
34 |
include(CheckCSourceCompiles) |
798 | 35 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
36 |
include_directories(./src) |
798 | 37 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
38 |
if(MACOSX) |
803 | 39 |
# Fallback to older OS X on PowerPC to support wider range of systems... |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
40 |
if(CMAKE_OSX_ARCHITECTURES MATCHES ppc) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
41 |
add_definitions(-DMAC_OS_X_VERSION_MIN_REQUIRED=1020) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
42 |
set(OTHER_LDFLAGS ${OTHER_LDFLAGS} " -mmacosx-version-min=10.2") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
43 |
endif() |
803 | 44 |
|
45 |
# Need these everywhere... |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
46 |
add_definitions(-fno-common) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
47 |
set(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework Carbon -framework IOKit") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
48 |
endif() |
798 | 49 |
|
50 |
# Add some gcc-specific command lines. |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
51 |
if(CMAKE_COMPILER_IS_GNUCC) |
798 | 52 |
# Always build with debug symbols...you can strip it later. |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
53 |
add_definitions(-g -pipe -Werror -fsigned-char) |
821
c7dd97edaa4e
Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents:
818
diff
changeset
|
54 |
|
c7dd97edaa4e
Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents:
818
diff
changeset
|
55 |
# Stupid BeOS generates warnings in the system headers. |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
56 |
if(NOT BEOS) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
57 |
add_definitions(-Wall) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
58 |
endif() |
798 | 59 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
60 |
check_c_source_compiles(" |
798 | 61 |
#if ((defined(__GNUC__)) && (__GNUC__ >= 4)) |
62 |
int main(int argc, char **argv) { int is_gcc4 = 1; return 0; } |
|
63 |
#else |
|
64 |
#error This is not gcc4. |
|
65 |
#endif |
|
66 |
" PHYSFS_IS_GCC4) |
|
67 |
||
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
68 |
if(PHYSFS_IS_GCC4) |
1009
56a3873c63e4
Don't use -fvisibility=hidden on Windows, since MinGW doesn't support it. :(
Ryan C. Gordon <icculus@icculus.org>
parents:
1005
diff
changeset
|
69 |
# Not supported on several operating systems at this time. |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
70 |
if(NOT SOLARIS AND NOT WINDOWS) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
71 |
add_definitions(-fvisibility=hidden) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
72 |
endif() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
73 |
endif() |
1040
5fc90d008821
Prevent bogus addition of -rpath to libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
1039
diff
changeset
|
74 |
|
5fc90d008821
Prevent bogus addition of -rpath to libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
1039
diff
changeset
|
75 |
# Don't use -rpath. |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
76 |
set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
77 |
endif() |
798 | 78 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
79 |
if(CMAKE_C_COMPILER_ID STREQUAL "SunPro") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
80 |
add_definitions(-erroff=E_EMPTY_TRANSLATION_UNIT) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
81 |
add_definitions(-xldscope=hidden) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
82 |
endif() |
989
70132355a297
Ignore empty files (like #ifdef'd out platform code) on Sun Studio compiler.
Ryan C. Gordon <icculus@icculus.org>
parents:
985
diff
changeset
|
83 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
84 |
if(MSVC) |
836
6514fba91816
Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents:
833
diff
changeset
|
85 |
# 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
|
86 |
# cleaned up our code, zlib, etc still use...so disable the warning. |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
87 |
add_definitions(-D_CRT_SECURE_NO_WARNINGS=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
88 |
endif() |
798 | 89 |
|
90 |
# Basic chunks of source code ... |
|
91 |
||
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
92 |
set(LZMA_SRCS |
972
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
93 |
src/lzma/C/7zCrc.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
94 |
src/lzma/C/Archive/7z/7zBuffer.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
95 |
src/lzma/C/Archive/7z/7zDecode.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
96 |
src/lzma/C/Archive/7z/7zExtract.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
97 |
src/lzma/C/Archive/7z/7zHeader.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
98 |
src/lzma/C/Archive/7z/7zIn.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
99 |
src/lzma/C/Archive/7z/7zItem.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
100 |
src/lzma/C/Archive/7z/7zMethodID.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
101 |
src/lzma/C/Compress/Branch/BranchX86.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
102 |
src/lzma/C/Compress/Branch/BranchX86_2.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
103 |
src/lzma/C/Compress/Lzma/LzmaDecode.c |
798 | 104 |
) |
105 |
||
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
106 |
if(BEOS) |
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
|
107 |
# 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
|
108 |
# is a C++ project unless we're on BeOS. |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
109 |
set(PHYSFS_BEOS_SRCS src/platform_beos.cpp) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
110 |
find_library(BE_LIBRARY be) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
111 |
find_library(ROOT_LIBRARY root) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
112 |
set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
113 |
endif() |
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
|
114 |
|
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 |
# 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
|
116 |
# 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
|
117 |
# 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
|
118 |
# code and #define the things you want. |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
119 |
set(PHYSFS_SRCS |
972
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
120 |
src/physfs.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
121 |
src/physfs_byteorder.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
122 |
src/physfs_unicode.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
123 |
src/platform_posix.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
124 |
src/platform_unix.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
125 |
src/platform_macosx.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
126 |
src/platform_windows.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
127 |
src/archiver_dir.c |
1128
067d8e76261e
Moved most the cut-and-paste between simple archivers to one file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1066
diff
changeset
|
128 |
src/archiver_unpacked.c |
972
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
129 |
src/archiver_grp.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
130 |
src/archiver_hog.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
131 |
src/archiver_lzma.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
132 |
src/archiver_mvl.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
133 |
src/archiver_qpak.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
134 |
src/archiver_wad.c |
254427fc42ab
Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents:
956
diff
changeset
|
135 |
src/archiver_zip.c |
1315 | 136 |
src/archiver_slb.c |
1064
cc4db73e87d1
ISO9660 archiver, compliments of Christoph Nelles.
Ryan C. Gordon <icculus@icculus.org>
parents:
1051
diff
changeset
|
137 |
src/archiver_iso9660.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
|
138 |
${PHYSFS_BEOS_SRCS} |
798 | 139 |
) |
140 |
||
141 |
||
142 |
# platform layers ... |
|
143 |
||
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
144 |
if(UNIX) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
145 |
if(BEOS) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
146 |
set(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
147 |
set(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
148 |
set(HAVE_PTHREAD_H TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
149 |
else() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
150 |
check_include_file(sys/ucred.h HAVE_UCRED_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
151 |
if(HAVE_UCRED_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
152 |
add_definitions(-DPHYSFS_HAVE_SYS_UCRED_H=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
153 |
set(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
154 |
endif() |
798 | 155 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
156 |
check_include_file(mntent.h HAVE_MNTENT_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
157 |
if(HAVE_MNTENT_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
158 |
add_definitions(-DPHYSFS_HAVE_MNTENT_H=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
159 |
set(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
160 |
endif() |
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
|
161 |
|
990
c25717b5c165
Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
989
diff
changeset
|
162 |
# !!! FIXME: Solaris fails this, because mnttab.h implicitly |
c25717b5c165
Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
989
diff
changeset
|
163 |
# !!! FIXME: depends on other system headers. :( |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
164 |
#check_include_file(sys/mnttab.h HAVE_SYS_MNTTAB_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
165 |
check_c_source_compiles(" |
990
c25717b5c165
Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
989
diff
changeset
|
166 |
#include <stdio.h> |
c25717b5c165
Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
989
diff
changeset
|
167 |
#include <sys/mnttab.h> |
c25717b5c165
Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
989
diff
changeset
|
168 |
int main(int argc, char **argv) { return 0; } |
c25717b5c165
Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
989
diff
changeset
|
169 |
" HAVE_SYS_MNTTAB_H) |
c25717b5c165
Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
989
diff
changeset
|
170 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
171 |
if(HAVE_SYS_MNTTAB_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
172 |
add_definitions(-DPHYSFS_HAVE_SYS_MNTTAB_H=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
173 |
set(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
174 |
endif() |
990
c25717b5c165
Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents:
989
diff
changeset
|
175 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
176 |
check_include_file(pthread.h HAVE_PTHREAD_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
177 |
if(HAVE_PTHREAD_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
178 |
set(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
1318
5488d36ff8b5
Only check for pthread library if pthread.h was found.
Ryan C. Gordon <icculus@icculus.org>
parents:
1317
diff
changeset
|
179 |
find_library(PTHREAD_LIBRARY pthread) |
5488d36ff8b5
Only check for pthread library if pthread.h was found.
Ryan C. Gordon <icculus@icculus.org>
parents:
1317
diff
changeset
|
180 |
if(PTHREAD_LIBRARY) |
5488d36ff8b5
Only check for pthread library if pthread.h was found.
Ryan C. Gordon <icculus@icculus.org>
parents:
1317
diff
changeset
|
181 |
set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${PTHREAD_LIBRARY}) |
5488d36ff8b5
Only check for pthread library if pthread.h was found.
Ryan C. Gordon <icculus@icculus.org>
parents:
1317
diff
changeset
|
182 |
endif() |
1317
4ea85d1717b0
From stable-2.0: explicitly check for pthread library, and link against it.
Ryan C. Gordon <icculus@icculus.org>
parents:
1315
diff
changeset
|
183 |
endif() |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
184 |
endif() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
185 |
endif() |
798 | 186 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
187 |
if(WINDOWS) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
188 |
set(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
189 |
set(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
190 |
endif() |
798 | 191 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
192 |
if(NOT PHYSFS_HAVE_CDROM_SUPPORT) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
193 |
add_definitions(-DPHYSFS_NO_CDROM_SUPPORT=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
194 |
message(WARNING " ***") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
195 |
message(WARNING " *** There is no CD-ROM support in this build!") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
196 |
message(WARNING " *** PhysicsFS will just pretend there are no discs.") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
197 |
message(WARNING " *** This may be fine, depending on how PhysicsFS is used,") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
198 |
message(WARNING " *** but is this what you REALLY wanted?") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
199 |
message(WARNING " *** (Maybe fix CMakeLists.txt, or write a platform driver?)") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
200 |
message(WARNING " ***") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
201 |
endif() |
798 | 202 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
203 |
if(PHYSFS_HAVE_THREAD_SUPPORT) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
204 |
add_definitions(-D_REENTRANT -D_THREAD_SAFE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
205 |
else() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
206 |
add_definitions(-DPHYSFS_NO_THREAD_SUPPORT=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
207 |
message(WARNING " ***") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
208 |
message(WARNING " *** There is no thread support in this build!") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
209 |
message(WARNING " *** PhysicsFS will NOT be reentrant!") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
210 |
message(WARNING " *** This may be fine, depending on how PhysicsFS is used,") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
211 |
message(WARNING " *** but is this what you REALLY wanted?") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
212 |
message(WARNING " *** (Maybe fix CMakeLists.txt, or write a platform driver?)") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
213 |
message(WARNING " ***") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
214 |
endif() |
798 | 215 |
|
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
|
216 |
|
798 | 217 |
# Archivers ... |
218 |
||
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
219 |
option(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
220 |
if(PHYSFS_ARCHIVE_ZIP) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
221 |
add_definitions(-DPHYSFS_SUPPORTS_ZIP=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
222 |
endif() |
798 | 223 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
224 |
option(PHYSFS_ARCHIVE_7Z "Enable 7zip support" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
225 |
if(PHYSFS_ARCHIVE_7Z) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
226 |
add_definitions(-DPHYSFS_SUPPORTS_7Z=1) |
798 | 227 |
# !!! FIXME: rename to 7z.c? |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
228 |
set(PHYSFS_SRCS ${PHYSFS_SRCS} ${LZMA_SRCS}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
229 |
endif() |
798 | 230 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
231 |
option(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
232 |
if(PHYSFS_ARCHIVE_GRP) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
233 |
add_definitions(-DPHYSFS_SUPPORTS_GRP=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
234 |
endif() |
798 | 235 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
236 |
option(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
237 |
if(PHYSFS_ARCHIVE_WAD) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
238 |
add_definitions(-DPHYSFS_SUPPORTS_WAD=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
239 |
endif() |
798 | 240 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
241 |
option(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
242 |
if(PHYSFS_ARCHIVE_HOG) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
243 |
add_definitions(-DPHYSFS_SUPPORTS_HOG=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
244 |
endif() |
798 | 245 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
246 |
option(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
247 |
if(PHYSFS_ARCHIVE_MVL) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
248 |
add_definitions(-DPHYSFS_SUPPORTS_MVL=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
249 |
endif() |
798 | 250 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
251 |
option(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
252 |
if(PHYSFS_ARCHIVE_QPAK) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
253 |
add_definitions(-DPHYSFS_SUPPORTS_QPAK=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
254 |
endif() |
798 | 255 |
|
1315 | 256 |
option(PHYSFS_ARCHIVE_SLB "Enable I-War / Independence War SLB support" TRUE) |
257 |
if(PHYSFS_ARCHIVE_SLB) |
|
258 |
add_definitions(-DPHYSFS_SUPPORTS_SLB=1) |
|
259 |
endif() |
|
260 |
||
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
261 |
option(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
262 |
if(PHYSFS_ARCHIVE_ISO9660) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
263 |
add_definitions(-DPHYSFS_SUPPORTS_ISO9660=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
264 |
endif() |
1066
e1d83e3b5d32
Make ISO9660 archiver optional.
Ryan C. Gordon <icculus@icculus.org>
parents:
1064
diff
changeset
|
265 |
|
798 | 266 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
267 |
option(PHYSFS_BUILD_STATIC "Build static library" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
268 |
if(PHYSFS_BUILD_STATIC) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
269 |
add_library(physfs-static STATIC ${PHYSFS_SRCS}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
270 |
set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
271 |
set(PHYSFS_LIB_TARGET physfs-static) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
272 |
set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
273 |
endif() |
798 | 274 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
275 |
option(PHYSFS_BUILD_SHARED "Build shared library" TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
276 |
if(PHYSFS_BUILD_SHARED) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
277 |
add_library(physfs SHARED ${PHYSFS_SRCS}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
278 |
set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
279 |
set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
280 |
target_link_libraries(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
281 |
set(PHYSFS_LIB_TARGET physfs) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
282 |
set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
283 |
endif() |
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
284 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
285 |
if(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
286 |
message(FATAL "Both shared and static libraries are disabled!") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
287 |
endif() |
802
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
288 |
|
d04103af68a5
Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents:
801
diff
changeset
|
289 |
# CMake FAQ says I need this... |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
290 |
if(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
291 |
set_target_properties(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
292 |
set_target_properties(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
293 |
endif() |
798 | 294 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
295 |
option(PHYSFS_BUILD_TEST "Build stdio test program." TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
296 |
mark_as_advanced(PHYSFS_BUILD_TEST) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
297 |
if(PHYSFS_BUILD_TEST) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
298 |
find_path(READLINE_H readline/readline.h) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
299 |
find_path(HISTORY_H readline/history.h) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
300 |
if(READLINE_H AND HISTORY_H) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
301 |
find_library(CURSES_LIBRARY NAMES curses ncurses) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
302 |
set(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
303 |
find_library(READLINE_LIBRARY readline) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
304 |
if(READLINE_LIBRARY) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
305 |
set(HAVE_SYSTEM_READLINE TRUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
306 |
set(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
307 |
include_directories(${READLINE_H} ${HISTORY_H}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
308 |
add_definitions(-DPHYSFS_HAVE_READLINE=1) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
309 |
endif() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
310 |
endif() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
311 |
add_executable(test_physfs test/test_physfs.c) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
312 |
target_link_libraries(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
313 |
set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
314 |
endif() |
798 | 315 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
316 |
install(TARGETS ${PHYSFS_INSTALL_TARGETS} |
804
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
317 |
RUNTIME DESTINATION bin |
1140
079b6bf97b23
Use LIB_SUFFIX to install to lib64 instead of lib (thanks, Cristian!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1139
diff
changeset
|
318 |
LIBRARY DESTINATION lib${LIB_SUFFIX} |
079b6bf97b23
Use LIB_SUFFIX to install to lib64 instead of lib (thanks, Cristian!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1139
diff
changeset
|
319 |
ARCHIVE DESTINATION lib${LIB_SUFFIX}) |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
320 |
install(FILES src/physfs.h DESTINATION include) |
804
45c29325e017
Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents:
803
diff
changeset
|
321 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
322 |
find_package(Doxygen) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
323 |
if(DOXYGEN_FOUND) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
324 |
set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
325 |
configure_file( |
1153
5cbedebaa623
Corrected doc paths for development branch.
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
326 |
"${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile" |
1151
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
327 |
"${PHYSFS_OUTPUT_DOXYFILE}" |
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
328 |
COPYONLY |
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
329 |
) |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
330 |
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
331 |
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = \"${PHYSFS_VERSION}\"\n") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
332 |
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = \"${CMAKE_CURRENT_BINARY_DIR}/docs\"\n") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
333 |
file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n") |
1151
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
334 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
335 |
add_custom_target( |
1151
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
336 |
docs |
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
337 |
${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}" |
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
338 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
339 |
COMMENT "Building documentation in 'docs' directory..." |
a9e1bbe6e8d6
Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents:
1140
diff
changeset
|
340 |
) |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
341 |
else() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
342 |
message(STATUS "Doxygen not found. You won't be able to build documentation.") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
343 |
endif() |
798 | 344 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
345 |
if(UNIX) |
1310
3382edc8a7f9
Use .tar.bz2 on this branch, too.
Ryan C. Gordon <icculus@icculus.org>
parents:
1309
diff
changeset
|
346 |
set(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.bz2") |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
347 |
add_custom_target( |
1041
f7b7996e54f1
Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1040
diff
changeset
|
348 |
dist |
1310
3382edc8a7f9
Use .tar.bz2 on this branch, too.
Ryan C. Gordon <icculus@icculus.org>
parents:
1309
diff
changeset
|
349 |
hg archive -t tbz2 "${PHYSFS_TARBALL}" |
1042
dc9291957a5a
Fixed "make dist" target.
Ryan C. Gordon <icculus@icculus.org>
parents:
1041
diff
changeset
|
350 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
dc9291957a5a
Fixed "make dist" target.
Ryan C. Gordon <icculus@icculus.org>
parents:
1041
diff
changeset
|
351 |
COMMENT "Building source tarball '${PHYSFS_TARBALL}'..." |
1041
f7b7996e54f1
Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1040
diff
changeset
|
352 |
) |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
353 |
add_custom_target( |
1041
f7b7996e54f1
Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1040
diff
changeset
|
354 |
uninstall |
f7b7996e54f1
Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1040
diff
changeset
|
355 |
"${CMAKE_CURRENT_SOURCE_DIR}/extras/uninstall.sh" |
f7b7996e54f1
Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1040
diff
changeset
|
356 |
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" |
f7b7996e54f1
Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1040
diff
changeset
|
357 |
COMMENT "Uninstall the project..." |
f7b7996e54f1
Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents:
1040
diff
changeset
|
358 |
) |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
359 |
endif() |
798 | 360 |
|
1338
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
361 |
if(UNIX AND NOT APPLE) |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
362 |
configure_file( |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
363 |
"extras/physfs.pc.in" |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
364 |
"extras/physfs.pc" |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
365 |
@ONLY |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
366 |
) |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
367 |
install( |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
368 |
FILES "${CMAKE_CURRENT_BINARY_DIR}/extras/physfs.pc" |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
369 |
DESTINATION "lib/pkgconfig" |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
370 |
) |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
371 |
endif() |
aae614cdd005
Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents:
1318
diff
changeset
|
372 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
373 |
macro(message_bool_option _NAME _VALUE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
374 |
if(${_VALUE}) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
375 |
message(STATUS " ${_NAME}: enabled") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
376 |
else() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
377 |
message(STATUS " ${_NAME}: disabled") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
378 |
endif() |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
379 |
endmacro() |
798 | 380 |
|
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
381 |
message(STATUS "PhysicsFS will build with the following options:") |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
382 |
message_bool_option("ZIP support" PHYSFS_ARCHIVE_ZIP) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
383 |
message_bool_option("7zip support" PHYSFS_ARCHIVE_7Z) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
384 |
message_bool_option("GRP support" PHYSFS_ARCHIVE_GRP) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
385 |
message_bool_option("WAD support" PHYSFS_ARCHIVE_WAD) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
386 |
message_bool_option("HOG support" PHYSFS_ARCHIVE_HOG) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
387 |
message_bool_option("MVL support" PHYSFS_ARCHIVE_MVL) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
388 |
message_bool_option("QPAK support" PHYSFS_ARCHIVE_QPAK) |
1315 | 389 |
message_bool_option("SLB support" PHYSFS_ARCHIVE_SLB) |
1309
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
390 |
message_bool_option("CD-ROM drive support" PHYSFS_HAVE_CDROM_SUPPORT) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
391 |
message_bool_option("Thread safety" PHYSFS_HAVE_THREAD_SUPPORT) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
392 |
message_bool_option("Build static library" PHYSFS_BUILD_STATIC) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
393 |
message_bool_option("Build shared library" PHYSFS_BUILD_SHARED) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
394 |
message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
395 |
if(PHYSFS_BUILD_TEST) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
396 |
message_bool_option(" Use readline in test program" HAVE_SYSTEM_READLINE) |
df0609b72174
Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents:
1297
diff
changeset
|
397 |
endif() |
798 | 398 |
|
399 |
# end of CMakeLists.txt ... |
|
400 |