File: FindPhysFS.cmake

package info (click to toggle)
colobot 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 415,532 kB
  • sloc: cpp: 129,246; ansic: 8,872; python: 2,158; sh: 672; awk: 91; xml: 35; makefile: 31
file content (44 lines) | stat: -rw-r--r-- 1,365 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# PHYSFS_FOUND
# PHYSFS_INCLUDE_PATH
# PHYSFS_LIBRARY
#

IF (WIN32)
    FIND_PATH( PHYSFS_INCLUDE_PATH physfs.h
                DOC "The directory where physfs.h resides")
    FIND_LIBRARY( PHYSFS_LIBRARY
                    NAMES physfs physfs-static
                    PATHS /mingw/lib
                    DOC "The PhysFS library")
ELSE (WIN32)
    FIND_PATH( PHYSFS_INCLUDE_PATH physfs.h
        /usr/include
        /usr/local/include
        /opt/local/include
        DOC "The directory where physfs.h resides")
    FIND_LIBRARY( PHYSFS_LIBRARY
        NAMES physfs
        PATHS
        /usr/lib64
        /usr/lib
        /usr/local/lib64
        /usr/local/lib
        /opt/local/lib
        DOC "The PhysFS library")
ENDIF (WIN32)

IF (PHYSFS_INCLUDE_PATH)
    SET( PHYSFS_FOUND 1 CACHE STRING "Set to 1 if PhysFS is found, 0 otherwise")
ELSE (GLEW_INCLUDE_PATH)
    SET( PHYSFS_FOUND 0 CACHE STRING "Set to 1 if PhysFS is found, 0 otherwise")
ENDIF (PHYSFS_INCLUDE_PATH)

MARK_AS_ADVANCED( PHYSFS_FOUND PHYSFS_INCLUDE_PATH PHYSFS_LIBRARY )

# Targets
if(PHYSFS_FOUND AND NOT TARGET PhysFS::PhysFS)
    add_library(PhysFS::PhysFS UNKNOWN IMPORTED)
    set_target_properties(PhysFS::PhysFS PROPERTIES
                          IMPORTED_LOCATION "${PHYSFS_LIBRARY}"
                          INTERFACE_INCLUDE_DIRECTORIES "${PHYSFS_INCLUDE_PATH}")
endif()