misc/libphyslayer/CMakeLists.txt
author unc0rr
Wed, 06 Nov 2013 00:59:33 +0400
branchsdl2transition
changeset 9677 71626318f80e
parent 9650 1c7c87ce37fd
child 9679 dfaa39674e1e
permissions -rw-r--r--
- Use USESDL12 for old SDL - Engine builds, frontend doesn't due to changes in API
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8526
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
     1
9677
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     2
if(${USESDL12})
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     3
    find_package(SDL REQUIRED)
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     4
    include_directories(${SDL_INCLUDE_DIR})
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     5
else(${USESDL12})
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     6
    find_package(SDL2 REQUIRED)
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     7
    include_directories(${SDL2_INCLUDE_DIR})
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     8
endif(${USESDL12})
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     9
8526
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    10
include_directories(${PHYSFS_INCLUDE_DIR})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    11
include_directories(${LUA_INCLUDE_DIR})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    12
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    13
## extra functions needed by Hedgewars
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    14
## TODO: maybe it's better to have them in a separate library?
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    15
set(PHYSLAYER_SRCS
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    16
    physfsrwops.c
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    17
    physfslualoader.c
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    18
    hwpacksmounter.c
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    19
)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    20
9202
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    21
#compiles and links actual library
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    22
add_library (physlayer ${PHYSLAYER_SRCS})
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    23
#TODO: find good VERSION and SOVERSION values
9225
d8d929f92633 use target name instead of the resulting library, use more macros around
koda
parents: 9202
diff changeset
    24
target_link_libraries(physlayer ${SDL_LIBRARY} lua physfs)
9202
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    25
install(TARGETS physlayer RUNTIME DESTINATION ${target_binary_install_dir}
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    26
                          LIBRARY DESTINATION ${target_library_install_dir}
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    27
                          ARCHIVE DESTINATION ${target_library_install_dir})
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    28
get_target_property(physlayer_fullpath physlayer LOCATION)
8526
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    29
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    30
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    31
## added standard variables (FORCE or cmake won't pick 'em)
9202
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    32
set(PHYSLAYER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Physlayer include dir" FORCE)
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    33
set(PHYSLAYER_LIBRARY ${physlayer_fullpath} CACHE STRING "Physlayer library" FORCE)
8526
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    34