equal
deleted
inserted
replaced
|
1 |
|
2 find_package(SDL REQUIRED) |
|
3 include_directories(${PHYSFS_INCLUDE_DIR}) |
|
4 include_directories(${SDL_INCLUDE_DIR}) |
|
5 include_directories(${LUA_INCLUDE_DIR}) |
|
6 |
|
7 ## extra functions needed by Hedgewars |
|
8 ## TODO: maybe it's better to have them in a separate library? |
|
9 set(PHYSLAYER_SRCS |
|
10 physfsrwops.c |
|
11 physfslualoader.c |
|
12 hwpacksmounter.c |
|
13 ) |
|
14 |
|
15 set(build_type STATIC) |
|
16 set(lib_prefix ${CMAKE_STATIC_LIBRARY_PREFIX}) |
|
17 set(lib_suffix ${CMAKE_STATIC_LIBRARY_SUFFIX}) |
|
18 |
|
19 if(WIN32) |
|
20 set(build_type SHARED) |
|
21 set(lib_prefix ${CMAKE_SHARED_LIBRARY_PREFIX}) |
|
22 set(lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}) |
|
23 endif(WIN32) |
|
24 |
|
25 #compiles and links actual library |
|
26 add_library (physlayer ${build_type} ${PHYSLAYER_SRCS}) |
|
27 |
|
28 if(WIN32) |
|
29 target_link_libraries(physlayer ${SDL_LIBRARY} ${LUA_LIBRARY} ${PHYSFS_LIBRARY}) |
|
30 install(TARGETS physlayer RUNTIME DESTINATION ${target_library_install_dir}) |
|
31 endif() |
|
32 |
|
33 ## added standard variables (FORCE or cmake won't pick 'em) |
|
34 set(PHYSLAYER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/libphyslayer/ CACHE STRING "" FORCE) |
|
35 set(PHYSLAYER_LIBRARY ${LIBRARY_OUTPUT_PATH}/${lib_prefix}physlayer${lib_suffix} CACHE STRING "" FORCE) |
|
36 |