Skip to content
Permalink
Browse files
Merged changeset 1005:cafe3867784c from default branch: cross-compile…
… fixes.
  • Loading branch information
icculus committed Jul 8, 2009
1 parent d9f0a87 commit 98790d824f09956217513a0edd365883d12e8638
Showing with 16 additions and 20 deletions.
  1. +16 −20 CMakeLists.txt
@@ -244,26 +244,21 @@ ENDIF(PHYSFS_ARCHIVE_QPAK)
# See if some archiver required zlib, and see about using system version.

IF(PHYSFS_NEED_ZLIB)
CHECK_INCLUDE_FILE(zlib.h HAVE_ZLIB_H)
IF(HAVE_ZLIB_H)
CHECK_LIBRARY_EXISTS("z" "inflate" "" HAVE_LIBZ)
IF(HAVE_LIBZ)
SET(HAVE_SYSTEM_ZLIB TRUE)
ENDIF(HAVE_LIBZ)
ENDIF(HAVE_ZLIB_H)

IF(HAVE_SYSTEM_ZLIB)
FIND_PACKAGE(ZLIB)

IF(ZLIB_FOUND)
OPTION(PHYSFS_INTERNAL_ZLIB "Link own zlib instead of system library" FALSE)
ELSE(HAVE_SYSTEM_ZLIB)
SET(PHYSFS_INTERNAL_ZLIB TRUE)
ENDIF(HAVE_SYSTEM_ZLIB)
ENDIF(ZLIB_FOUND)

IF(PHYSFS_INTERNAL_ZLIB)
INCLUDE_DIRECTORIES(zlib123)
ADD_DEFINITIONS(-DZ_PREFIX=1)
SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${ZLIB_SRCS})
ELSE(PHYSFS_INTERNAL_ZLIB)
SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} z)
SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${ZLIB_LIBRARY})
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
ENDIF(PHYSFS_INTERNAL_ZLIB)
ENDIF(PHYSFS_NEED_ZLIB)

@@ -298,18 +293,19 @@ ENDIF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC)
OPTION(PHYSFS_BUILD_TEST "Build stdio test program." TRUE)
MARK_AS_ADVANCED(PHYSFS_BUILD_TEST)
IF(PHYSFS_BUILD_TEST)
CHECK_INCLUDE_FILE(readline/readline.h HAVE_READLINE_H)
CHECK_INCLUDE_FILE(readline/history.h HAVE_HISTORY_H)
IF(HAVE_READLINE_H AND HAVE_HISTORY_H)
FIND_PATH(READLINE_H readline/readline.h)
FIND_PATH(HISTORY_H readline/history.h)
IF(READLINE_H AND HISTORY_H)
SET(CMAKE_REQUIRED_LIBRARIES curses)
CHECK_LIBRARY_EXISTS("readline" "readline" "" HAVE_LIBREADLINE)
CHECK_LIBRARY_EXISTS("readline" "history" "" HAVE_LIBHISTORY)
IF(HAVE_LIBREADLINE AND HAVE_LIBHISTORY)
FIND_LIBRARY(READLINE_LIBRARY readline)
FIND_LIBRARY(HISTORY_LIBRARY history)
IF(READLINE_LIBRARY AND HISTORY_LIBRARY)
SET(HAVE_SYSTEM_READLINE TRUE)
SET(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} " " readline curses)
SET(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY})
INCLUDE_DIRECTORIES(${READLINE_H} ${HISTORY_H})
ADD_DEFINITIONS(-DPHYSFS_HAVE_READLINE=1)
ENDIF(HAVE_LIBREADLINE AND HAVE_LIBHISTORY)
ENDIF(HAVE_READLINE_H AND HAVE_HISTORY_H)
ENDIF(READLINE_LIBRARY AND HISTORY_LIBRARY)
ENDIF(READLINE_H AND HISTORY_H)
ADD_EXECUTABLE(test_physfs test/test_physfs.c)
TARGET_LINK_LIBRARIES(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS})
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs")

0 comments on commit 98790d8

Please sign in to comment.