misc/libphyslayer/CMakeLists.txt
author koda
Tue, 05 Nov 2013 23:33:23 +0100
branchsdl2transition
changeset 9679 dfaa39674e1e
parent 9677 71626318f80e
child 9703 966d180184b4
permissions -rw-r--r--
some improvements for sdl2 building (not complete nor clean)
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})
9679
dfaa39674e1e some improvements for sdl2 building (not complete nor clean)
koda
parents: 9677
diff changeset
     8
    set(SDL_LIBRARY ${SDL2_LIBRARY})
9677
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
     9
endif(${USESDL12})
71626318f80e - Use USESDL12 for old SDL
unc0rr
parents: 9650
diff changeset
    10
8526
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    11
include_directories(${PHYSFS_INCLUDE_DIR})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    12
include_directories(${LUA_INCLUDE_DIR})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    13
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    14
## extra functions needed by Hedgewars
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    15
## 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
    16
set(PHYSLAYER_SRCS
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    17
    physfsrwops.c
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    18
    physfslualoader.c
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    19
    hwpacksmounter.c
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    20
)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    21
9202
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    22
#compiles and links actual library
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    23
add_library (physlayer ${PHYSLAYER_SRCS})
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    24
#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
    25
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
    26
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
    27
                          LIBRARY DESTINATION ${target_library_install_dir}
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    28
                          ARCHIVE DESTINATION ${target_library_install_dir})
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    29
get_target_property(physlayer_fullpath physlayer LOCATION)
8526
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
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    32
## 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
    33
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
    34
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
    35