author | unc0rr |
Mon, 10 Dec 2012 11:45:21 +0400 | |
changeset 8286 | 2e7eedac380d |
parent 8283 | af97cdbb7713 |
child 8288 | fd6743995dfc |
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 |
if(WINDOWS) |
20 |
find_package(SDL REQUIRED) |
|
21 |
endif(WINDOWS) |
|
22 |
||
7768 | 23 |
# 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
|
24 |
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
|
25 |
SET(MACOSX TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
26 |
ENDIF(APPLE AND NOT MACOSX) |
7768 | 27 |
|
28 |
# 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
|
29 |
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
|
30 |
SET(BEOS TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
31 |
ENDIF(HAIKU AND NOT BEOS) |
7768 | 32 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
33 |
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
|
34 |
SET(SOLARIS TRUE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
35 |
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") |
7768 | 36 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
37 |
INCLUDE(CheckIncludeFile) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
38 |
INCLUDE(CheckLibraryExists) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
39 |
INCLUDE(CheckCSourceCompiles) |
7768 | 40 |
|
8073 | 41 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) |
42 |
include_directories(${SDL_INCLUDE_DIR}) #hw |
|
43 |
include_directories(${LUA_INCLUDE_DIR}) #hw |
|
7768 | 44 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
45 |
IF(MACOSX) |
7768 | 46 |
# 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
|
47 |
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
|
48 |
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
|
49 |
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
|
50 |
ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES ppc) |
7768 | 51 |
|
52 |
# 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
|
53 |
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
|
54 |
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
|
55 |
ENDIF(MACOSX) |
7768 | 56 |
|
57 |
# 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
|
58 |
IF(CMAKE_COMPILER_IS_GNUCC) |
7768 | 59 |
# 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
|
60 |
ADD_DEFINITIONS(-g -pipe -Werror -fsigned-char) |
7768 | 61 |
|
62 |
# 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
|
63 |
IF(NOT BEOS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
64 |
ADD_DEFINITIONS(-Wall) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
65 |
ENDIF(NOT BEOS) |
7768 | 66 |
|
67 |
CHECK_C_SOURCE_COMPILES(" |
|
68 |
#if ((defined(__GNUC__)) && (__GNUC__ >= 4)) |
|
69 |
int main(int argc, char **argv) { int is_gcc4 = 1; return 0; } |
|
70 |
#else |
|
71 |
#error This is not gcc4. |
|
72 |
#endif |
|
73 |
" PHYSFS_IS_GCC4) |
|
74 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
75 |
IF(PHYSFS_IS_GCC4) |
7768 | 76 |
# 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
|
77 |
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
|
78 |
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
|
79 |
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
|
80 |
ENDIF(PHYSFS_IS_GCC4) |
7768 | 81 |
|
82 |
# 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
|
83 |
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
|
84 |
ENDIF(CMAKE_COMPILER_IS_GNUCC) |
7768 | 85 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
86 |
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
|
87 |
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
|
88 |
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
|
89 |
ENDIF(CMAKE_C_COMPILER_ID STREQUAL "SunPro") |
7768 | 90 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
91 |
IF(MSVC) |
7768 | 92 |
# VS.NET 8.0 got really really anal about strcpy, etc, which even if we |
93 |
# 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
|
94 |
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
|
95 |
ENDIF(MSVC) |
7768 | 96 |
|
97 |
# Basic chunks of source code ... |
|
98 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
99 |
SET(LZMA_SRCS |
7768 | 100 |
src/lzma/C/7zCrc.c |
101 |
src/lzma/C/Archive/7z/7zBuffer.c |
|
102 |
src/lzma/C/Archive/7z/7zDecode.c |
|
103 |
src/lzma/C/Archive/7z/7zExtract.c |
|
104 |
src/lzma/C/Archive/7z/7zHeader.c |
|
105 |
src/lzma/C/Archive/7z/7zIn.c |
|
106 |
src/lzma/C/Archive/7z/7zItem.c |
|
107 |
src/lzma/C/Archive/7z/7zMethodID.c |
|
108 |
src/lzma/C/Compress/Branch/BranchX86.c |
|
109 |
src/lzma/C/Compress/Branch/BranchX86_2.c |
|
110 |
src/lzma/C/Compress/Lzma/LzmaDecode.c |
|
111 |
) |
|
112 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
113 |
IF(BEOS) |
7768 | 114 |
# We add this explicitly, since we don't want CMake to think this |
115 |
# 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
|
116 |
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
|
117 |
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
|
118 |
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
|
119 |
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
|
120 |
ENDIF(BEOS) |
7768 | 121 |
|
122 |
# Almost everything is "compiled" here, but things that don't apply to the |
|
123 |
# build are #ifdef'd out. This is to make it easy to embed PhysicsFS into |
|
124 |
# another project or bring up a new build system: just compile all the source |
|
125 |
# 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
|
126 |
SET(PHYSFS_SRCS |
7768 | 127 |
src/physfs.c |
128 |
src/physfs_byteorder.c |
|
129 |
src/physfs_unicode.c |
|
130 |
src/platform_posix.c |
|
131 |
src/platform_unix.c |
|
132 |
src/platform_macosx.c |
|
133 |
src/platform_windows.c |
|
134 |
src/archiver_dir.c |
|
135 |
src/archiver_unpacked.c |
|
136 |
src/archiver_grp.c |
|
137 |
src/archiver_hog.c |
|
138 |
src/archiver_lzma.c |
|
139 |
src/archiver_mvl.c |
|
140 |
src/archiver_qpak.c |
|
141 |
src/archiver_wad.c |
|
142 |
src/archiver_zip.c |
|
143 |
src/archiver_iso9660.c |
|
8073 | 144 |
#custom files from Hedgewars |
145 |
extras/physfsrwops.c |
|
146 |
extras/physfslualoader.c |
|
147 |
extras/hwpacksmounter.c |
|
7768 | 148 |
${PHYSFS_BEOS_SRCS} |
149 |
) |
|
150 |
||
151 |
||
152 |
# platform layers ... |
|
153 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
154 |
IF(UNIX) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
155 |
IF(BEOS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
156 |
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
|
157 |
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
|
158 |
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
|
159 |
ELSE(BEOS) |
7768 | 160 |
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
|
161 |
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
|
162 |
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
|
163 |
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
|
164 |
ENDIF(HAVE_UCRED_H) |
7768 | 165 |
|
166 |
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
|
167 |
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
|
168 |
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
|
169 |
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
|
170 |
ENDIF(HAVE_MNTENT_H) |
7768 | 171 |
|
172 |
# !!! FIXME: Solaris fails this, because mnttab.h implicitly |
|
173 |
# !!! FIXME: depends on other system headers. :( |
|
174 |
#CHECK_INCLUDE_FILE(sys/mnttab.h HAVE_SYS_MNTTAB_H) |
|
175 |
CHECK_C_SOURCE_COMPILES(" |
|
176 |
#include <stdio.h> |
|
177 |
#include <sys/mnttab.h> |
|
178 |
int main(int argc, char **argv) { return 0; } |
|
179 |
" HAVE_SYS_MNTTAB_H) |
|
180 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
181 |
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
|
182 |
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
|
183 |
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
|
184 |
ENDIF(HAVE_SYS_MNTTAB_H) |
7768 | 185 |
|
186 |
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
|
187 |
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
|
188 |
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
|
189 |
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
|
190 |
ENDIF(BEOS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
191 |
ENDIF(UNIX) |
7768 | 192 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
193 |
IF(WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
194 |
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
|
195 |
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
|
196 |
ENDIF(WINDOWS) |
7768 | 197 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
198 |
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
|
199 |
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
|
200 |
MESSAGE(WARNING " ***") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
201 |
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
|
202 |
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
|
203 |
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
|
204 |
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
|
205 |
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
|
206 |
MESSAGE(WARNING " ***") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
207 |
ENDIF(NOT PHYSFS_HAVE_CDROM_SUPPORT) |
7768 | 208 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
209 |
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
|
210 |
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
|
211 |
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
|
212 |
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
|
213 |
MESSAGE(WARNING " ***") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
214 |
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
|
215 |
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
|
216 |
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
|
217 |
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
|
218 |
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
|
219 |
MESSAGE(WARNING " ***") |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
220 |
ENDIF(PHYSFS_HAVE_THREAD_SUPPORT) |
7768 | 221 |
|
222 |
||
223 |
# Archivers ... |
|
224 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
225 |
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
|
226 |
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
|
227 |
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
|
228 |
ENDIF(PHYSFS_ARCHIVE_ZIP) |
7768 | 229 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
230 |
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
|
231 |
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
|
232 |
ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_7Z=1) |
7768 | 233 |
# !!! 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
|
234 |
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
|
235 |
ENDIF(PHYSFS_ARCHIVE_7Z) |
7768 | 236 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
237 |
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
|
238 |
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
|
239 |
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
|
240 |
ENDIF(PHYSFS_ARCHIVE_GRP) |
7768 | 241 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
242 |
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
|
243 |
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
|
244 |
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
|
245 |
ENDIF(PHYSFS_ARCHIVE_WAD) |
7768 | 246 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
247 |
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
|
248 |
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
|
249 |
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
|
250 |
ENDIF(PHYSFS_ARCHIVE_HOG) |
7768 | 251 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
252 |
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
|
253 |
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
|
254 |
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
|
255 |
ENDIF(PHYSFS_ARCHIVE_MVL) |
7768 | 256 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
257 |
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
|
258 |
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
|
259 |
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
|
260 |
ENDIF(PHYSFS_ARCHIVE_QPAK) |
7768 | 261 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
262 |
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
|
263 |
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
|
264 |
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
|
265 |
ENDIF(PHYSFS_ARCHIVE_ISO9660) |
7768 | 266 |
|
8087
ccc99eebdac2
little cmake cleanup, search installed modules first, then our own
koda
parents:
8084
diff
changeset
|
267 |
#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
|
268 |
IF(WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
269 |
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
|
270 |
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
|
271 |
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
|
272 |
ELSE(WINDOWS) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
273 |
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
|
274 |
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
|
275 |
ENDIF(WINDOWS) |
7768 | 276 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
277 |
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
|
278 |
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
|
279 |
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
|
280 |
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
|
281 |
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
|
282 |
ENDIF(PHYSFS_BUILD_STATIC) |
7768 | 283 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
284 |
IF(PHYSFS_BUILD_SHARED) |
8073 | 285 |
find_package(SDL REQUIRED) |
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
286 |
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
|
287 |
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
|
288 |
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
|
289 |
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
|
290 |
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
|
291 |
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
|
292 |
INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS} |
8283 | 293 |
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
|
294 |
ENDIF(PHYSFS_BUILD_SHARED) |
7768 | 295 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
296 |
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
|
297 |
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
|
298 |
ENDIF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) |
7768 | 299 |
|
300 |
# 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
|
301 |
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
|
302 |
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
|
303 |
ENDIF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC) |
7768 | 304 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
305 |
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
|
306 |
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
|
307 |
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
|
308 |
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
|
309 |
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
|
310 |
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
|
311 |
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
|
312 |
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
|
313 |
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
|
314 |
IF(READLINE_LIBRARY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
315 |
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
|
316 |
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
|
317 |
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
|
318 |
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
|
319 |
ENDIF(READLINE_LIBRARY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
320 |
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
|
321 |
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
|
322 |
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
|
323 |
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
|
324 |
ENDIF(PHYSFS_BUILD_TEST) |
7768 | 325 |
|
326 |
||
327 |
# Scripting language bindings... |
|
328 |
||
329 |
#CMake's SWIG support is basically useless. |
|
330 |
#FIND_PACKAGE(SWIG) |
|
331 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
332 |
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
|
333 |
MARK_AS_ADVANCED(PHYSFS_BUILD_SWIG) |
7768 | 334 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
335 |
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
|
336 |
IF(NOT SWIG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
337 |
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
|
338 |
ELSE(NOT SWIG) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
339 |
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
|
340 |
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
|
341 |
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
|
342 |
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
|
343 |
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
|
344 |
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
|
345 |
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
|
346 |
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
|
347 |
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
|
348 |
ENDIF(DEFINED CMAKE_BUILD_TYPE) |
7768 | 349 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
350 |
SET(SWIG_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/physfs-swig-bindings") |
7768 | 351 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
352 |
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
|
353 |
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
|
354 |
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
|
355 |
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
|
356 |
SET(_TARGETDIR "${SWIG_OUTPUT_DIR}/${_LOWERLANG}") |
7768 | 357 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
358 |
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
|
359 |
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
|
360 |
ENDIF(NOT EXISTS "${_TARGETDIR}") |
7768 | 361 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
362 |
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
|
363 |
ADD_CUSTOM_COMMAND( |
7768 | 364 |
OUTPUT "${_TARGETDIR}/${_TARGET}.c" ${_EXTRAOUTPUTS} |
365 |
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/extras/physfs-swig.i" |
|
366 |
COMMAND "${SWIG}" |
|
367 |
ARGS ${SWIG_OPT_CFLAGS} -${_LOWERLANG} -outdir "${_TARGETDIR}" -o "${_TARGETDIR}/${_TARGET}.c" "${CMAKE_CURRENT_SOURCE_DIR}/extras/physfs-swig.i" |
|
368 |
COMMENT "Generating ${_LANG} bindings..." |
|
369 |
) |
|
370 |
||
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
371 |
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
|
372 |
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
|
373 |
SET_TARGET_PROPERTIES(${_TARGET} PROPERTIES |
7768 | 374 |
COMPILE_FLAGS "${_EXTRACFLAGS}" |
375 |
LINK_FLAGS "${_EXTRALDFLAGS}" |
|
376 |
LIBRARY_OUTPUT_NAME "physfs" |
|
377 |
LIBRARY_OUTPUT_DIRECTORY "${_TARGETDIR}" |
|
378 |
CLEAN_DIRECT_OUTPUT 1 |
|
379 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
380 |
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
|
381 |
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
|
382 |
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
|
383 |
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
|
384 |
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
|
385 |
ENDMACRO(CONFIGURE_SWIG_BINDING) |
7768 | 386 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
387 |
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
|
388 |
SET(BUILDSWIGVAL ${_DEFVAL}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
389 |
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
|
390 |
SET(BUILDSWIGVAL FALSE) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
391 |
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
|
392 |
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
|
393 |
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
|
394 |
ENDMACRO(ADD_SCRIPT_BINDING_OPTION) |
7768 | 395 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
396 |
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
|
397 |
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
|
398 |
ENDIF(NOT SWIG) |
7768 | 399 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
400 |
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
|
401 |
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
|
402 |
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
|
403 |
IF(NOT PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
404 |
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
|
405 |
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
|
406 |
ENDIF(NOT PERL) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
407 |
MARK_AS_ADVANCED(PERL) |
7768 | 408 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
409 |
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
|
410 |
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
|
411 |
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
|
412 |
EXECUTE_PROCESS( |
7768 | 413 |
COMMAND ${PERL} -w -e "use Config; print \$Config{${_KEY}};" |
414 |
RESULT_VARIABLE GET_PERL_CONFIG_RC |
|
415 |
OUTPUT_VARIABLE ${_VALUE} |
|
416 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
417 |
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
|
418 |
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
|
419 |
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
|
420 |
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
|
421 |
IF(NOT ${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
422 |
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
|
423 |
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
|
424 |
ENDIF(NOT ${_VALUE}) |
7768 | 425 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
426 |
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
|
427 |
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
|
428 |
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
|
429 |
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
|
430 |
ENDMACRO(GET_PERL_CONFIG) |
7768 | 431 |
|
432 |
# !!! FIXME: installsitearch might be the wrong location. |
|
433 |
GET_PERL_CONFIG("archlibexp" PERL_INCLUDE_PATH) |
|
434 |
GET_PERL_CONFIG("ccflags" PERL_CCFLAGS) |
|
435 |
GET_PERL_CONFIG("ldflags" PERL_LDFLAGS) |
|
436 |
GET_PERL_CONFIG("installsitearch" PERL_INSTALL_PATH) |
|
437 |
||
438 |
# !!! 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
|
439 |
IF(MACOSX) |
7768 | 440 |
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
|
441 |
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
|
442 |
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
|
443 |
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
|
444 |
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
|
445 |
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
|
446 |
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
|
447 |
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
|
448 |
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
|
449 |
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
|
450 |
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
|
451 |
ENDIF(MACOSX) |
7768 | 452 |
|
453 |
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
|
454 |
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
|
455 |
INSTALL( |
7768 | 456 |
FILES test/test_physfs.pl |
457 |
DESTINATION bin |
|
458 |
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE |
|
459 |
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
|
460 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
461 |
ENDIF(PHYSFS_BUILD_PERL) |
7768 | 462 |
|
463 |
# !!! 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
|
464 |
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
|
465 |
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
|
466 |
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
|
467 |
IF(NOT RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
468 |
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
|
469 |
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
|
470 |
ENDIF(NOT RUBY) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
471 |
MARK_AS_ADVANCED(RUBY) |
7768 | 472 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
473 |
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
|
474 |
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
|
475 |
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
|
476 |
EXECUTE_PROCESS( |
7768 | 477 |
COMMAND ${RUBY} -e "require 'rbconfig'; puts RbConfig::CONFIG['${_KEY}'];" |
478 |
RESULT_VARIABLE GET_RUBY_CONFIG_RC |
|
479 |
OUTPUT_VARIABLE ${_VALUE} |
|
480 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
481 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
482 |
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
|
483 |
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
|
484 |
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
|
485 |
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
|
486 |
IF(NOT ${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
487 |
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
|
488 |
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
|
489 |
ENDIF(NOT ${_VALUE}) |
7768 | 490 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
491 |
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
|
492 |
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
|
493 |
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
|
494 |
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
|
495 |
ENDMACRO(GET_RUBY_CONFIG) |
7768 | 496 |
|
497 |
GET_RUBY_CONFIG("archdir" RUBY_INCLUDE_PATH) |
|
498 |
GET_RUBY_CONFIG("CFLAGS" RUBY_CCFLAGS) |
|
499 |
GET_RUBY_CONFIG("LDFLAGS" RUBY_LDFLAGS) |
|
500 |
GET_RUBY_CONFIG("sitearchdir" RUBY_INSTALL_PATH) |
|
501 |
GET_RUBY_CONFIG("LIBRUBYARG_SHARED" RUBY_LIBRUBY) |
|
502 |
GET_RUBY_CONFIG("libdir" RUBY_LIBDIR) |
|
503 |
||
504 |
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
|
505 |
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
|
506 |
INSTALL( |
7768 | 507 |
FILES test/test_physfs.rb |
508 |
DESTINATION bin |
|
509 |
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE |
|
510 |
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
|
511 |
) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
512 |
ENDIF(PHYSFS_BUILD_RUBY) |
7768 | 513 |
|
514 |
||
8084 | 515 |
#INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS} |
516 |
# RUNTIME DESTINATION bin |
|
517 |
# LIBRARY DESTINATION lib${LIB_SUFFIX} |
|
518 |
# ARCHIVE DESTINATION lib${LIB_SUFFIX}) |
|
519 |
#INSTALL(FILES src/physfs.h DESTINATION include) |
|
7768 | 520 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
521 |
IF(UNIX) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
522 |
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
|
523 |
ADD_CUSTOM_TARGET( |
7768 | 524 |
dist |
525 |
hg archive -t tgz "${PHYSFS_TARBALL}" |
|
526 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
|
527 |
COMMENT "Building source tarball '${PHYSFS_TARBALL}'..." |
|
528 |
) |
|
7778 | 529 |
# ADD_CUSTOM_TARGET( |
530 |
# uninstall |
|
531 |
# "${CMAKE_CURRENT_SOURCE_DIR}/extras/uninstall.sh" |
|
532 |
# WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" |
|
533 |
# COMMENT "Uninstall the project..." |
|
534 |
# ) |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
535 |
ENDIF(UNIX) |
7768 | 536 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
537 |
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
|
538 |
IF(${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
539 |
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
|
540 |
ELSE(${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
541 |
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
|
542 |
ENDIF(${_VALUE}) |
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
543 |
ENDMACRO(MESSAGE_BOOL_OPTION) |
7768 | 544 |
|
8281
a1577759bf62
partially revert r1fba650c2aa4 on misc/physfs/CMakeLists.txt which randomly set true and false variables
koda
parents:
8146
diff
changeset
|
545 |
MESSAGE(STATUS "PhysicsFS will build with the following options:") |
7768 | 546 |
MESSAGE_BOOL_OPTION("ZIP support" PHYSFS_ARCHIVE_ZIP) |
547 |
MESSAGE_BOOL_OPTION("7zip support" PHYSFS_ARCHIVE_7Z) |
|
548 |
MESSAGE_BOOL_OPTION("GRP support" PHYSFS_ARCHIVE_GRP) |
|
549 |
MESSAGE_BOOL_OPTION("WAD support" PHYSFS_ARCHIVE_WAD) |
|
550 |
MESSAGE_BOOL_OPTION("HOG support" PHYSFS_ARCHIVE_HOG) |
|
551 |
MESSAGE_BOOL_OPTION("MVL support" PHYSFS_ARCHIVE_MVL) |
|
552 |
MESSAGE_BOOL_OPTION("QPAK support" PHYSFS_ARCHIVE_QPAK) |
|
553 |
MESSAGE_BOOL_OPTION("CD-ROM drive support" PHYSFS_HAVE_CDROM_SUPPORT) |
|
554 |
MESSAGE_BOOL_OPTION("Thread safety" PHYSFS_HAVE_THREAD_SUPPORT) |
|
555 |
MESSAGE_BOOL_OPTION("Build static library" PHYSFS_BUILD_STATIC) |
|
556 |
MESSAGE_BOOL_OPTION("Build shared library" PHYSFS_BUILD_SHARED) |
|
557 |
MESSAGE_BOOL_OPTION("Build Perl bindings" PHYSFS_BUILD_PERL) |
|
558 |
MESSAGE_BOOL_OPTION("Build Ruby bindings" PHYSFS_BUILD_RUBY) |
|
559 |
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
|
560 |
IF(PHYSFS_BUILD_TEST) |
7768 | 561 |
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
|
562 |
ENDIF(PHYSFS_BUILD_TEST) |
7768 | 563 |
|
564 |
# end of CMakeLists.txt ... |
|
565 |