equal
deleted
inserted
replaced
1 # PhysicsFS; a portable, flexible file i/o abstraction. |
1 # PhysicsFS; a portable, flexible file i/o abstraction. |
2 # Copyright (C) 2007 Ryan C. Gordon. |
2 # Copyright (C) 2007 Ryan C. Gordon. |
3 # |
3 # |
4 # Please see the file LICENSE.txt in the source's root directory. |
4 # Please see the file LICENSE.txt in the source's root directory. |
5 |
5 |
6 CMAKE_MINIMUM_REQUIRED(VERSION 2.4) |
6 #lines overridden by Hedgewars configuration |
7 |
7 #CMAKE_MINIMUM_REQUIRED(VERSION 2.4) |
8 if(COMMAND cmake_policy) |
8 #PROJECT(PhysicsFS) |
9 cmake_policy(SET CMP0003 NEW) |
|
10 endif(COMMAND cmake_policy) |
|
11 |
|
12 PROJECT(PhysicsFS) |
|
13 SET(PHYSFS_VERSION 2.1.0) |
9 SET(PHYSFS_VERSION 2.1.0) |
14 |
10 |
15 # Increment this if/when we break backwards compatibility. |
11 # Increment this if/when we break backwards compatibility. |
16 SET(PHYSFS_SOVERSION 1) |
12 SET(PHYSFS_SOVERSION 1) |
17 |
13 |
262 OPTION(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE) |
258 OPTION(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE) |
263 IF(PHYSFS_ARCHIVE_ISO9660) |
259 IF(PHYSFS_ARCHIVE_ISO9660) |
264 ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_ISO9660=1) |
260 ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_ISO9660=1) |
265 ENDIF(PHYSFS_ARCHIVE_ISO9660) |
261 ENDIF(PHYSFS_ARCHIVE_ISO9660) |
266 |
262 |
|
263 #as needed by Hedgewars configuration |
267 IF(WINDOWS) |
264 IF(WINDOWS) |
268 OPTION(PHYSFS_BUILD_STATIC "Build static library" FALSE) |
265 OPTION(PHYSFS_BUILD_STATIC "Build static library" FALSE) |
269 OPTION(PHYSFS_BUILD_SHARED "Build shared library" TRUE) |
266 OPTION(PHYSFS_BUILD_SHARED "Build shared library" TRUE) |
|
267 SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} ${SDL_LIBRARY}) |
270 ELSE(WINDOWS) |
268 ELSE(WINDOWS) |
271 OPTION(PHYSFS_BUILD_STATIC "Build static library" TRUE) |
269 OPTION(PHYSFS_BUILD_STATIC "Build static library" TRUE) |
272 OPTION(PHYSFS_BUILD_SHARED "Build shared library" FALSE) |
270 OPTION(PHYSFS_BUILD_SHARED "Build shared library" FALSE) |
273 ENDIF(WINDOWS) |
271 ENDIF(WINDOWS) |
274 |
272 |
282 IF(PHYSFS_BUILD_SHARED) |
280 IF(PHYSFS_BUILD_SHARED) |
283 find_package(SDL REQUIRED) |
281 find_package(SDL REQUIRED) |
284 ADD_LIBRARY(physfs SHARED ${PHYSFS_SRCS}) |
282 ADD_LIBRARY(physfs SHARED ${PHYSFS_SRCS}) |
285 SET_TARGET_PROPERTIES(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) |
283 SET_TARGET_PROPERTIES(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) |
286 SET_TARGET_PROPERTIES(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) |
284 SET_TARGET_PROPERTIES(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) |
287 TARGET_LINK_LIBRARIES(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS} ${SDL_LIBRARY}) |
285 TARGET_LINK_LIBRARIES(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS}) |
288 SET(PHYSFS_LIB_TARGET physfs) |
286 SET(PHYSFS_LIB_TARGET physfs) |
289 SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs") |
287 SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs") |
290 ENDIF(PHYSFS_BUILD_SHARED) |
288 ENDIF(PHYSFS_BUILD_SHARED) |
291 |
289 |
292 IF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) |
290 IF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) |