misc/libphyslayer/CMakeLists.txt
author nemo
Sat, 11 May 2013 21:50:14 -0400
changeset 8978 e6ef8fe314bd
parent 8526 9f2bd885d773
child 9202 4d69569baabb
permissions -rw-r--r--
suggestion of unc0rr's to fix issue w/ random maps in campaign. load sidecar packages in physfs for lua. should be useful also for lua that does custom layouts
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