author | koda |
Tue, 05 Nov 2013 23:33:23 +0100 | |
branch | sdl2transition |
changeset 9679 | dfaa39674e1e |
parent 9677 | 71626318f80e |
child 9703 | 966d180184b4 |
permissions | -rw-r--r-- |
8526 | 1 |
|
9677 | 2 |
if(${USESDL12}) |
3 |
find_package(SDL REQUIRED) |
|
4 |
include_directories(${SDL_INCLUDE_DIR}) |
|
5 |
else(${USESDL12}) |
|
6 |
find_package(SDL2 REQUIRED) |
|
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}) |
9677 | 9 |
endif(${USESDL12}) |
10 |
||
8526 | 11 |
include_directories(${PHYSFS_INCLUDE_DIR}) |
12 |
include_directories(${LUA_INCLUDE_DIR}) |
|
13 |
||
14 |
## extra functions needed by Hedgewars |
|
15 |
## TODO: maybe it's better to have them in a separate library? |
|
16 |
set(PHYSLAYER_SRCS |
|
17 |
physfsrwops.c |
|
18 |
physfslualoader.c |
|
19 |
hwpacksmounter.c |
|
20 |
) |
|
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 | 30 |
|
31 |
||
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 | 35 |