CMakeLists.txt
author Ryan C. Gordon <icculus@icculus.org>
Sat, 22 Jul 2017 12:55:50 -0400
changeset 1505 d06a6a0454a0
parent 1467 75091b2a2a94
child 1506 c9d568ce4ed1
permissions -rw-r--r--
Add platform_os2.c to the CMake file.
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
#
809
116b8fe30371 Renamed LICENSE to LICENSE.txt
Ryan C. Gordon <icculus@icculus.org>
parents: 805
diff changeset
     3
# 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
     4
1440
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
     5
# The CMake project file is meant to get this compiling on all sorts of
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
     6
#  platforms quickly, and serve as the way Unix platforms and Linux distros
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
     7
#  package up official builds, but you don't _need_ to use this; we have
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
     8
#  built PhysicsFS to (hopefully) be able to drop into your project and
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
     9
#  compile, using preprocessor checks for platform-specific bits instead of
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    10
#  testing in here.
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    11
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    12
cmake_minimum_required(VERSION 2.8.4)
804
45c29325e017 Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents: 803
diff changeset
    13
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    14
project(PhysicsFS)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    15
set(PHYSFS_VERSION 2.1.0)
950
7bb0b0d26479 Corrected soname.
Ryan C. Gordon <icculus@icculus.org>
parents: 919
diff changeset
    16
7bb0b0d26479 Corrected soname.
Ryan C. Gordon <icculus@icculus.org>
parents: 919
diff changeset
    17
# Increment this if/when we break backwards compatibility.
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    18
set(PHYSFS_SOVERSION 1)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
# I hate that they define "WIN32" ... we're about to move to Win64...I hope!
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    21
if(WIN32 AND NOT WINDOWS)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    22
    set(WINDOWS TRUE)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    23
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    25
include_directories(./src)
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
1440
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    27
if(APPLE)
1449
6df9e1a43f7c Cleaned up what symbols are exported from the library.
Ryan C. Gordon <icculus@icculus.org>
parents: 1447
diff changeset
    28
    set(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework CoreFoundation -framework IOKit")
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    29
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    31
if(CMAKE_COMPILER_IS_GNUCC)
1040
5fc90d008821 Prevent bogus addition of -rpath to libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 1039
diff changeset
    32
    # Don't use -rpath.
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    33
    set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    34
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    36
if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    37
    add_definitions(-erroff=E_EMPTY_TRANSLATION_UNIT)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    38
    add_definitions(-xldscope=hidden)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    39
endif()
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
    40
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
1443
0e74405d587f Removed BeOS support (Haiku still supported, though!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1440
diff changeset
    42
if(HAIKU)
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
    43
    # We add this explicitly, since we don't want CMake to think this
1443
0e74405d587f Removed BeOS support (Haiku still supported, though!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1440
diff changeset
    44
    #  is a C++ project unless we're on Haiku.
0e74405d587f Removed BeOS support (Haiku still supported, though!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1440
diff changeset
    45
    set(PHYSFS_HAIKU_SRCS src/platform_beos.cpp)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    46
    find_library(BE_LIBRARY be)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    47
    find_library(ROOT_LIBRARY root)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    48
    set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    49
endif()
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
    50
1440
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    51
if(UNIX AND NOT WINDOWS AND NOT APPLE)  # (MingW and such might be UNIX _and_ WINDOWS!)
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    52
    find_library(PTHREAD_LIBRARY pthread)
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    53
    if(PTHREAD_LIBRARY)
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    54
        set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${PTHREAD_LIBRARY})
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    55
    endif()
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    56
endif()
874043e29d55 Simplify CMakeLists.txt, etc.
Ryan C. Gordon <icculus@icculus.org>
parents: 1438
diff changeset
    57
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
    58
# 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
    59
#  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
    60
#  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
    61
#  code and #define the things you want.
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    62
set(PHYSFS_SRCS
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    63
    src/physfs.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    64
    src/physfs_byteorder.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    65
    src/physfs_unicode.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    66
    src/platform_posix.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    67
    src/platform_unix.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    68
    src/platform_macosx.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    69
    src/platform_windows.c
1505
d06a6a0454a0 Add platform_os2.c to the CMake file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1467
diff changeset
    70
    src/platform_os2.c
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    71
    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
    72
    src/archiver_unpacked.c
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    73
    src/archiver_grp.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    74
    src/archiver_hog.c
1467
75091b2a2a94 Rewrote the 7zip archiver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1450
diff changeset
    75
    src/archiver_7z.c
972
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    76
    src/archiver_mvl.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    77
    src/archiver_qpak.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    78
    src/archiver_wad.c
254427fc42ab Moved directory structure around.
Ryan C. Gordon <icculus@icculus.org>
parents: 956
diff changeset
    79
    src/archiver_zip.c
1315
c686e4f84ab5 SLB archiver
Aleksi Nurmi <aleksi.nurmi@gmail.com>
parents: 1311
diff changeset
    80
    src/archiver_slb.c
1064
cc4db73e87d1 ISO9660 archiver, compliments of Christoph Nelles.
Ryan C. Gordon <icculus@icculus.org>
parents: 1051
diff changeset
    81
    src/archiver_iso9660.c
1391
06aa5aca8518 Add support for VDF
Francesco Bertolaccini <bertolaccinifrancesco@gmail.com>
parents: 1338
diff changeset
    82
    src/archiver_vdf.c
1443
0e74405d587f Removed BeOS support (Haiku still supported, though!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1440
diff changeset
    83
    ${PHYSFS_HAIKU_SRCS}
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
)
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    85
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    86
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
# Archivers ...
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
    88
# These are (mostly) on by default now, so these options are only useful for
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
    89
#  disabling them.
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    90
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    91
option(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
    92
if(NOT PHYSFS_ARCHIVE_ZIP)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
    93
    add_definitions(-DPHYSFS_SUPPORTS_ZIP=0)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    94
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    96
option(PHYSFS_ARCHIVE_7Z "Enable 7zip support" TRUE)
1467
75091b2a2a94 Rewrote the 7zip archiver.
Ryan C. Gordon <icculus@icculus.org>
parents: 1450
diff changeset
    97
if(NOT PHYSFS_ARCHIVE_7Z)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
    98
    add_definitions(-DPHYSFS_SUPPORTS_7Z=0)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
    99
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   101
option(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   102
if(NOT PHYSFS_ARCHIVE_GRP)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   103
    add_definitions(-DPHYSFS_SUPPORTS_GRP=0)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   104
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   106
option(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   107
if(NOT PHYSFS_ARCHIVE_WAD)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   108
    add_definitions(-DPHYSFS_SUPPORTS_WAD=0)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   109
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   111
option(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   112
if(NOT PHYSFS_ARCHIVE_HOG)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   113
    add_definitions(-DPHYSFS_SUPPORTS_HOG=0)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   114
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   116
option(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   117
if(NOT PHYSFS_ARCHIVE_MVL)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   118
    add_definitions(-DPHYSFS_SUPPORTS_MVL=0)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   119
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   121
option(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   122
if(NOT PHYSFS_ARCHIVE_QPAK)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   123
    add_definitions(-DPHYSFS_SUPPORTS_QPAK=0)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   124
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
1315
c686e4f84ab5 SLB archiver
Aleksi Nurmi <aleksi.nurmi@gmail.com>
parents: 1311
diff changeset
   126
option(PHYSFS_ARCHIVE_SLB "Enable I-War / Independence War SLB support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   127
if(NOT PHYSFS_ARCHIVE_SLB)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   128
    add_definitions(-DPHYSFS_SUPPORTS_SLB=0)
1315
c686e4f84ab5 SLB archiver
Aleksi Nurmi <aleksi.nurmi@gmail.com>
parents: 1311
diff changeset
   129
endif()
c686e4f84ab5 SLB archiver
Aleksi Nurmi <aleksi.nurmi@gmail.com>
parents: 1311
diff changeset
   130
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   131
option(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   132
if(NOT PHYSFS_ARCHIVE_ISO9660)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   133
    add_definitions(-DPHYSFS_SUPPORTS_ISO9660=0)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   134
endif()
1066
e1d83e3b5d32 Make ISO9660 archiver optional.
Ryan C. Gordon <icculus@icculus.org>
parents: 1064
diff changeset
   135
1391
06aa5aca8518 Add support for VDF
Francesco Bertolaccini <bertolaccinifrancesco@gmail.com>
parents: 1338
diff changeset
   136
option(PHYSFS_ARCHIVE_VDF "Enable Gothic I/II VDF archive support" TRUE)
1438
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   137
if(NOT PHYSFS_ARCHIVE_VDF)
73b219f512c0 The archiver options in the CMake file should disable, not enable.
Ryan C. Gordon <icculus@icculus.org>
parents: 1437
diff changeset
   138
    add_definitions(-DPHYSFS_SUPPORTS_VDF=0)
1391
06aa5aca8518 Add support for VDF
Francesco Bertolaccini <bertolaccinifrancesco@gmail.com>
parents: 1338
diff changeset
   139
endif()
06aa5aca8518 Add support for VDF
Francesco Bertolaccini <bertolaccinifrancesco@gmail.com>
parents: 1338
diff changeset
   140
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   141
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   142
option(PHYSFS_BUILD_STATIC "Build static library" TRUE)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   143
if(PHYSFS_BUILD_STATIC)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   144
    add_library(physfs-static STATIC ${PHYSFS_SRCS})
1436
c18e307b5fc3 Don't rename the static library on Windows.
Ryan C. Gordon <icculus@icculus.org>
parents: 1435
diff changeset
   145
    # Don't rename this on Windows, since DLLs will also produce an import
c18e307b5fc3 Don't rename the static library on Windows.
Ryan C. Gordon <icculus@icculus.org>
parents: 1435
diff changeset
   146
    #  library named "physfs.lib" which would conflict; Unix tend to like the
c18e307b5fc3 Don't rename the static library on Windows.
Ryan C. Gordon <icculus@icculus.org>
parents: 1435
diff changeset
   147
    #  same library name with a different extension for static libs, but
c18e307b5fc3 Don't rename the static library on Windows.
Ryan C. Gordon <icculus@icculus.org>
parents: 1435
diff changeset
   148
    #  Windows can just have a separate name.
c18e307b5fc3 Don't rename the static library on Windows.
Ryan C. Gordon <icculus@icculus.org>
parents: 1435
diff changeset
   149
    if(NOT WINDOWS)
c18e307b5fc3 Don't rename the static library on Windows.
Ryan C. Gordon <icculus@icculus.org>
parents: 1435
diff changeset
   150
        set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs")
c18e307b5fc3 Don't rename the static library on Windows.
Ryan C. Gordon <icculus@icculus.org>
parents: 1435
diff changeset
   151
    endif()
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   152
    set(PHYSFS_LIB_TARGET physfs-static)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   153
    set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   154
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   156
option(PHYSFS_BUILD_SHARED "Build shared library" TRUE)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   157
if(PHYSFS_BUILD_SHARED)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   158
    add_library(physfs SHARED ${PHYSFS_SRCS})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   159
    set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   160
    set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   161
    target_link_libraries(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   162
    set(PHYSFS_LIB_TARGET physfs)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   163
    set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   164
endif()
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   165
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   166
if(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   167
    message(FATAL "Both shared and static libraries are disabled!")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   168
endif()
802
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   169
d04103af68a5 Can now build shared or static (or both) libraries.
Ryan C. Gordon <icculus@icculus.org>
parents: 801
diff changeset
   170
# CMake FAQ says I need this...
1436
c18e307b5fc3 Don't rename the static library on Windows.
Ryan C. Gordon <icculus@icculus.org>
parents: 1435
diff changeset
   171
if(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC AND NOT WINDOWS)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   172
    set_target_properties(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   173
    set_target_properties(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   174
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   176
option(PHYSFS_BUILD_TEST "Build stdio test program." TRUE)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   177
mark_as_advanced(PHYSFS_BUILD_TEST)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   178
if(PHYSFS_BUILD_TEST)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   179
    find_path(READLINE_H readline/readline.h)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   180
    find_path(HISTORY_H readline/history.h)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   181
    if(READLINE_H AND HISTORY_H)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   182
        find_library(CURSES_LIBRARY NAMES curses ncurses)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   183
        set(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   184
        find_library(READLINE_LIBRARY readline)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   185
        if(READLINE_LIBRARY)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   186
            set(HAVE_SYSTEM_READLINE TRUE)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   187
            set(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   188
            include_directories(${READLINE_H} ${HISTORY_H})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   189
            add_definitions(-DPHYSFS_HAVE_READLINE=1)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   190
        endif()
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   191
    endif()
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   192
    add_executable(test_physfs test/test_physfs.c)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   193
    target_link_libraries(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   194
    set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   195
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   196
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   197
install(TARGETS ${PHYSFS_INSTALL_TARGETS}
804
45c29325e017 Added install targets for "make install"
Ryan C. Gordon <icculus@icculus.org>
parents: 803
diff changeset
   198
        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
   199
        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
   200
        ARCHIVE DESTINATION lib${LIB_SUFFIX})
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   201
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
   202
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   203
find_package(Doxygen)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   204
if(DOXYGEN_FOUND)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   205
    set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   206
    configure_file(
1153
5cbedebaa623 Corrected doc paths for development branch.
Ryan C. Gordon <icculus@icculus.org>
parents: 1152
diff changeset
   207
        "${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
   208
        "${PHYSFS_OUTPUT_DOXYFILE}"
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   209
        COPYONLY
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   210
    )
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   211
    file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   212
    file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = \"${PHYSFS_VERSION}\"\n")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   213
    file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = \"${CMAKE_CURRENT_BINARY_DIR}/docs\"\n")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   214
    file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n")
1151
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   215
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   216
    add_custom_target(
1151
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   217
        docs
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   218
        ${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}"
a9e1bbe6e8d6 Fixed "make docs" for out-of-tree builds.
Ryan C. Gordon <icculus@icculus.org>
parents: 1140
diff changeset
   219
        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
   220
        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
   221
    )
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   222
else()
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   223
    message(STATUS "Doxygen not found. You won't be able to build documentation.")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   224
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   225
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   226
if(UNIX)
1310
3382edc8a7f9 Use .tar.bz2 on this branch, too.
Ryan C. Gordon <icculus@icculus.org>
parents: 1309
diff changeset
   227
    set(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.bz2")
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   228
    add_custom_target(
1041
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   229
        dist
1310
3382edc8a7f9 Use .tar.bz2 on this branch, too.
Ryan C. Gordon <icculus@icculus.org>
parents: 1309
diff changeset
   230
        hg archive -t tbz2 "${PHYSFS_TARBALL}"
1042
dc9291957a5a Fixed "make dist" target.
Ryan C. Gordon <icculus@icculus.org>
parents: 1041
diff changeset
   231
        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
dc9291957a5a Fixed "make dist" target.
Ryan C. Gordon <icculus@icculus.org>
parents: 1041
diff changeset
   232
        COMMENT "Building source tarball '${PHYSFS_TARBALL}'..."
1041
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   233
    )
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   234
    add_custom_target(
1041
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   235
        uninstall
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   236
        "${CMAKE_CURRENT_SOURCE_DIR}/extras/uninstall.sh"
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   237
        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   238
        COMMENT "Uninstall the project..."
f7b7996e54f1 Added uninstall target for Unix platforms.
Ryan C. Gordon <icculus@icculus.org>
parents: 1040
diff changeset
   239
    )
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   240
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   241
1338
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   242
if(UNIX AND NOT APPLE)
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   243
    configure_file(
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   244
        "extras/physfs.pc.in"
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   245
        "extras/physfs.pc"
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   246
        @ONLY
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   247
    )
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   248
    install(
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   249
        FILES "${CMAKE_CURRENT_BINARY_DIR}/extras/physfs.pc"
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   250
        DESTINATION "lib/pkgconfig"
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   251
    )
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   252
endif()
aae614cdd005 Added pkg-config support (thanks, Jonas!).
Ryan C. Gordon <icculus@icculus.org>
parents: 1318
diff changeset
   253
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   254
macro(message_bool_option _NAME _VALUE)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   255
    if(${_VALUE})
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   256
        message(STATUS "  ${_NAME}: enabled")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   257
    else()
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   258
        message(STATUS "  ${_NAME}: disabled")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   259
    endif()
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   260
endmacro()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   261
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   262
message(STATUS "PhysicsFS will build with the following options:")
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   263
message_bool_option("ZIP support" PHYSFS_ARCHIVE_ZIP)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   264
message_bool_option("7zip support" PHYSFS_ARCHIVE_7Z)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   265
message_bool_option("GRP support" PHYSFS_ARCHIVE_GRP)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   266
message_bool_option("WAD support" PHYSFS_ARCHIVE_WAD)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   267
message_bool_option("HOG support" PHYSFS_ARCHIVE_HOG)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   268
message_bool_option("MVL support" PHYSFS_ARCHIVE_MVL)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   269
message_bool_option("QPAK support" PHYSFS_ARCHIVE_QPAK)
1315
c686e4f84ab5 SLB archiver
Aleksi Nurmi <aleksi.nurmi@gmail.com>
parents: 1311
diff changeset
   270
message_bool_option("SLB support" PHYSFS_ARCHIVE_SLB)
1435
27e8dfc42ecd Added some option information to the CMake output.
Ryan C. Gordon <icculus@icculus.org>
parents: 1434
diff changeset
   271
message_bool_option("VDF support" PHYSFS_ARCHIVE_VDF)
27e8dfc42ecd Added some option information to the CMake output.
Ryan C. Gordon <icculus@icculus.org>
parents: 1434
diff changeset
   272
message_bool_option("ISO9660 support" PHYSFS_ARCHIVE_ISO9660)
1309
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   273
message_bool_option("Build static library" PHYSFS_BUILD_STATIC)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   274
message_bool_option("Build shared library" PHYSFS_BUILD_SHARED)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   275
message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   276
if(PHYSFS_BUILD_TEST)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   277
    message_bool_option("  Use readline in test program" HAVE_SYSTEM_READLINE)
df0609b72174 Lowercased most of the CMake project file.
Ryan C. Gordon <icculus@icculus.org>
parents: 1297
diff changeset
   278
endif()
798
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   279
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   280
# end of CMakeLists.txt ...
18455baab480 Moved to CMake!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   281