CMakeLists.txt
author Ryan C. Gordon <icculus@icculus.org>
Fri, 09 Mar 2012 00:44:59 -0500
changeset 1196 54a1dfb1e6f7
parent 1174 f1779b4948bd
child 1197 65f35dc8f84c
permissions -rw-r--r--
Removed PocketPC support. It was old and crusty and targeted a dead platform.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
# PhysicsFS; a portable, flexible file i/o abstraction.
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
# Copyright (C) 2007  Ryan C. Gordon.
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
#
809
116b8fe30371 Renamed LICENSE to LICENSE.txt
Ryan C. Gordon <icculus@icculus.org>
parents: 805
diff changeset
     4
# Please see the file LICENSE.txt in the source's root directory.
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
804
45c29325e017 Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents: 803
diff changeset
     6
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
45c29325e017 Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents: 803
diff changeset
     7
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
PROJECT(PhysicsFS)
1152
702229ccdbb1 Bumping version in CMakeLists.txt (but this is not ready for a release!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1151
diff changeset
     9
SET(PHYSFS_VERSION 2.1.0)
950
7bb0b0d26479 Corrected soname.
Ryan C. Gordon <icculus@icculus.org>
parents: 919
diff changeset
    10
7bb0b0d26479 Corrected soname.
Ryan C. Gordon <icculus@icculus.org>
parents: 919
diff changeset
    11
# Increment this if/when we break backwards compatibility.
952
bbe76b085d4d Screw it, change this back.
Ryan C. Gordon <icculus@icculus.org>
parents: 950
diff changeset
    12
SET(PHYSFS_SOVERSION 1)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
# I hate that they define "WIN32" ... we're about to move to Win64...I hope!
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
IF(WIN32 AND NOT WINDOWS)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
    SET(WINDOWS TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
ENDIF(WIN32 AND NOT WINDOWS)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
# Bleh, let's do it for "APPLE" too.
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
IF(APPLE AND NOT MACOSX)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
    SET(MACOSX TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
ENDIF(APPLE AND NOT MACOSX)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
981
dcbe34cebfeb OS/2 build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 980
diff changeset
    24
# And this might be wrong...
dcbe34cebfeb OS/2 build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 980
diff changeset
    25
IF (CMAKE_SYSTEM MATCHES OS2)
dcbe34cebfeb OS/2 build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 980
diff changeset
    26
    SET(OS2 TRUE)
dcbe34cebfeb OS/2 build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 980
diff changeset
    27
ENDIF (CMAKE_SYSTEM MATCHES OS2)
dcbe34cebfeb OS/2 build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 980
diff changeset
    28
1171
e4ca84e1d289 Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1159
diff changeset
    29
# For now, Haiku and BeOS are the same, as far as the build system cares.
e4ca84e1d289 Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1159
diff changeset
    30
IF(HAIKU AND NOT BEOS)
e4ca84e1d289 Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1159
diff changeset
    31
    SET(BEOS TRUE)
e4ca84e1d289 Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1159
diff changeset
    32
ENDIF(HAIKU AND NOT BEOS)
e4ca84e1d289 Treat Haiku as BeOS in CMakeLists.txt ... this lets CD-ROM support build, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1159
diff changeset
    33
985
dc38a51538aa More Solaris fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 981
diff changeset
    34
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
dc38a51538aa More Solaris fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 981
diff changeset
    35
    SET(SOLARIS TRUE)
dc38a51538aa More Solaris fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 981
diff changeset
    36
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
dc38a51538aa More Solaris fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 981
diff changeset
    37
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
INCLUDE(CheckIncludeFile)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
INCLUDE(CheckLibraryExists)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
INCLUDE(CheckCSourceCompiles)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
980
4608f823787f Fixed include directory in CMakeLists.txt.
Ryan C. Gordon <icculus@icculus.org>
parents: 972
diff changeset
    42
INCLUDE_DIRECTORIES(./src)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
IF(MACOSX)
803
4b1e0994ab97 Clarified a comment.
Ryan C. Gordon <icculus@icculus.org>
parents: 802
diff changeset
    45
    # Fallback to older OS X on PowerPC to support wider range of systems...
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
    IF(CMAKE_OSX_ARCHITECTURES MATCHES ppc)
801
a6d25b52f2c7 Fixes to CMakeLists.txt for Intel Mac.
Ryan C. Gordon <icculus@icculus.org>
parents: 799
diff changeset
    47
        ADD_DEFINITIONS(-DMAC_OS_X_VERSION_MIN_REQUIRED=1020)
a6d25b52f2c7 Fixes to CMakeLists.txt for Intel Mac.
Ryan C. Gordon <icculus@icculus.org>
parents: 799
diff changeset
    48
        SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} " -mmacosx-version-min=10.2")
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
    ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES ppc)
803
4b1e0994ab97 Clarified a comment.
Ryan C. Gordon <icculus@icculus.org>
parents: 802
diff changeset
    50
4b1e0994ab97 Clarified a comment.
Ryan C. Gordon <icculus@icculus.org>
parents: 802
diff changeset
    51
    # Need these everywhere...
4b1e0994ab97 Clarified a comment.
Ryan C. Gordon <icculus@icculus.org>
parents: 802
diff changeset
    52
    ADD_DEFINITIONS(-fno-common)
1174
f1779b4948bd Removed a space in CMakeLists.txt that can make the linker grumpy.
Ryan C. Gordon <icculus@icculus.org>
parents: 1171
diff changeset
    53
    SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework Carbon -framework IOKit")
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54
ENDIF(MACOSX)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    55
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    56
# Add some gcc-specific command lines.
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
IF(CMAKE_COMPILER_IS_GNUCC)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58
    # Always build with debug symbols...you can strip it later.
821
c7dd97edaa4e Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents: 818
diff changeset
    59
    ADD_DEFINITIONS(-g -pipe -Werror -fsigned-char)
c7dd97edaa4e Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents: 818
diff changeset
    60
c7dd97edaa4e Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents: 818
diff changeset
    61
    # Stupid BeOS generates warnings in the system headers.
c7dd97edaa4e Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents: 818
diff changeset
    62
    IF(NOT BEOS)
c7dd97edaa4e Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents: 818
diff changeset
    63
        ADD_DEFINITIONS(-Wall)
c7dd97edaa4e Fixes for BeOS and gcc2.
Ryan C. Gordon <icculus@icculus.org>
parents: 818
diff changeset
    64
    ENDIF(NOT BEOS)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    66
    CHECK_C_SOURCE_COMPILES("
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
        #if ((defined(__GNUC__)) && (__GNUC__ >= 4))
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    68
        int main(int argc, char **argv) { int is_gcc4 = 1; return 0; }
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    69
        #else
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    70
        #error This is not gcc4.
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    71
        #endif
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    72
    " PHYSFS_IS_GCC4)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    73
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    74
    IF(PHYSFS_IS_GCC4)
1009
56a3873c63e4 Don't use -fvisibility=hidden on Windows, since MinGW doesn't support it. :(
Ryan C. Gordon <icculus@icculus.org>
parents: 1005
diff changeset
    75
        # Not supported on several operating systems at this time.
56a3873c63e4 Don't use -fvisibility=hidden on Windows, since MinGW doesn't support it. :(
Ryan C. Gordon <icculus@icculus.org>
parents: 1005
diff changeset
    76
        IF(NOT OS2 AND NOT SOLARIS AND NOT WINDOWS) 
981
dcbe34cebfeb OS/2 build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 980
diff changeset
    77
            ADD_DEFINITIONS(-fvisibility=hidden)
1009
56a3873c63e4 Don't use -fvisibility=hidden on Windows, since MinGW doesn't support it. :(
Ryan C. Gordon <icculus@icculus.org>
parents: 1005
diff changeset
    78
        ENDIF(NOT OS2 AND NOT SOLARIS AND NOT WINDOWS)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    79
    ENDIF(PHYSFS_IS_GCC4)
1040
5fc90d008821 Prevent bogus addition of -rpath to libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 1039
diff changeset
    80
5fc90d008821 Prevent bogus addition of -rpath to libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 1039
diff changeset
    81
    # Don't use -rpath.
5fc90d008821 Prevent bogus addition of -rpath to libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 1039
diff changeset
    82
    SET(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
ENDIF(CMAKE_COMPILER_IS_GNUCC)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
989
70132355a297 Ignore empty files (like #ifdef'd out platform code) on Sun Studio compiler.
Ryan C. Gordon <icculus@icculus.org>
parents: 985
diff changeset
    85
IF(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
70132355a297 Ignore empty files (like #ifdef'd out platform code) on Sun Studio compiler.
Ryan C. Gordon <icculus@icculus.org>
parents: 985
diff changeset
    86
    ADD_DEFINITIONS(-erroff=E_EMPTY_TRANSLATION_UNIT)
991
9748fd040468 Added the Sun Studio equivalent of -fvisibility=hidden
Ryan C. Gordon <icculus@icculus.org>
parents: 990
diff changeset
    87
    ADD_DEFINITIONS(-xldscope=hidden)
989
70132355a297 Ignore empty files (like #ifdef'd out platform code) on Sun Studio compiler.
Ryan C. Gordon <icculus@icculus.org>
parents: 985
diff changeset
    88
ENDIF(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
70132355a297 Ignore empty files (like #ifdef'd out platform code) on Sun Studio compiler.
Ryan C. Gordon <icculus@icculus.org>
parents: 985
diff changeset
    89
836
6514fba91816 Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents: 833
diff changeset
    90
IF(MSVC)
6514fba91816 Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents: 833
diff changeset
    91
    # VS.NET 8.0 got really really anal about strcpy, etc, which even if we
6514fba91816 Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents: 833
diff changeset
    92
    #  cleaned up our code, zlib, etc still use...so disable the warning.
6514fba91816 Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents: 833
diff changeset
    93
    ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS=1)
6514fba91816 Patched to compile with latest Platform SDK.
Ryan C. Gordon <icculus@icculus.org>
parents: 833
diff changeset
    94
ENDIF(MSVC)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
# Basic chunks of source code ...
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    98
SET(ZLIB_SRCS
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    99
    src/zlib123/adler32.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   100
    src/zlib123/compress.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   101
    src/zlib123/crc32.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   102
    src/zlib123/deflate.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   103
    src/zlib123/gzio.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   104
    src/zlib123/infback.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   105
    src/zlib123/inffast.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   106
    src/zlib123/inflate.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   107
    src/zlib123/inftrees.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   108
    src/zlib123/trees.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   109
    src/zlib123/uncompr.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   110
    src/zlib123/zutil.c
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
SET(LZMA_SRCS
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   114
    src/lzma/C/7zCrc.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   115
    src/lzma/C/Archive/7z/7zBuffer.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   116
    src/lzma/C/Archive/7z/7zDecode.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   117
    src/lzma/C/Archive/7z/7zExtract.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   118
    src/lzma/C/Archive/7z/7zHeader.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   119
    src/lzma/C/Archive/7z/7zIn.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   120
    src/lzma/C/Archive/7z/7zItem.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   121
    src/lzma/C/Archive/7z/7zMethodID.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   122
    src/lzma/C/Compress/Branch/BranchX86.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   123
    src/lzma/C/Compress/Branch/BranchX86_2.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   124
    src/lzma/C/Compress/Lzma/LzmaDecode.c
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
818
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   127
IF(BEOS)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   128
    # We add this explicitly, since we don't want CMake to think this
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   129
    #  is a C++ project unless we're on BeOS.
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   130
    SET(PHYSFS_BEOS_SRCS src/platform_beos.cpp)
1133
958df28c5449 Haiku fixes, merged from stable-2.0 branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1128
diff changeset
   131
    FIND_LIBRARY(BE_LIBRARY be)
958df28c5449 Haiku fixes, merged from stable-2.0 branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1128
diff changeset
   132
    FIND_LIBRARY(ROOT_LIBRARY root)
958df28c5449 Haiku fixes, merged from stable-2.0 branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1128
diff changeset
   133
    SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY})
818
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   134
ENDIF(BEOS)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   135
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   136
# Almost everything is "compiled" here, but things that don't apply to the
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   137
#  build are #ifdef'd out. This is to make it easy to embed PhysicsFS into
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   138
#  another project or bring up a new build system: just compile all the source
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   139
#  code and #define the things you want.
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
SET(PHYSFS_SRCS
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   141
    src/physfs.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   142
    src/physfs_byteorder.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   143
    src/physfs_unicode.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   144
    src/platform_os2.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   145
    src/platform_posix.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   146
    src/platform_unix.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   147
    src/platform_macosx.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   148
    src/platform_windows.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   149
    src/archiver_dir.c
1128
067d8e76261e Moved most the cut-and-paste between simple archivers to one file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1066
diff changeset
   150
    src/archiver_unpacked.c
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   151
    src/archiver_grp.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   152
    src/archiver_hog.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   153
    src/archiver_lzma.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   154
    src/archiver_mvl.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   155
    src/archiver_qpak.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   156
    src/archiver_wad.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
   157
    src/archiver_zip.c
1064
cc4db73e87d1 ISO9660 archiver, compliments of Christoph Nelles.
Ryan C. Gordon <icculus@icculus.org>
parents: 1051
diff changeset
   158
    src/archiver_iso9660.c
818
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   159
    ${PHYSFS_BEOS_SRCS}
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   162
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163
# platform layers ...
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   164
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   165
IF(UNIX)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   166
    IF(BEOS)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
        SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE)
818
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   168
        SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   169
        SET(HAVE_PTHREAD_H TRUE)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
    ELSE(BEOS)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
        # !!! FIXME
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
        #  AC_DEFINE([PHYSFS_HAVE_LLSEEK], 1, [define if we have llseek])
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
        CHECK_INCLUDE_FILE(sys/ucred.h HAVE_UCRED_H)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
        IF(HAVE_UCRED_H)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
            ADD_DEFINITIONS(-DPHYSFS_HAVE_SYS_UCRED_H=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
            SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
        ENDIF(HAVE_UCRED_H)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   179
        CHECK_INCLUDE_FILE(mntent.h HAVE_MNTENT_H)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
        IF(HAVE_MNTENT_H)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   181
            ADD_DEFINITIONS(-DPHYSFS_HAVE_MNTENT_H=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   182
            SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
        ENDIF(HAVE_MNTENT_H)
818
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   184
990
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   185
        # !!! FIXME: Solaris fails this, because mnttab.h implicitly
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   186
        # !!! FIXME:  depends on other system headers.  :(
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   187
        #CHECK_INCLUDE_FILE(sys/mnttab.h HAVE_SYS_MNTTAB_H)
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   188
        CHECK_C_SOURCE_COMPILES("
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   189
            #include <stdio.h>
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   190
            #include <sys/mnttab.h>
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   191
            int main(int argc, char **argv) { return 0; }
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   192
        " HAVE_SYS_MNTTAB_H)
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   193
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   194
        IF(HAVE_SYS_MNTTAB_H)
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   195
            ADD_DEFINITIONS(-DPHYSFS_HAVE_SYS_MNTTAB_H=1)
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   196
            SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE)
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   197
        ENDIF(HAVE_SYS_MNTTAB_H)
c25717b5c165 Added sys/mnttab.h CD-ROM detection. Fixes missing CD-ROM support on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 989
diff changeset
   198
818
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   199
        CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   200
        IF(HAVE_PTHREAD_H)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   201
            SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   202
        ENDIF(HAVE_PTHREAD_H)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   203
    ENDIF(BEOS)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   204
ENDIF(UNIX)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   205
981
dcbe34cebfeb OS/2 build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 980
diff changeset
   206
IF(WINDOWS OR OS2)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   207
    SET(PHYSFS_HAVE_CDROM_SUPPORT TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   208
    SET(PHYSFS_HAVE_THREAD_SUPPORT TRUE)
981
dcbe34cebfeb OS/2 build fixes.
Ryan C. Gordon <icculus@icculus.org>
parents: 980
diff changeset
   209
ENDIF(WINDOWS OR OS2)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   210
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   211
IF(NOT PHYSFS_HAVE_CDROM_SUPPORT)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   212
    ADD_DEFINITIONS(-DPHYSFS_NO_CDROM_SUPPORT=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   213
    MESSAGE(WARNING " ***")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   214
    MESSAGE(WARNING " *** There is no CD-ROM support in this build!")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   215
    MESSAGE(WARNING " *** PhysicsFS will just pretend there are no discs.")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   216
    MESSAGE(WARNING " *** This may be fine, depending on how PhysicsFS is used,")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   217
    MESSAGE(WARNING " ***   but is this what you REALLY wanted?")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   218
    MESSAGE(WARNING " *** (Maybe fix CMakeLists.txt, or write a platform driver?)")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   219
    MESSAGE(WARNING " ***")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   220
ENDIF(NOT PHYSFS_HAVE_CDROM_SUPPORT)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   221
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   222
IF(PHYSFS_HAVE_THREAD_SUPPORT)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   223
    ADD_DEFINITIONS(-D_REENTRANT -D_THREAD_SAFE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   224
ELSE(PHYSFS_HAVE_THREAD_SUPPORT)
1047
18ae36a7f55b Catch case where we use the Unix code on a non-Unix system that lacks pthreads.
Ryan C. Gordon <icculus@icculus.org>
parents: 1044
diff changeset
   225
    ADD_DEFINITIONS(-DPHYSFS_NO_THREAD_SUPPORT=1)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   226
    MESSAGE(WARNING " ***")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   227
    MESSAGE(WARNING " *** There is no thread support in this build!")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   228
    MESSAGE(WARNING " *** PhysicsFS will NOT be reentrant!")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   229
    MESSAGE(WARNING " *** This may be fine, depending on how PhysicsFS is used,")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   230
    MESSAGE(WARNING " ***   but is this what you REALLY wanted?")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   231
    MESSAGE(WARNING " *** (Maybe fix CMakeLists.txt, or write a platform driver?)")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   232
    MESSAGE(WARNING " ***")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   233
ENDIF(PHYSFS_HAVE_THREAD_SUPPORT)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   234
818
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   235
CHECK_INCLUDE_FILE(assert.h HAVE_ASSERT_H)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   236
IF(HAVE_ASSERT_H)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   237
    ADD_DEFINITIONS(-DHAVE_ASSERT_H=1)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   238
ENDIF(HAVE_ASSERT_H)
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   239
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   240
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   241
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   242
# Archivers ...
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   243
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   244
OPTION(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   245
IF(PHYSFS_ARCHIVE_ZIP)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   246
    ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_ZIP=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   247
    SET(PHYSFS_NEED_ZLIB TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   248
ENDIF(PHYSFS_ARCHIVE_ZIP)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   249
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   250
OPTION(PHYSFS_ARCHIVE_7Z "Enable 7zip support" TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   251
IF(PHYSFS_ARCHIVE_7Z)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   252
    ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_7Z=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   253
    # !!! FIXME: rename to 7z.c?
818
e36f23f49042 Now compiles everything whether we need it or not, removing whole files with
Ryan C. Gordon <icculus@icculus.org>
parents: 809
diff changeset
   254
    SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${LZMA_SRCS})
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   255
ENDIF(PHYSFS_ARCHIVE_7Z)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   256
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   257
OPTION(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   258
IF(PHYSFS_ARCHIVE_GRP)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   259
    ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_GRP=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   260
ENDIF(PHYSFS_ARCHIVE_GRP)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   261
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   262
OPTION(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   263
IF(PHYSFS_ARCHIVE_WAD)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   264
    ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_WAD=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   265
ENDIF(PHYSFS_ARCHIVE_WAD)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   266
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   267
OPTION(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   268
IF(PHYSFS_ARCHIVE_HOG)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   269
    ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_HOG=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   270
ENDIF(PHYSFS_ARCHIVE_HOG)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   271
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   272
OPTION(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   273
IF(PHYSFS_ARCHIVE_MVL)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   274
    ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_MVL=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   275
ENDIF(PHYSFS_ARCHIVE_MVL)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   276
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   277
OPTION(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   278
IF(PHYSFS_ARCHIVE_QPAK)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   279
    ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_QPAK=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   280
ENDIF(PHYSFS_ARCHIVE_QPAK)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   281
1066
e1d83e3b5d32 Make ISO9660 archiver optional.
Ryan C. Gordon <icculus@icculus.org>
parents: 1064
diff changeset
   282
OPTION(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE)
e1d83e3b5d32 Make ISO9660 archiver optional.
Ryan C. Gordon <icculus@icculus.org>
parents: 1064
diff changeset
   283
IF(PHYSFS_ARCHIVE_ISO9660)
e1d83e3b5d32 Make ISO9660 archiver optional.
Ryan C. Gordon <icculus@icculus.org>
parents: 1064
diff changeset
   284
    ADD_DEFINITIONS(-DPHYSFS_SUPPORTS_ISO9660=1)
e1d83e3b5d32 Make ISO9660 archiver optional.
Ryan C. Gordon <icculus@icculus.org>
parents: 1064
diff changeset
   285
ENDIF(PHYSFS_ARCHIVE_ISO9660)
e1d83e3b5d32 Make ISO9660 archiver optional.
Ryan C. Gordon <icculus@icculus.org>
parents: 1064
diff changeset
   286
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   287
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   288
# See if some archiver required zlib, and see about using system version.
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   289
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   290
IF(PHYSFS_NEED_ZLIB)
1005
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   291
    FIND_PACKAGE(ZLIB)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   292
1005
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   293
    IF(ZLIB_FOUND)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   294
        OPTION(PHYSFS_INTERNAL_ZLIB "Link own zlib instead of system library" FALSE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   295
    ELSE(HAVE_SYSTEM_ZLIB)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   296
        SET(PHYSFS_INTERNAL_ZLIB TRUE)
1005
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   297
    ENDIF(ZLIB_FOUND)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   298
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   299
    IF(PHYSFS_INTERNAL_ZLIB)
1139
861def17a888 Fixed include path when using internal zlib.
Ryan C. Gordon <icculus@icculus.org>
parents: 1133
diff changeset
   300
        INCLUDE_DIRECTORIES(./src/zlib123)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   301
        ADD_DEFINITIONS(-DZ_PREFIX=1)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   302
        SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${ZLIB_SRCS})
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   303
    ELSE(PHYSFS_INTERNAL_ZLIB)
1005
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   304
        SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${ZLIB_LIBRARY})
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   305
        INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   306
    ENDIF(PHYSFS_INTERNAL_ZLIB)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   307
ENDIF(PHYSFS_NEED_ZLIB)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   308
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   309
OPTION(PHYSFS_BUILD_STATIC "Build static library" TRUE)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   310
IF(PHYSFS_BUILD_STATIC)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   311
    ADD_LIBRARY(physfs-static STATIC ${PHYSFS_SRCS})
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   312
    SET_TARGET_PROPERTIES(physfs-static PROPERTIES OUTPUT_NAME "physfs")
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   313
    SET(PHYSFS_LIB_TARGET physfs-static)
833
b260f190aa59 Whoops, switched two strings in CMakeLists.txt
Ryan C. Gordon <icculus@icculus.org>
parents: 827
diff changeset
   314
    SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static")
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   315
ENDIF(PHYSFS_BUILD_STATIC)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   316
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   317
OPTION(PHYSFS_BUILD_SHARED "Build shared library" TRUE)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   318
IF(PHYSFS_BUILD_SHARED)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   319
    ADD_LIBRARY(physfs SHARED ${PHYSFS_SRCS})
805
b462f06edbca Install libraries with a VERSION and SOVERSION.
Ryan C. Gordon <icculus@icculus.org>
parents: 804
diff changeset
   320
    SET_TARGET_PROPERTIES(physfs PROPERTIES VERSION ${PHYSFS_VERSION})
b462f06edbca Install libraries with a VERSION and SOVERSION.
Ryan C. Gordon <icculus@icculus.org>
parents: 804
diff changeset
   321
    SET_TARGET_PROPERTIES(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION})
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   322
    TARGET_LINK_LIBRARIES(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   323
    SET(PHYSFS_LIB_TARGET physfs)
833
b260f190aa59 Whoops, switched two strings in CMakeLists.txt
Ryan C. Gordon <icculus@icculus.org>
parents: 827
diff changeset
   324
    SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs")
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   325
ENDIF(PHYSFS_BUILD_SHARED)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   326
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   327
IF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   328
    MESSAGE(FATAL "Both shared and static libraries are disabled!")
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   329
ENDIF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   330
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   331
# CMake FAQ says I need this...
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   332
IF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   333
    SET_TARGET_PROPERTIES(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   334
    SET_TARGET_PROPERTIES(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   335
ENDIF(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   336
878
6d65c5e0049a Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents: 847
diff changeset
   337
OPTION(PHYSFS_BUILD_TEST "Build stdio test program." TRUE)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   338
MARK_AS_ADVANCED(PHYSFS_BUILD_TEST)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   339
IF(PHYSFS_BUILD_TEST)
1005
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   340
    FIND_PATH(READLINE_H readline/readline.h)
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   341
    FIND_PATH(HISTORY_H readline/history.h)
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   342
    IF(READLINE_H AND HISTORY_H)
1133
958df28c5449 Haiku fixes, merged from stable-2.0 branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1128
diff changeset
   343
        FIND_LIBRARY(CURSES_LIBRARY NAMES curses ncurses)
958df28c5449 Haiku fixes, merged from stable-2.0 branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1128
diff changeset
   344
        SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
1005
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   345
        FIND_LIBRARY(READLINE_LIBRARY readline)
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   346
        FIND_LIBRARY(HISTORY_LIBRARY history)
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   347
        IF(READLINE_LIBRARY AND HISTORY_LIBRARY)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   348
            SET(HAVE_SYSTEM_READLINE TRUE)
1005
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   349
            SET(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY})
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   350
            INCLUDE_DIRECTORIES(${READLINE_H} ${HISTORY_H})
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   351
            ADD_DEFINITIONS(-DPHYSFS_HAVE_READLINE=1)
1005
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   352
        ENDIF(READLINE_LIBRARY AND HISTORY_LIBRARY)
cafe3867784c Fixed CMakeLists.txt to properly handle cross-compiling (thanks, Marc!).
Ryan C. Gordon <icculus@icculus.org>
parents: 993
diff changeset
   353
    ENDIF(READLINE_H AND HISTORY_H)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   354
    ADD_EXECUTABLE(test_physfs test/test_physfs.c)
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   355
    TARGET_LINK_LIBRARIES(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS})
804
45c29325e017 Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents: 803
diff changeset
   356
    SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs")
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   357
ENDIF(PHYSFS_BUILD_TEST)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   358
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   359
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   360
# Scripting language bindings...
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   361
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   362
#CMake's SWIG support is basically useless.
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   363
#FIND_PACKAGE(SWIG)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   364
1159
06fa9794e5c6 Added an option to disable all SWIG bindings at once.
Ryan C. Gordon <icculus@icculus.org>
parents: 1158
diff changeset
   365
OPTION(PHYSFS_BUILD_SWIG "Build ${_LANG} bindings." TRUE)
06fa9794e5c6 Added an option to disable all SWIG bindings at once.
Ryan C. Gordon <icculus@icculus.org>
parents: 1158
diff changeset
   366
MARK_AS_ADVANCED(PHYSFS_BUILD_SWIG)
06fa9794e5c6 Added an option to disable all SWIG bindings at once.
Ryan C. Gordon <icculus@icculus.org>
parents: 1158
diff changeset
   367
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   368
FIND_PROGRAM(SWIG swig DOC "Path to swig command line app: http://swig.org/")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   369
IF(NOT SWIG)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   370
    MESSAGE(STATUS "SWIG not found. You won't be able to build scripting language bindings.")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   371
ELSE(NOT SWIG)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   372
    MARK_AS_ADVANCED(SWIG)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   373
    IF(DEFINED CMAKE_BUILD_TYPE)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   374
        IF((NOT CMAKE_BUILD_TYPE STREQUAL "") AND (NOT CMAKE_BUILD_TYPE STREQUAL "Debug"))
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   375
            IF(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   376
                SET(SWIG_OPT_CFLAGS "-small")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   377
            ELSE(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   378
                SET(SWIG_OPT_CFLAGS "-O")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   379
            ENDIF(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   380
        ENDIF((NOT CMAKE_BUILD_TYPE STREQUAL "") AND (NOT CMAKE_BUILD_TYPE STREQUAL "Debug"))
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   381
    ENDIF(DEFINED CMAKE_BUILD_TYPE)
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   382
1038
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   383
    SET(SWIG_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/physfs-swig-bindings")
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   384
1035
f6ca3f9af74c More work on Perl bindings linking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1034
diff changeset
   385
    MACRO(CONFIGURE_SWIG_BINDING _LANG _INSTALLPATH _EXTRAOUTPUTS _EXTRACFLAGS _EXTRALDFLAGS)
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   386
        STRING(TOUPPER "${_LANG}" _UPPERLANG)
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   387
        STRING(TOLOWER "${_LANG}" _LOWERLANG)
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   388
        SET(_TARGET "physfs-${_LOWERLANG}")
1038
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   389
        SET(_TARGETDIR "${SWIG_OUTPUT_DIR}/${_LOWERLANG}")
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   390
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   391
        IF(NOT EXISTS "${_TARGETDIR}")
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   392
            FILE(MAKE_DIRECTORY "${_TARGETDIR}")
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   393
        ENDIF(NOT EXISTS "${_TARGETDIR}")
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   394
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   395
        IF(PHYSFS_BUILD_${_UPPERLANG})
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   396
            ADD_CUSTOM_COMMAND(
1038
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   397
                OUTPUT "${_TARGETDIR}/${_TARGET}.c" ${_EXTRAOUTPUTS}
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   398
                MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/extras/physfs-swig.i"
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   399
                COMMAND "${SWIG}"
1038
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   400
                ARGS ${SWIG_OPT_CFLAGS} -${_LOWERLANG} -outdir "${_TARGETDIR}" -o "${_TARGETDIR}/${_TARGET}.c" "${CMAKE_CURRENT_SOURCE_DIR}/extras/physfs-swig.i"
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   401
                COMMENT "Generating ${_LANG} bindings..."
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   402
            )
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   403
1038
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   404
            ADD_LIBRARY(${_TARGET} SHARED "${_TARGETDIR}/${_TARGET}.c")
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   405
            TARGET_LINK_LIBRARIES(${_TARGET} ${PHYSFS_LIB_TARGET})
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   406
            SET_TARGET_PROPERTIES(${_TARGET} PROPERTIES
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   407
                COMPILE_FLAGS "${_EXTRACFLAGS}"
1035
f6ca3f9af74c More work on Perl bindings linking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1034
diff changeset
   408
                LINK_FLAGS "${_EXTRALDFLAGS}"
1038
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   409
                LIBRARY_OUTPUT_NAME "physfs"
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   410
                LIBRARY_OUTPUT_DIRECTORY "${_TARGETDIR}"
1039
6ea910694da8 Not sure if this is still needed (it's definitely unneeded in CMake 2.8).
Ryan C. Gordon <icculus@icculus.org>
parents: 1038
diff changeset
   411
                CLEAN_DIRECT_OUTPUT 1
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   412
            )
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   413
            INSTALL(TARGETS ${_TARGET} LIBRARY DESTINATION "${_INSTALLPATH}")
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   414
            MESSAGE(STATUS "${_LANG} bindings configured!")
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   415
        ELSE(PHYSFS_BUILD_${_UPPERLANG})
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   416
            MESSAGE(STATUS "Couldn't figure out ${_LANG} configuration. Skipping ${_LANG} bindings.")
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   417
        ENDIF(PHYSFS_BUILD_${_UPPERLANG})
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   418
    ENDMACRO(CONFIGURE_SWIG_BINDING)
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   419
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   420
    MACRO(ADD_SCRIPT_BINDING_OPTION _VAR _LANG _DEFVAL)
1159
06fa9794e5c6 Added an option to disable all SWIG bindings at once.
Ryan C. Gordon <icculus@icculus.org>
parents: 1158
diff changeset
   421
        SET(BUILDSWIGVAL ${_DEFVAL})
06fa9794e5c6 Added an option to disable all SWIG bindings at once.
Ryan C. Gordon <icculus@icculus.org>
parents: 1158
diff changeset
   422
        IF(NOT PHYSFS_BUILD_SWIG)
06fa9794e5c6 Added an option to disable all SWIG bindings at once.
Ryan C. Gordon <icculus@icculus.org>
parents: 1158
diff changeset
   423
            SET(BUILDSWIGVAL FALSE)
06fa9794e5c6 Added an option to disable all SWIG bindings at once.
Ryan C. Gordon <icculus@icculus.org>
parents: 1158
diff changeset
   424
        ENDIF(NOT PHYSFS_BUILD_SWIG)
06fa9794e5c6 Added an option to disable all SWIG bindings at once.
Ryan C. Gordon <icculus@icculus.org>
parents: 1158
diff changeset
   425
        OPTION(${_VAR} "Build ${_LANG} bindings." ${BUILDSWIGVAL})
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   426
        MARK_AS_ADVANCED(${_VAR})
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   427
    ENDMACRO(ADD_SCRIPT_BINDING_OPTION)
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   428
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   429
    ADD_SCRIPT_BINDING_OPTION(PHYSFS_BUILD_PERL "Perl" TRUE)
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   430
    ADD_SCRIPT_BINDING_OPTION(PHYSFS_BUILD_RUBY "Ruby" TRUE)
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   431
ENDIF(NOT SWIG)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   432
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   433
IF(PHYSFS_BUILD_PERL)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   434
    MESSAGE(STATUS "Configuring Perl bindings...")
1033
c846b83628f4 Use FIND_PROGRAM(perl) instead of FindPerl.
Ryan C. Gordon <icculus@icculus.org>
parents: 1032
diff changeset
   435
    FIND_PROGRAM(PERL perl DOC "Path to perl command line app: http://perl.org/")
c846b83628f4 Use FIND_PROGRAM(perl) instead of FindPerl.
Ryan C. Gordon <icculus@icculus.org>
parents: 1032
diff changeset
   436
    IF(NOT PERL)
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   437
        MESSAGE(STATUS "Perl not found. You won't be able to build perl bindings.")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   438
        SET(PHYSFS_BUILD_PERL FALSE)
1033
c846b83628f4 Use FIND_PROGRAM(perl) instead of FindPerl.
Ryan C. Gordon <icculus@icculus.org>
parents: 1032
diff changeset
   439
    ENDIF(NOT PERL)
1051
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   440
    MARK_AS_ADVANCED(PERL)
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   441
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   442
    MACRO(GET_PERL_CONFIG _KEY _VALUE)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   443
        IF(PHYSFS_BUILD_PERL)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   444
            MESSAGE(STATUS "Figuring out perl config value '${_KEY}' ...")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   445
            EXECUTE_PROCESS(
1033
c846b83628f4 Use FIND_PROGRAM(perl) instead of FindPerl.
Ryan C. Gordon <icculus@icculus.org>
parents: 1032
diff changeset
   446
                COMMAND ${PERL} -w -e "use Config; print \$Config{${_KEY}};"
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   447
                RESULT_VARIABLE GET_PERL_CONFIG_RC
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   448
                OUTPUT_VARIABLE ${_VALUE}
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   449
            )
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   450
            IF(NOT GET_PERL_CONFIG_RC EQUAL 0)
1033
c846b83628f4 Use FIND_PROGRAM(perl) instead of FindPerl.
Ryan C. Gordon <icculus@icculus.org>
parents: 1032
diff changeset
   451
                MESSAGE(STATUS "Perl executable ('${PERL}') reported failure: ${GET_PERL_CONFIG_RC}")
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   452
                SET(PHYSFS_BUILD_PERL FALSE)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   453
            ENDIF(NOT GET_PERL_CONFIG_RC EQUAL 0)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   454
            IF(NOT ${_VALUE})
1033
c846b83628f4 Use FIND_PROGRAM(perl) instead of FindPerl.
Ryan C. Gordon <icculus@icculus.org>
parents: 1032
diff changeset
   455
                MESSAGE(STATUS "Perl executable ('${PERL}') didn't have a value for '${_KEY}'")
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   456
                SET(PHYSFS_BUILD_PERL FALSE)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   457
            ENDIF(NOT ${_VALUE})
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   458
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   459
            IF(PHYSFS_BUILD_PERL)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   460
                MESSAGE(STATUS "Perl says: '${${_VALUE}}'.")
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   461
            ENDIF(PHYSFS_BUILD_PERL)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   462
        ENDIF(PHYSFS_BUILD_PERL)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   463
    ENDMACRO(GET_PERL_CONFIG)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   464
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   465
    # !!! FIXME: installsitearch might be the wrong location.
1034
a20aae42114b I think this gets the right Perl include path value.
Ryan C. Gordon <icculus@icculus.org>
parents: 1033
diff changeset
   466
    GET_PERL_CONFIG("archlibexp" PERL_INCLUDE_PATH)
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   467
    GET_PERL_CONFIG("ccflags" PERL_CCFLAGS)
1035
f6ca3f9af74c More work on Perl bindings linking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1034
diff changeset
   468
    GET_PERL_CONFIG("ldflags" PERL_LDFLAGS)
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   469
    GET_PERL_CONFIG("installsitearch" PERL_INSTALL_PATH)
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   470
1037
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   471
    # !!! FIXME: this test for Mac OS X is wrong.
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   472
    IF(MACOSX)
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   473
        GET_PERL_CONFIG("libperl" PERL_LIBPERL)
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   474
        SET(TMPLIBPERL "${PERL_LIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   475
        STRING(REGEX REPLACE "^lib" "" TMPLIBPERL "${TMPLIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   476
        STRING(REGEX REPLACE "\\.so$" "" TMPLIBPERL "${TMPLIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   477
        STRING(REGEX REPLACE "\\.dylib$" "" TMPLIBPERL "${TMPLIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   478
        STRING(REGEX REPLACE "\\.dll$" "" TMPLIBPERL "${TMPLIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   479
        IF(NOT "${TMPLIBPERL}" STREQUAL "${PERL_LIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   480
            MESSAGE(STATUS "Stripped '${PERL_LIBPERL}' down to '${TMPLIBPERL}'.")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   481
            SET(PERL_LIBPERL "${TMPLIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   482
        ENDIF(NOT "${TMPLIBPERL}" STREQUAL "${PERL_LIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   483
        SET(PERL_LIBPERL "-l${PERL_LIBPERL}")
d452f4da0970 More perl bindings wanking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1035
diff changeset
   484
    ENDIF(MACOSX)
1035
f6ca3f9af74c More work on Perl bindings linking.
Ryan C. Gordon <icculus@icculus.org>
parents: 1034
diff changeset
   485
1038
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   486
    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}")
16b7dedb02a5 Fixed filename collision when linking the library and script bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1037
diff changeset
   487
    INSTALL(FILES "${SWIG_OUTPUT_DIR}/perl/physfs.pm" DESTINATION "${PERL_INSTALL_PATH}")
1044
c06cad5295c3 Install test_physfs.pl with the rest of the project.
Ryan C. Gordon <icculus@icculus.org>
parents: 1042
diff changeset
   488
    INSTALL(
c06cad5295c3 Install test_physfs.pl with the rest of the project.
Ryan C. Gordon <icculus@icculus.org>
parents: 1042
diff changeset
   489
        FILES test/test_physfs.pl
c06cad5295c3 Install test_physfs.pl with the rest of the project.
Ryan C. Gordon <icculus@icculus.org>
parents: 1042
diff changeset
   490
        DESTINATION bin
c06cad5295c3 Install test_physfs.pl with the rest of the project.
Ryan C. Gordon <icculus@icculus.org>
parents: 1042
diff changeset
   491
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
c06cad5295c3 Install test_physfs.pl with the rest of the project.
Ryan C. Gordon <icculus@icculus.org>
parents: 1042
diff changeset
   492
                    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
c06cad5295c3 Install test_physfs.pl with the rest of the project.
Ryan C. Gordon <icculus@icculus.org>
parents: 1042
diff changeset
   493
    )
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   494
ENDIF(PHYSFS_BUILD_PERL)
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   495
1051
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   496
# !!! FIXME: lots of cut-and-paste from perl bindings.
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   497
IF(PHYSFS_BUILD_RUBY)
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   498
    MESSAGE(STATUS "Configuring Ruby bindings...")
1051
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   499
    FIND_PROGRAM(RUBY ruby DOC "Path to ruby command line app: http://ruby-lang.org/")
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   500
    IF(NOT RUBY)
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   501
        MESSAGE(STATUS "Ruby not found. You won't be able to build ruby bindings.")
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   502
        SET(PHYSFS_BUILD_RUBY FALSE)
1051
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   503
    ENDIF(NOT RUBY)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   504
    MARK_AS_ADVANCED(RUBY)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   505
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   506
    MACRO(GET_RUBY_CONFIG _KEY _VALUE)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   507
        IF(PHYSFS_BUILD_RUBY)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   508
            MESSAGE(STATUS "Figuring out ruby config value '${_KEY}' ...")
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   509
            EXECUTE_PROCESS(
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   510
                COMMAND ${RUBY} -e "require 'rbconfig'; puts RbConfig::CONFIG['${_KEY}'];"
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   511
                RESULT_VARIABLE GET_RUBY_CONFIG_RC
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   512
                OUTPUT_VARIABLE ${_VALUE}
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   513
                OUTPUT_STRIP_TRAILING_WHITESPACE
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   514
            )
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   515
            IF(NOT GET_RUBY_CONFIG_RC EQUAL 0)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   516
                MESSAGE(STATUS "Ruby executable ('${RUBY}') reported failure: ${GET_RUBY_CONFIG_RC}")
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   517
                SET(PHYSFS_BUILD_RUBY FALSE)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   518
            ENDIF(NOT GET_RUBY_CONFIG_RC EQUAL 0)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   519
            IF(NOT ${_VALUE})
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   520
                MESSAGE(STATUS "Ruby executable ('${RUBY}') didn't have a value for '${_KEY}'")
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   521
                SET(PHYSFS_BUILD_RUBY FALSE)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   522
            ENDIF(NOT ${_VALUE})
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   523
1051
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   524
            IF(PHYSFS_BUILD_RUBY)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   525
                MESSAGE(STATUS "Ruby says: '${${_VALUE}}'.")
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   526
            ENDIF(PHYSFS_BUILD_RUBY)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   527
        ENDIF(PHYSFS_BUILD_RUBY)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   528
    ENDMACRO(GET_RUBY_CONFIG)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   529
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   530
    GET_RUBY_CONFIG("archdir" RUBY_INCLUDE_PATH)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   531
    GET_RUBY_CONFIG("CFLAGS" RUBY_CCFLAGS)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   532
    GET_RUBY_CONFIG("LDFLAGS" RUBY_LDFLAGS)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   533
    GET_RUBY_CONFIG("sitearchdir" RUBY_INSTALL_PATH)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   534
    GET_RUBY_CONFIG("LIBRUBYARG_SHARED" RUBY_LIBRUBY)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   535
    GET_RUBY_CONFIG("libdir" RUBY_LIBDIR)
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   536
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   537
    CONFIGURE_SWIG_BINDING(Ruby "${RUBY_INSTALL_PATH}" "" "\"-I${RUBY_INCLUDE_PATH}\" ${RUBY_CCFLAGS} -w" "\"-L${RUBY_LIBDIR}\" ${RUBY_LIBRUBY} ${RUBY_LDFLAGS}")
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   538
    SET_TARGET_PROPERTIES(physfs-ruby PROPERTIES PREFIX "")
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   539
    INSTALL(
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   540
        FILES test/test_physfs.rb
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   541
        DESTINATION bin
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   542
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   543
                    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
42fef01c55d6 Added SWIG-based Ruby bindings.
Ryan C. Gordon <icculus@icculus.org>
parents: 1047
diff changeset
   544
    )
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   545
ENDIF(PHYSFS_BUILD_RUBY)
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   546
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   547
804
45c29325e017 Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents: 803
diff changeset
   548
INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS}
45c29325e017 Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents: 803
diff changeset
   549
        RUNTIME DESTINATION bin
1140
079b6bf97b23 Use LIB_SUFFIX to install to lib64 instead of lib (thanks, Cristian!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1139
diff changeset
   550
        LIBRARY DESTINATION lib${LIB_SUFFIX}
079b6bf97b23 Use LIB_SUFFIX to install to lib64 instead of lib (thanks, Cristian!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1139
diff changeset
   551
        ARCHIVE DESTINATION lib${LIB_SUFFIX})
1015
7bd933e66d8d Corrected physfs.h installation for new directory layout (thanks, Patrice!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1009
diff changeset
   552
INSTALL(FILES src/physfs.h DESTINATION include)
804
45c29325e017 Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents: 803
diff changeset
   553
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   554
FIND_PACKAGE(Doxygen)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   555
IF(DOXYGEN_FOUND)
1151
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   556
    SET(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   557
    CONFIGURE_FILE(
1153
5cbedebaa623 Corrected doc paths for development branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1152
diff changeset
   558
        "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile"
1151
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   559
        "${PHYSFS_OUTPUT_DOXYFILE}"
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   560
        COPYONLY
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   561
    )
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   562
    FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n")
1155
bd6526fa8f95 Put some quotes around autogenerated Doxygen options.
Ryan C. Gordon <icculus@icculus.org>
parents: 1153
diff changeset
   563
    FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = \"${PHYSFS_VERSION}\"\n")
bd6526fa8f95 Put some quotes around autogenerated Doxygen options.
Ryan C. Gordon <icculus@icculus.org>
parents: 1153
diff changeset
   564
    FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = \"${CMAKE_CURRENT_BINARY_DIR}/docs\"\n")
1151
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   565
    FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n")
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   566
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   567
    ADD_CUSTOM_TARGET(
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   568
        docs
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   569
        ${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}"
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   570
        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   571
        COMMENT "Building documentation in 'docs' directory..."
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   572
    )
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   573
ELSE(DOXYGEN_FOUND)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   574
    MESSAGE(STATUS "Doxygen not found. You won't be able to build documentation.")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   575
ENDIF(DOXYGEN_FOUND)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   576
885
e1fe7fe85939 Added a hack for "make dist" functionality.
Ryan C. Gordon <icculus@icculus.org>
parents: 878
diff changeset
   577
IF(UNIX)
1042
dc9291957a5a Fixed "make dist" target.
Ryan C. Gordon <icculus@icculus.org>
parents: 1041
diff changeset
   578
    SET(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.gz")
1041
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   579
    ADD_CUSTOM_TARGET(
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   580
        dist
1042
dc9291957a5a Fixed "make dist" target.
Ryan C. Gordon <icculus@icculus.org>
parents: 1041
diff changeset
   581
        hg archive -t tgz "${PHYSFS_TARBALL}"
dc9291957a5a Fixed "make dist" target.
Ryan C. Gordon <icculus@icculus.org>
parents: 1041
diff changeset
   582
        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
dc9291957a5a Fixed "make dist" target.
Ryan C. Gordon <icculus@icculus.org>
parents: 1041
diff changeset
   583
        COMMENT "Building source tarball '${PHYSFS_TARBALL}'..."
1041
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   584
    )
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   585
    ADD_CUSTOM_TARGET(
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   586
        uninstall
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   587
        "${CMAKE_CURRENT_SOURCE_DIR}/extras/uninstall.sh"
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   588
        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   589
        COMMENT "Uninstall the project..."
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   590
    )
885
e1fe7fe85939 Added a hack for "make dist" functionality.
Ryan C. Gordon <icculus@icculus.org>
parents: 878
diff changeset
   591
ENDIF(UNIX)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   592
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   593
MACRO(MESSAGE_BOOL_OPTION _NAME _VALUE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   594
    IF(${_VALUE})
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   595
        MESSAGE(STATUS "  ${_NAME}: enabled")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   596
    ELSE(${_VALUE})
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   597
        MESSAGE(STATUS "  ${_NAME}: disabled")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   598
    ENDIF(${_VALUE})
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   599
ENDMACRO(MESSAGE_BOOL_OPTION)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   600
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   601
MESSAGE(STATUS "PhysicsFS will build with the following options:")
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   602
MESSAGE_BOOL_OPTION("ZIP support" PHYSFS_ARCHIVE_ZIP)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   603
MESSAGE_BOOL_OPTION("7zip support" PHYSFS_ARCHIVE_7Z)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   604
MESSAGE_BOOL_OPTION("GRP support" PHYSFS_ARCHIVE_GRP)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   605
MESSAGE_BOOL_OPTION("WAD support" PHYSFS_ARCHIVE_WAD)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   606
MESSAGE_BOOL_OPTION("HOG support" PHYSFS_ARCHIVE_HOG)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   607
MESSAGE_BOOL_OPTION("MVL support" PHYSFS_ARCHIVE_MVL)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   608
MESSAGE_BOOL_OPTION("QPAK support" PHYSFS_ARCHIVE_QPAK)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   609
MESSAGE_BOOL_OPTION("CD-ROM drive support" PHYSFS_HAVE_CDROM_SUPPORT)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   610
MESSAGE_BOOL_OPTION("Thread safety" PHYSFS_HAVE_THREAD_SUPPORT)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   611
MESSAGE_BOOL_OPTION("Build own zlib" PHYSFS_INTERNAL_ZLIB)
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   612
MESSAGE_BOOL_OPTION("Build static library" PHYSFS_BUILD_STATIC)
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   613
MESSAGE_BOOL_OPTION("Build shared library" PHYSFS_BUILD_SHARED)
1030
17c521170ba6 Hooked up Perl bindings, via SWIG.
Ryan C. Gordon <icculus@icculus.org>
parents: 1015
diff changeset
   614
MESSAGE_BOOL_OPTION("Build Perl bindings" PHYSFS_BUILD_PERL)
1032
ea6aaadcfa04 Initial work on Ruby bindings, barely started.
Ryan C. Gordon <icculus@icculus.org>
parents: 1031
diff changeset
   615
MESSAGE_BOOL_OPTION("Build Ruby bindings" PHYSFS_BUILD_RUBY)
878
6d65c5e0049a Added initial work on a wxWidgets-based test app.
Ryan C. Gordon <icculus@icculus.org>
parents: 847
diff changeset
   616
MESSAGE_BOOL_OPTION("Build stdio test program" PHYSFS_BUILD_TEST)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   617
IF(PHYSFS_BUILD_TEST)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   618
    MESSAGE_BOOL_OPTION("  Use readline in test program" HAVE_SYSTEM_READLINE)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   619
ENDIF(PHYSFS_BUILD_TEST)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   620
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   621
# end of CMakeLists.txt ...
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   622