misc/libphyslayer/CMakeLists.txt
author koda
Fri, 06 Dec 2013 00:02:10 +0100
branchsdl2transition
changeset 9703 966d180184b4
parent 9679 dfaa39674e1e
child 11362 ed5a6478e710
permissions -rw-r--r--
use NOSDL2 for consistency
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
9703
966d180184b4 use NOSDL2 for consistency
koda
parents: 9679
diff changeset
     2
if(${NOSDL2})
9677
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})
9703
966d180184b4 use NOSDL2 for consistency
koda
parents: 9679
diff changeset
     5
else(${NOSDL2})
9677
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})
9703
966d180184b4 use NOSDL2 for consistency
koda
parents: 9679
diff changeset
     9
endif(${NOSDL2})
9677
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