misc/libphyslayer/CMakeLists.txt
author sheepluva
Fri, 06 Dec 2013 23:53:35 +0100
changeset 9760 395ca7fe6362
parent 9650 1c7c87ce37fd
child 9677 71626318f80e
child 9950 2759212a27de
child 9991 3858d99476f5
permissions -rw-r--r--
It seems that at the current state it is necessary to protect sending stats/ending game from multiple execution, as that can happen if you e.g. fail a mission more than once in the same tick (e.g. destroying two essential crates at the same time) Otherwise you can get a blank / stuck frontend (e.g. when using deagle to shoot the two last crates at the same time)! the best approach might be to never call the function that sends stats and ends game from any event handler directly, but instead have a flag 'isFailed' that is set to true when any of the possible fails happen and to check that flag every tick to send stats and end game if true
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
9650
1c7c87ce37fd add possibility to compile with SDL2 automatically
koda
parents: 9225
diff changeset
     2
find_package(SDL1or2)
8526
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
     3
include_directories(${PHYSFS_INCLUDE_DIR})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
     4
include_directories(${SDL_INCLUDE_DIR})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
     5
include_directories(${LUA_INCLUDE_DIR})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
     6
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
     7
## extra functions needed by Hedgewars
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
     8
## 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
     9
set(PHYSLAYER_SRCS
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    10
    physfsrwops.c
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    11
    physfslualoader.c
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    12
    hwpacksmounter.c
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
9202
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    15
#compiles and links actual library
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    16
add_library (physlayer ${PHYSLAYER_SRCS})
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    17
#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
    18
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
    19
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
    20
                          LIBRARY DESTINATION ${target_library_install_dir}
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    21
                          ARCHIVE DESTINATION ${target_library_install_dir})
4d69569baabb also physlayer can be comiled as static or shared now
koda
parents: 8526
diff changeset
    22
get_target_property(physlayer_fullpath physlayer LOCATION)
8526
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    23
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    24
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    25
## 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
    26
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
    27
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
    28