Merged changeset 1005:cafe3867784c from default branch: cross-compile fixes.
This commit is contained in:
parent
d9f0a87208
commit
98790d824f
|
@ -244,26 +244,21 @@ ENDIF(PHYSFS_ARCHIVE_QPAK)
|
||||||
# See if some archiver required zlib, and see about using system version.
|
# See if some archiver required zlib, and see about using system version.
|
||||||
|
|
||||||
IF(PHYSFS_NEED_ZLIB)
|
IF(PHYSFS_NEED_ZLIB)
|
||||||
CHECK_INCLUDE_FILE(zlib.h HAVE_ZLIB_H)
|
FIND_PACKAGE(ZLIB)
|
||||||
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)
|
IF(ZLIB_FOUND)
|
||||||
OPTION(PHYSFS_INTERNAL_ZLIB "Link own zlib instead of system library" FALSE)
|
OPTION(PHYSFS_INTERNAL_ZLIB "Link own zlib instead of system library" FALSE)
|
||||||
ELSE(HAVE_SYSTEM_ZLIB)
|
ELSE(HAVE_SYSTEM_ZLIB)
|
||||||
SET(PHYSFS_INTERNAL_ZLIB TRUE)
|
SET(PHYSFS_INTERNAL_ZLIB TRUE)
|
||||||
ENDIF(HAVE_SYSTEM_ZLIB)
|
ENDIF(ZLIB_FOUND)
|
||||||
|
|
||||||
IF(PHYSFS_INTERNAL_ZLIB)
|
IF(PHYSFS_INTERNAL_ZLIB)
|
||||||
INCLUDE_DIRECTORIES(zlib123)
|
INCLUDE_DIRECTORIES(zlib123)
|
||||||
ADD_DEFINITIONS(-DZ_PREFIX=1)
|
ADD_DEFINITIONS(-DZ_PREFIX=1)
|
||||||
SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${ZLIB_SRCS})
|
SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${ZLIB_SRCS})
|
||||||
ELSE(PHYSFS_INTERNAL_ZLIB)
|
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_INTERNAL_ZLIB)
|
||||||
ENDIF(PHYSFS_NEED_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)
|
OPTION(PHYSFS_BUILD_TEST "Build stdio test program." TRUE)
|
||||||
MARK_AS_ADVANCED(PHYSFS_BUILD_TEST)
|
MARK_AS_ADVANCED(PHYSFS_BUILD_TEST)
|
||||||
IF(PHYSFS_BUILD_TEST)
|
IF(PHYSFS_BUILD_TEST)
|
||||||
CHECK_INCLUDE_FILE(readline/readline.h HAVE_READLINE_H)
|
FIND_PATH(READLINE_H readline/readline.h)
|
||||||
CHECK_INCLUDE_FILE(readline/history.h HAVE_HISTORY_H)
|
FIND_PATH(HISTORY_H readline/history.h)
|
||||||
IF(HAVE_READLINE_H AND HAVE_HISTORY_H)
|
IF(READLINE_H AND HISTORY_H)
|
||||||
SET(CMAKE_REQUIRED_LIBRARIES curses)
|
SET(CMAKE_REQUIRED_LIBRARIES curses)
|
||||||
CHECK_LIBRARY_EXISTS("readline" "readline" "" HAVE_LIBREADLINE)
|
FIND_LIBRARY(READLINE_LIBRARY readline)
|
||||||
CHECK_LIBRARY_EXISTS("readline" "history" "" HAVE_LIBHISTORY)
|
FIND_LIBRARY(HISTORY_LIBRARY history)
|
||||||
IF(HAVE_LIBREADLINE AND HAVE_LIBHISTORY)
|
IF(READLINE_LIBRARY AND HISTORY_LIBRARY)
|
||||||
SET(HAVE_SYSTEM_READLINE TRUE)
|
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)
|
ADD_DEFINITIONS(-DPHYSFS_HAVE_READLINE=1)
|
||||||
ENDIF(HAVE_LIBREADLINE AND HAVE_LIBHISTORY)
|
ENDIF(READLINE_LIBRARY AND HISTORY_LIBRARY)
|
||||||
ENDIF(HAVE_READLINE_H AND HAVE_HISTORY_H)
|
ENDIF(READLINE_H AND HISTORY_H)
|
||||||
ADD_EXECUTABLE(test_physfs test/test_physfs.c)
|
ADD_EXECUTABLE(test_physfs test/test_physfs.c)
|
||||||
TARGET_LINK_LIBRARIES(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS})
|
TARGET_LINK_LIBRARIES(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS})
|
||||||
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs")
|
SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs")
|
||||||
|
|
Loading…
Reference in New Issue