author | koda |
Wed, 19 Dec 2012 19:28:13 +0100 | |
changeset 8314 | 7faceaca67d4 |
parent 8288 | fd6743995dfc |
child 8304 | 620560c89284 |
child 8316 | 89232b2fa1d6 |
permissions | -rw-r--r-- |
7768 | 1 |
# PhysicsFS; a portable, flexible file i/o abstraction. |
2 |
# Copyright (C) 2007 Ryan C. Gordon. |
|
3 |
# |
|
4 |
# Please see the file LICENSE.txt in the source's root directory. |
|
5 |
||
8087
ccc99eebdac2
little cmake cleanup, search installed modules first, then our own
koda
parents:
8084
diff
changeset
|
6 |
#lines overridden by Hedgewars configuration |
ccc99eebdac2
little cmake cleanup, search installed modules first, then our own
koda
parents:
8084
diff
changeset
|
7 |
#CMAKE_MINIMUM_REQUIRED(VERSION 2.4) |
ccc99eebdac2
little cmake cleanup, search installed modules first, then our own
koda
parents:
8084
diff
changeset
|
8 |
#PROJECT(PhysicsFS) |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
9 |
SET(PHYSFS_VERSION 2.1.0) |
7768 | 10 |
|
11 |
# Increment this if/when we break backwards compatibility. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
12 |
SET(PHYSFS_SOVERSION 1) |
7768 | 13 |
|
14 |
# I hate that they define "WIN32" ... we're about to move to Win64...I hope! |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
15 |
IF(WIN32 AND NOT WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
16 |
SET(WINDOWS TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
17 |
ENDIF(WIN32 AND NOT WINDOWS) |
7768 | 18 |
|
8286 | 19 |
|
7768 | 20 |
# Bleh, let's do it for "APPLE" too. |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
21 |
IF(APPLE AND NOT MACOSX) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
22 |
SET(MACOSX TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
23 |
ENDIF(APPLE AND NOT MACOSX) |
7768 | 24 |
|
25 |
# For now, Haiku and BeOS are the same, as far as the build system cares. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
26 |
IF(HAIKU AND NOT BEOS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
27 |
SET(BEOS TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
28 |
ENDIF(HAIKU AND NOT BEOS) |
7768 | 29 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
30 |
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
31 |
SET(SOLARIS TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
32 |
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") |
7768 | 33 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
34 |
INCLUDE(CheckIncludeFile) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
35 |
INCLUDE(CheckLibraryExists) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
36 |
INCLUDE(CheckCSourceCompiles) |
7768 | 37 |
|
8288 | 38 |
find_package(SDL REQUIRED) |
8073 | 39 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) |
40 |
include_directories(${SDL_INCLUDE_DIR}) #hw |
|
41 |
include_directories(${LUA_INCLUDE_DIR}) #hw |
|
7768 | 42 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
43 |
IF(MACOSX) |
7768 | 44 |
# Fallback to older OS X on PowerPC to support wider range of systems... |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
45 |
IF(CMAKE_OSX_ARCHITECTURES MATCHES ppc) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
46 |
ADD_DEFINITIONS(-DMAC_OS_X_VERSION_MIN_REQUIRED=1020) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
47 |
SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} " -mmacosx-version-min=10.2") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
48 |
ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES ppc) |
7768 | 49 |
|
50 |
# Need these everywhere... |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
51 |
ADD_DEFINITIONS(-fno-common) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
52 |
SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework IOKit") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
53 |
ENDIF(MACOSX) |
7768 | 54 |
|
55 |
# Add some gcc-specific command lines. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
56 |
IF(CMAKE_COMPILER_IS_GNUCC) |
7768 | 57 |
# Always build with debug symbols...you can strip it later. |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
58 |
ADD_DEFINITIONS(-g -pipe -Werror -fsigned-char) |
7768 | 59 |
|
60 |
# Stupid BeOS generates warnings in the system headers. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
61 |
IF(NOT BEOS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
62 |
ADD_DEFINITIONS(-Wall) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
63 |
ENDIF(NOT BEOS) |
7768 | 64 |
|
65 |
CHECK_C_SOURCE_COMPILES(" |
|
66 |
#if ((defined(__GNUC__)) && (__GNUC__ >= 4)) |
|
67 |
int main(int argc, char **argv) { int is_gcc4 = 1; return 0; } |
|
68 |
#else |
|
69 |
#error This is not gcc4. |
|
70 |
#endif |
|
71 |
" PHYSFS_IS_GCC4) |
|
72 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
73 |
IF(PHYSFS_IS_GCC4) |
7768 | 74 |
# Not supported on several operating systems at this time. |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
75 |
IF(NOT SOLARIS AND NOT WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
76 |
ADD_DEFINITIONS(-fvisibility=hidden) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
77 |
ENDIF(NOT SOLARIS AND NOT WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
78 |
ENDIF(PHYSFS_IS_GCC4) |
7768 | 79 |
|
80 |
# Don't use -rpath. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
81 |
SET(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
82 |
ENDIF(CMAKE_COMPILER_IS_GNUCC) |
7768 | 83 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
84 |
IF(CMAKE_C_COMPILER_ID STREQUAL "SunPro") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
85 |
ADD_DEFINITIONS(-erroff=E_EMPTY_TRANSLATION_UNIT) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
86 |
ADD_DEFINITIONS(-xldscope=hidden) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
87 |
ENDIF(CMAKE_C_COMPILER_ID STREQUAL "SunPro") |
7768 | 88 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
89 |
IF(MSVC) |
7768 | 90 |
# VS.NET 8.0 got really really anal about strcpy, etc, which even if we |
91 |
# cleaned up our code, zlib, etc still use...so disable the warning. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
92 |
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
93 |
ENDIF(MSVC) |
7768 | 94 |
|
95 |
# Basic chunks of source code ... |
|
96 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
97 |
SET(LZMA_SRCS |
7768 | 98 |
src/lzma/C/7zCrc.c |
99 |
src/lzma/C/Archive/7z/7zBuffer.c |
|
100 |
src/lzma/C/Archive/7z/7zDecode.c |
|
101 |
src/lzma/C/Archive/7z/7zExtract.c |
|
102 |
src/lzma/C/Archive/7z/7zHeader.c |
|
103 |
src/lzma/C/Archive/7z/7zIn.c |
|
104 |
src/lzma/C/Archive/7z/7zItem.c |
|
105 |
src/lzma/C/Archive/7z/7zMethodID.c |
|
106 |
src/lzma/C/Compress/Branch/BranchX86.c |
|
107 |
src/lzma/C/Compress/Branch/BranchX86_2.c |
|
108 |
src/lzma/C/Compress/Lzma/LzmaDecode.c |
|
109 |
) |
|
110 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
111 |
IF(BEOS) |
7768 | 112 |
# We add this explicitly, since we don't want CMake to think this |
113 |
# is a C++ project unless we're on BeOS. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
114 |
SET(PHYSFS_BEOS_SRCS src/platform_beos.cpp) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
115 |
FIND_LIBRARY(BE_LIBRARY be) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
116 |
FIND_LIBRARY(ROOT_LIBRARY root) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
117 |
SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
118 |
ENDIF(BEOS) |
7768 | 119 |
|
120 |
# Almost everything is "compiled" here, but things that don't apply to the |
|
121 |
# build are #ifdef'd out. This is to make it easy to embed PhysicsFS into |
|
122 |
# another project or bring up a new build system: just compile all the source |
|
123 |
# code and #define the things you want. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
124 |
SET(PHYSFS_SRCS |
7768 | 125 |
src/physfs.c |
126 |
src/physfs_byteorder.c |
|
127 |
src/physfs_unicode.c |
|
128 |
src/platform_posix.c |
|
129 |
src/platform_unix.c |
|
130 |
src/platform_macosx.c |
|
131 |
src/platform_windows.c |
|
132 |
src/archiver_dir.c |
|
133 |
src/archiver_unpacked.c |
|
134 |
src/archiver_grp.c |
|
135 |
src/archiver_hog.c |
|
136 |
src/archiver_lzma.c |
|
137 |
src/archiver_mvl.c |
|
138 |
src/archiver_qpak.c |
|
139 |
src/archiver_wad.c |
|
140 |
src/archiver_zip.c |
|
141 |
src/archiver_iso9660.c |
|
8073 | 142 |
#custom files from Hedgewars |
143 |
extras/physfsrwops.c |
|
144 |
extras/physfslualoader.c |
|
145 |
extras/hwpacksmounter.c |
|
7768 | 146 |
${PHYSFS_BEOS_SRCS} |
147 |
) |
|
148 |
||
149 |
||
150 |
# platform layers ... |
|
151 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
152 |
IF(UNIX) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
153 |
IF(BEOS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
154 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
155 |
SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
156 |
SET(HAVE_PTHREAD_H TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
157 |
ELSE(BEOS) |
7768 | 158 |
CHECK_INCLUDE_FILE(sys/ucred.h HAVE_UCRED_H) |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
159 |
IF(HAVE_UCRED_H) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
160 |
ADD_DEFINITIONS(-DPHYSFS_HAVE_SYS_UCRED_H=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
161 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
162 |
ENDIF(HAVE_UCRED_H) |
7768 | 163 |
|
164 |
CHECK_INCLUDE_FILE(mntent.h HAVE_MNTENT_H) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
165 |
IF(HAVE_MNTENT_H) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
166 |
ADD_DEFINITIONS(-DPHYSFS_HAVE_MNTENT_H=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
167 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
168 |
ENDIF(HAVE_MNTENT_H) |
7768 | 169 |
|
170 |
# !!! FIXME: Solaris fails this, because mnttab.h implicitly |
|
171 |
# !!! FIXME: depends on other system headers. :( |
|
172 |
#CHECK_INCLUDE_FILE(sys/mnttab.h HAVE_SYS_MNTTAB_H) |
|
173 |
CHECK_C_SOURCE_COMPILES(" |
|
174 |
#include <stdio.h> |
|
175 |
#include <sys/mnttab.h> |
|
176 |
int main(int argc, char **argv) { return 0; } |
|
177 |
" HAVE_SYS_MNTTAB_H) |
|
178 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
179 |
IF(HAVE_SYS_MNTTAB_H) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
180 |
ADD_DEFINITIONS(-DPHYSFS_HAVE_SYS_MNTTAB_H=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
181 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
182 |
ENDIF(HAVE_SYS_MNTTAB_H) |
7768 | 183 |
|
184 |
CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
185 |
IF(HAVE_PTHREAD_H) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
186 |
SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
187 |
ENDIF(HAVE_PTHREAD_H) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
188 |
ENDIF(BEOS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
189 |
ENDIF(UNIX) |
7768 | 190 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
191 |
IF(WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
192 |
SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
193 |
SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
194 |
ENDIF(WINDOWS) |
7768 | 195 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
196 |
IF(NOT PHYSFS_HAVE_CDROM_SUPPORT) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
197 |
ADD_DEFINITIONS(-DPHYSFS_NO_CDROM_SUPPORT=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
198 |
MESSAGE(WARNING " ***") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
199 |
MESSAGE(WARNING " *** There is no CD-ROM support in this build!") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
200 |
MESSAGE(WARNING " *** PhysicsFS will just pretend there are no discs.") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
201 |
MESSAGE(WARNING " *** This may be fine, depending on how PhysicsFS is used,") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
202 |
MESSAGE(WARNING " *** but is this what you REALLY wanted?") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
203 |
MESSAGE(WARNING " *** (Maybe fix CMakeLists.txt, or write a platform driver?)") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
204 |
MESSAGE(WARNING " ***") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
205 |
ENDIF(NOT PHYSFS_HAVE_CDROM_SUPPORT) |
7768 | 206 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
207 |
IF(PHYSFS_HAVE_THREAD_SUPPORT) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
208 |
ADD_DEFINITIONS(-D_REENTRANT -D_THREAD_SAFE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
209 |
ELSE(PHYSFS_HAVE_THREAD_SUPPORT) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
210 |
ADD_DEFINITIONS(-DPHYSFS_NO_THREAD_SUPPORT=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
211 |
MESSAGE(WARNING " ***") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
212 |
MESSAGE(WARNING " *** There is no thread support in this build!") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
213 |
MESSAGE(WARNING " *** PhysicsFS will NOT be reentrant!") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
214 |
MESSAGE(WARNING " *** This may be fine, depending on how PhysicsFS is used,") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
215 |
MESSAGE(WARNING " *** but is this what you REALLY wanted?") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
216 |
MESSAGE(WARNING " *** (Maybe fix CMakeLists.txt, or write a platform driver?)") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
217 |
MESSAGE(WARNING " ***") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
218 |
ENDIF(PHYSFS_HAVE_THREAD_SUPPORT) |
7768 | 219 |
|
220 |
||
221 |
# Archivers ... |
|
222 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
223 |
OPTION(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
224 |
IF(PHYSFS_ARCHIVE_ZIP) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
225 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_ZIP=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
226 |
ENDIF(PHYSFS_ARCHIVE_ZIP) |
7768 | 227 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
228 |
OPTION(PHYSFS_ARCHIVE_7Z "Enable 7zip support" FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
229 |
IF(PHYSFS_ARCHIVE_7Z) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
230 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_7Z=1) |
7768 | 231 |
# !!! FIXME: rename to 7z.c? |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
232 |
SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${LZMA_SRCS}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
233 |
ENDIF(PHYSFS_ARCHIVE_7Z) |
7768 | 234 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
235 |
OPTION(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
236 |
IF(PHYSFS_ARCHIVE_GRP) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
237 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_GRP=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
238 |
ENDIF(PHYSFS_ARCHIVE_GRP) |
7768 | 239 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
240 |
OPTION(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
241 |
IF(PHYSFS_ARCHIVE_WAD) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
242 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_WAD=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
243 |
ENDIF(PHYSFS_ARCHIVE_WAD) |
7768 | 244 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
245 |
OPTION(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
246 |
IF(PHYSFS_ARCHIVE_HOG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
247 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_HOG=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
248 |
ENDIF(PHYSFS_ARCHIVE_HOG) |
7768 | 249 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
250 |
OPTION(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
251 |
IF(PHYSFS_ARCHIVE_MVL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
252 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_MVL=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
253 |
ENDIF(PHYSFS_ARCHIVE_MVL) |
7768 | 254 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
255 |
OPTION(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
256 |
IF(PHYSFS_ARCHIVE_QPAK) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
257 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_QPAK=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
258 |
ENDIF(PHYSFS_ARCHIVE_QPAK) |
7768 | 259 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
260 |
OPTION(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
261 |
IF(PHYSFS_ARCHIVE_ISO9660) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
262 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_ISO9660=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
263 |
ENDIF(PHYSFS_ARCHIVE_ISO9660) |
7768 | 264 |
|
8087
ccc99eebdac2
little cmake cleanup, search installed modules first, then our own
koda
parents:
8084
diff
changeset
|
265 |
#as needed by Hedgewars configuration |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
266 |
IF(WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
267 |
OPTION(PHYSFS_BUILD_STATIC "Build static library" FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
268 |
OPTION(PHYSFS_BUILD_SHARED "Build shared library" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
269 |
SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} ${SDL_LIBRARY}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
270 |
ELSE(WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
271 |
OPTION(PHYSFS_BUILD_STATIC "Build static library" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
272 |
OPTION(PHYSFS_BUILD_SHARED "Build shared library" FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
273 |
ENDIF(WINDOWS) |
7768 | 274 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
275 |
IF(PHYSFS_BUILD_STATIC) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
276 |
ADD_LIBRARY(physfs STATIC ${PHYSFS_SRCS}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
277 |
SET_TARGET_PROPERTIES(physfs PROPERTIES OUTPUT_NAME "physfs") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
278 |
SET(PHYSFS_LIB_TARGET physfs) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
279 |
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
280 |
ENDIF(PHYSFS_BUILD_STATIC) |
7768 | 281 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
282 |
IF(PHYSFS_BUILD_SHARED) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
283 |
ADD_LIBRARY(physfs SHARED ${PHYSFS_SRCS}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
284 |
SET_TARGET_PROPERTIES(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
285 |
SET_TARGET_PROPERTIES(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
286 |
TARGET_LINK_LIBRARIES(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
287 |
SET(PHYSFS_LIB_TARGET physfs) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
288 |
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
289 |
INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS} |
8283 | 290 |
RUNTIME DESTINATION ${LIBRARY_OUTPUT_PATH}) |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
291 |
ENDIF(PHYSFS_BUILD_SHARED) |
7768 | 292 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
293 |
IF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
294 |
MESSAGE(FATAL "Both shared and static libraries are disabled!") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
295 |
ENDIF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) |
7768 | 296 |
|
297 |
# CMake FAQ says I need this... |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
298 |
IF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
299 |
SET_TARGET_PROPERTIES(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
300 |
ENDIF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC) |
7768 | 301 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
302 |
OPTION(PHYSFS_BUILD_TEST "Build stdio test program." FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
303 |
MARK_AS_ADVANCED(PHYSFS_BUILD_TEST) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
304 |
IF(PHYSFS_BUILD_TEST) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
305 |
FIND_PATH(READLINE_H readline/readline.h) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
306 |
FIND_PATH(HISTORY_H readline/history.h) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
307 |
IF(READLINE_H AND HISTORY_H) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
308 |
FIND_LIBRARY(CURSES_LIBRARY NAMES curses ncurses) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
309 |
SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
310 |
FIND_LIBRARY(READLINE_LIBRARY readline) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
311 |
IF(READLINE_LIBRARY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
312 |
SET(HAVE_SYSTEM_READLINE TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
313 |
SET(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
314 |
INCLUDE_DIRECTORIES(${READLINE_H} ${HISTORY_H}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
315 |
ADD_DEFINITIONS(-DPHYSFS_HAVE_READLINE=1) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
316 |
ENDIF(READLINE_LIBRARY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
317 |
ENDIF(READLINE_H AND HISTORY_H) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
318 |
ADD_EXECUTABLE(test_physfs test/test_physfs.c) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
319 |
TARGET_LINK_LIBRARIES(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
320 |
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
321 |
ENDIF(PHYSFS_BUILD_TEST) |
7768 | 322 |
|
323 |
||
324 |
# Scripting language bindings... |
|
325 |
||
326 |
#CMake's SWIG support is basically useless. |
|
327 |
#FIND_PACKAGE(SWIG) |
|
328 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
329 |
OPTION(PHYSFS_BUILD_SWIG "Build ${_LANG} bindings." FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
330 |
MARK_AS_ADVANCED(PHYSFS_BUILD_SWIG) |
7768 | 331 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
332 |
FIND_PROGRAM(SWIG swig DOC "Path to swig command line app: http://swig.org/") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
333 |
IF(NOT SWIG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
334 |
MESSAGE(STATUS "SWIG not found. You won't be able to build scripting language bindings.") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
335 |
ELSE(NOT SWIG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
336 |
MARK_AS_ADVANCED(SWIG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
337 |
IF(DEFINED CMAKE_BUILD_TYPE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
338 |
IF((NOT CMAKE_BUILD_TYPE STREQUAL "") AND (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
339 |
IF(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
340 |
SET(SWIG_OPT_CFLAGS "-small") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
341 |
ELSE(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
342 |
SET(SWIG_OPT_CFLAGS "-O") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
343 |
ENDIF(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
344 |
ENDIF((NOT CMAKE_BUILD_TYPE STREQUAL "") AND (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
345 |
ENDIF(DEFINED CMAKE_BUILD_TYPE) |
7768 | 346 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
347 |
SET(SWIG_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/physfs-swig-bindings") |
7768 | 348 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
349 |
MACRO(CONFIGURE_SWIG_BINDING _LANG _INSTALLPATH _EXTRAOUTPUTS _EXTRACFLAGS _EXTRALDFLAGS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
350 |
STRING(TOUPPER "${_LANG}" _UPPERLANG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
351 |
STRING(TOLOWER "${_LANG}" _LOWERLANG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
352 |
SET(_TARGET "physfs-${_LOWERLANG}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
353 |
SET(_TARGETDIR "${SWIG_OUTPUT_DIR}/${_LOWERLANG}") |
7768 | 354 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
355 |
IF(NOT EXISTS "${_TARGETDIR}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
356 |
FILE(MAKE_DIRECTORY "${_TARGETDIR}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
357 |
ENDIF(NOT EXISTS "${_TARGETDIR}") |
7768 | 358 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
359 |
IF(PHYSFS_BUILD_${_UPPERLANG}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
360 |
ADD_CUSTOM_COMMAND( |
7768 | 361 |
OUTPUT "${_TARGETDIR}/${_TARGET}.c" ${_EXTRAOUTPUTS} |
362 |
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/extras/physfs-swig.i" |
|
363 |
COMMAND "${SWIG}" |
|
364 |
ARGS ${SWIG_OPT_CFLAGS} -${_LOWERLANG} -outdir "${_TARGETDIR}" -o "${_TARGETDIR}/${_TARGET}.c" "${CMAKE_CURRENT_SOURCE_DIR}/extras/physfs-swig.i" |
|
365 |
COMMENT "Generating ${_LANG} bindings..." |
|
366 |
) |
|
367 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
368 |
ADD_LIBRARY(${_TARGET} SHARED "${_TARGETDIR}/${_TARGET}.c") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
369 |
TARGET_LINK_LIBRARIES(${_TARGET} ${PHYSFS_LIB_TARGET}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
370 |
SET_TARGET_PROPERTIES(${_TARGET} PROPERTIES |
7768 | 371 |
COMPILE_FLAGS "${_EXTRACFLAGS}" |
372 |
LINK_FLAGS "${_EXTRALDFLAGS}" |
|
373 |
LIBRARY_OUTPUT_NAME "physfs" |
|
374 |
LIBRARY_OUTPUT_DIRECTORY "${_TARGETDIR}" |
|
375 |
CLEAN_DIRECT_OUTPUT 1 |
|
376 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
377 |
INSTALL(TARGETS ${_TARGET} LIBRARY DESTINATION "${_INSTALLPATH}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
378 |
MESSAGE(STATUS "${_LANG} bindings configured!") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
379 |
ELSE(PHYSFS_BUILD_${_UPPERLANG}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
380 |
MESSAGE(STATUS "Couldn't figure out ${_LANG} configuration. Skipping ${_LANG} bindings.") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
381 |
ENDIF(PHYSFS_BUILD_${_UPPERLANG}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
382 |
ENDMACRO(CONFIGURE_SWIG_BINDING) |
7768 | 383 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
384 |
MACRO(ADD_SCRIPT_BINDING_OPTION _VAR _LANG _DEFVAL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
385 |
SET(BUILDSWIGVAL ${_DEFVAL}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
386 |
IF(NOT PHYSFS_BUILD_SWIG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
387 |
SET(BUILDSWIGVAL FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
388 |
ENDIF(NOT PHYSFS_BUILD_SWIG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
389 |
OPTION(${_VAR} "Build ${_LANG} bindings." ${BUILDSWIGVAL}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
390 |
MARK_AS_ADVANCED(${_VAR}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
391 |
ENDMACRO(ADD_SCRIPT_BINDING_OPTION) |
7768 | 392 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
393 |
ADD_SCRIPT_BINDING_OPTION(PHYSFS_BUILD_PERL "Perl" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
394 |
ADD_SCRIPT_BINDING_OPTION(PHYSFS_BUILD_RUBY "Ruby" TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
395 |
ENDIF(NOT SWIG) |
7768 | 396 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
397 |
IF(PHYSFS_BUILD_PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
398 |
MESSAGE(STATUS "Configuring Perl bindings...") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
399 |
FIND_PROGRAM(PERL perl DOC "Path to perl command line app: http://perl.org/") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
400 |
IF(NOT PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
401 |
MESSAGE(STATUS "Perl not found. You won't be able to build perl bindings.") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
402 |
SET(PHYSFS_BUILD_PERL FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
403 |
ENDIF(NOT PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
404 |
MARK_AS_ADVANCED(PERL) |
7768 | 405 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
406 |
MACRO(GET_PERL_CONFIG _KEY _VALUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
407 |
IF(PHYSFS_BUILD_PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
408 |
MESSAGE(STATUS "Figuring out perl config value '${_KEY}' ...") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
409 |
EXECUTE_PROCESS( |
7768 | 410 |
COMMAND ${PERL} -w -e "use Config; print \$Config{${_KEY}};" |
411 |
RESULT_VARIABLE GET_PERL_CONFIG_RC |
|
412 |
OUTPUT_VARIABLE ${_VALUE} |
|
413 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
414 |
IF(NOT GET_PERL_CONFIG_RC EQUAL 0) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
415 |
MESSAGE(STATUS "Perl executable ('${PERL}') reported failure: ${GET_PERL_CONFIG_RC}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
416 |
SET(PHYSFS_BUILD_PERL FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
417 |
ENDIF(NOT GET_PERL_CONFIG_RC EQUAL 0) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
418 |
IF(NOT ${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
419 |
MESSAGE(STATUS "Perl executable ('${PERL}') didn't have a value for '${_KEY}'") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
420 |
SET(PHYSFS_BUILD_PERL FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
421 |
ENDIF(NOT ${_VALUE}) |
7768 | 422 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
423 |
IF(PHYSFS_BUILD_PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
424 |
MESSAGE(STATUS "Perl says: '${${_VALUE}}'.") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
425 |
ENDIF(PHYSFS_BUILD_PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
426 |
ENDIF(PHYSFS_BUILD_PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
427 |
ENDMACRO(GET_PERL_CONFIG) |
7768 | 428 |
|
429 |
# !!! FIXME: installsitearch might be the wrong location. |
|
430 |
GET_PERL_CONFIG("archlibexp" PERL_INCLUDE_PATH) |
|
431 |
GET_PERL_CONFIG("ccflags" PERL_CCFLAGS) |
|
432 |
GET_PERL_CONFIG("ldflags" PERL_LDFLAGS) |
|
433 |
GET_PERL_CONFIG("installsitearch" PERL_INSTALL_PATH) |
|
434 |
||
435 |
# !!! FIXME: this test for Mac OS X is wrong. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
436 |
IF(MACOSX) |
7768 | 437 |
GET_PERL_CONFIG("libperl" PERL_LIBPERL) |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
438 |
SET(TMPLIBPERL "${PERL_LIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
439 |
STRING(REGEX REPLACE "^lib" "" TMPLIBPERL "${TMPLIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
440 |
STRING(REGEX REPLACE "\\.so$" "" TMPLIBPERL "${TMPLIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
441 |
STRING(REGEX REPLACE "\\.dylib$" "" TMPLIBPERL "${TMPLIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
442 |
STRING(REGEX REPLACE "\\.dll$" "" TMPLIBPERL "${TMPLIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
443 |
IF(NOT "${TMPLIBPERL}" STREQUAL "${PERL_LIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
444 |
MESSAGE(STATUS "Stripped '${PERL_LIBPERL}' down to '${TMPLIBPERL}'.") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
445 |
SET(PERL_LIBPERL "${TMPLIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
446 |
ENDIF(NOT "${TMPLIBPERL}" STREQUAL "${PERL_LIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
447 |
SET(PERL_LIBPERL "-l${PERL_LIBPERL}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
448 |
ENDIF(MACOSX) |
7768 | 449 |
|
450 |
CONFIGURE_SWIG_BINDING(Perl "${PERL_INSTALL_PATH}" "${SWIG_OUTPUT_DIR}/perl/physfs.pm" "\"-I${PERL_INCLUDE_PATH}/CORE\" ${PERL_CCFLAGS} -w" "\"-L${PERL_INCLUDE_PATH}/CORE\" ${PERL_LIBPERL} ${PERL_LDFLAGS}") |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
451 |
INSTALL(FILES "${SWIG_OUTPUT_DIR}/perl/physfs.pm" DESTINATION "${PERL_INSTALL_PATH}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
452 |
INSTALL( |
7768 | 453 |
FILES test/test_physfs.pl |
454 |
DESTINATION bin |
|
455 |
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE |
|
456 |
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
|
457 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
458 |
ENDIF(PHYSFS_BUILD_PERL) |
7768 | 459 |
|
460 |
# !!! FIXME: lots of cut-and-paste from perl bindings. |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
461 |
IF(PHYSFS_BUILD_RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
462 |
MESSAGE(STATUS "Configuring Ruby bindings...") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
463 |
FIND_PROGRAM(RUBY ruby DOC "Path to ruby command line app: http://ruby-lang.org/") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
464 |
IF(NOT RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
465 |
MESSAGE(STATUS "Ruby not found. You won't be able to build ruby bindings.") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
466 |
SET(PHYSFS_BUILD_RUBY FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
467 |
ENDIF(NOT RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
468 |
MARK_AS_ADVANCED(RUBY) |
7768 | 469 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
470 |
MACRO(GET_RUBY_CONFIG _KEY _VALUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
471 |
IF(PHYSFS_BUILD_RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
472 |
MESSAGE(STATUS "Figuring out ruby config value '${_KEY}' ...") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
473 |
EXECUTE_PROCESS( |
7768 | 474 |
COMMAND ${RUBY} -e "require 'rbconfig'; puts RbConfig::CONFIG['${_KEY}'];" |
475 |
RESULT_VARIABLE GET_RUBY_CONFIG_RC |
|
476 |
OUTPUT_VARIABLE ${_VALUE} |
|
477 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
478 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
479 |
IF(NOT GET_RUBY_CONFIG_RC EQUAL 0) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
480 |
MESSAGE(STATUS "Ruby executable ('${RUBY}') reported failure: ${GET_RUBY_CONFIG_RC}") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
481 |
SET(PHYSFS_BUILD_RUBY FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
482 |
ENDIF(NOT GET_RUBY_CONFIG_RC EQUAL 0) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
483 |
IF(NOT ${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
484 |
MESSAGE(STATUS "Ruby executable ('${RUBY}') didn't have a value for '${_KEY}'") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
485 |
SET(PHYSFS_BUILD_RUBY FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
486 |
ENDIF(NOT ${_VALUE}) |
7768 | 487 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
488 |
IF(PHYSFS_BUILD_RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
489 |
MESSAGE(STATUS "Ruby says: '${${_VALUE}}'.") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
490 |
ENDIF(PHYSFS_BUILD_RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
491 |
ENDIF(PHYSFS_BUILD_RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
492 |
ENDMACRO(GET_RUBY_CONFIG) |
7768 | 493 |
|
494 |
GET_RUBY_CONFIG("archdir" RUBY_INCLUDE_PATH) |
|
495 |
GET_RUBY_CONFIG("CFLAGS" RUBY_CCFLAGS) |
|
496 |
GET_RUBY_CONFIG("LDFLAGS" RUBY_LDFLAGS) |
|
497 |
GET_RUBY_CONFIG("sitearchdir" RUBY_INSTALL_PATH) |
|
498 |
GET_RUBY_CONFIG("LIBRUBYARG_SHARED" RUBY_LIBRUBY) |
|
499 |
GET_RUBY_CONFIG("libdir" RUBY_LIBDIR) |
|
500 |
||
501 |
CONFIGURE_SWIG_BINDING(Ruby "${RUBY_INSTALL_PATH}" "" "\"-I${RUBY_INCLUDE_PATH}\" ${RUBY_CCFLAGS} -w" "\"-L${RUBY_LIBDIR}\" ${RUBY_LIBRUBY} ${RUBY_LDFLAGS}") |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
502 |
SET_TARGET_PROPERTIES(physfs-ruby PROPERTIES PREFIX "") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
503 |
INSTALL( |
7768 | 504 |
FILES test/test_physfs.rb |
505 |
DESTINATION bin |
|
506 |
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE |
|
507 |
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
|
508 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
509 |
ENDIF(PHYSFS_BUILD_RUBY) |
7768 | 510 |
|
511 |
||
8084 | 512 |
#INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS} |
513 |
# RUNTIME DESTINATION bin |
|
514 |
# LIBRARY DESTINATION lib${LIB_SUFFIX} |
|
515 |
# ARCHIVE DESTINATION lib${LIB_SUFFIX}) |
|
516 |
#INSTALL(FILES src/physfs.h DESTINATION include) |
|
7768 | 517 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
518 |
IF(UNIX) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
519 |
SET(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.gz") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
520 |
ADD_CUSTOM_TARGET( |
7768 | 521 |
dist |
522 |
hg archive -t tgz "${PHYSFS_TARBALL}" |
|
523 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
|
524 |
COMMENT "Building source tarball '${PHYSFS_TARBALL}'..." |
|
525 |
) |
|
7778 | 526 |
# ADD_CUSTOM_TARGET( |
527 |
# uninstall |
|
528 |
# "${CMAKE_CURRENT_SOURCE_DIR}/extras/uninstall.sh" |
|
529 |
# WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" |
|
530 |
# COMMENT "Uninstall the project..." |
|
531 |
# ) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
532 |
ENDIF(UNIX) |
7768 | 533 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
534 |
MACRO(MESSAGE_BOOL_OPTION _NAME _VALUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
535 |
IF(${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
536 |
MESSAGE(STATUS " ${_NAME}: enabled") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
537 |
ELSE(${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
538 |
MESSAGE(STATUS " ${_NAME}: disabled") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
539 |
ENDIF(${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
540 |
ENDMACRO(MESSAGE_BOOL_OPTION) |
7768 | 541 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
542 |
MESSAGE(STATUS "PhysicsFS will build with the following options:") |
7768 | 543 |
MESSAGE_BOOL_OPTION("ZIP support" PHYSFS_ARCHIVE_ZIP) |
544 |
MESSAGE_BOOL_OPTION("7zip support" PHYSFS_ARCHIVE_7Z) |
|
545 |
MESSAGE_BOOL_OPTION("GRP support" PHYSFS_ARCHIVE_GRP) |
|
546 |
MESSAGE_BOOL_OPTION("WAD support" PHYSFS_ARCHIVE_WAD) |
|
547 |
MESSAGE_BOOL_OPTION("HOG support" PHYSFS_ARCHIVE_HOG) |
|
548 |
MESSAGE_BOOL_OPTION("MVL support" PHYSFS_ARCHIVE_MVL) |
|
549 |
MESSAGE_BOOL_OPTION("QPAK support" PHYSFS_ARCHIVE_QPAK) |
|
550 |
MESSAGE_BOOL_OPTION("CD-ROM drive support" PHYSFS_HAVE_CDROM_SUPPORT) |
|
551 |
MESSAGE_BOOL_OPTION("Thread safety" PHYSFS_HAVE_THREAD_SUPPORT) |
|
552 |
MESSAGE_BOOL_OPTION("Build static library" PHYSFS_BUILD_STATIC) |
|
553 |
MESSAGE_BOOL_OPTION("Build shared library" PHYSFS_BUILD_SHARED) |
|
554 |
MESSAGE_BOOL_OPTION("Build Perl bindings" PHYSFS_BUILD_PERL) |
|
555 |
MESSAGE_BOOL_OPTION("Build Ruby bindings" PHYSFS_BUILD_RUBY) |
|
556 |
MESSAGE_BOOL_OPTION("Build stdio test program" PHYSFS_BUILD_TEST) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
557 |
IF(PHYSFS_BUILD_TEST) |
7768 | 558 |
MESSAGE_BOOL_OPTION(" Use readline in test program" HAVE_SYSTEM_READLINE) |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
559 |
ENDIF(PHYSFS_BUILD_TEST) |
7768 | 560 |
|
561 |
# end of CMakeLists.txt ... |
|
562 |