misc/libphyslayer/CMakeLists.txt
author sheepluva
Fri, 12 Apr 2013 21:41:55 +0200
branch0.9.19
changeset 8870 1f2d2406d535
parent 8526 9f2bd885d773
child 9202 4d69569baabb
permissions -rw-r--r--
remove bioshock3-reference on hedgehogs drowning (unlike its predecessors, it turned out to not take place underwater)
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
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
     2
find_package(SDL REQUIRED)
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
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    15
set(build_type STATIC)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    16
set(lib_prefix ${CMAKE_STATIC_LIBRARY_PREFIX})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    17
set(lib_suffix ${CMAKE_STATIC_LIBRARY_SUFFIX})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    18
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    19
if(WIN32)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    20
    set(build_type SHARED)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    21
    set(lib_prefix ${CMAKE_SHARED_LIBRARY_PREFIX})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    22
    set(lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    23
endif(WIN32)
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
#compiles and links actual library
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    26
add_library (physlayer ${build_type} ${PHYSLAYER_SRCS})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    27
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    28
if(WIN32)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    29
    target_link_libraries(physlayer ${SDL_LIBRARY} ${LUA_LIBRARY} ${PHYSFS_LIBRARY})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    30
    install(TARGETS physlayer RUNTIME DESTINATION ${target_library_install_dir})
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    31
endif()
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    32
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    33
## added standard variables (FORCE or cmake won't pick 'em)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    34
set(PHYSLAYER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/libphyslayer/ CACHE STRING "" FORCE)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    35
set(PHYSLAYER_LIBRARY ${LIBRARY_OUTPUT_PATH}/${lib_prefix}physlayer${lib_suffix} CACHE STRING "" FORCE)
9f2bd885d773 update cmake files to use the two libraries independently
koda
parents:
diff changeset
    36