author | koda |
Fri, 06 Dec 2013 00:45:32 +0100 | |
branch | sdl2transition |
changeset 9707 | c433e74da79b |
parent 9703 | 966d180184b4 |
child 11342 | ed5a6478e710 |
permissions | -rw-r--r-- |
8526 | 1 |
|
9703 | 2 |
if(${NOSDL2}) |
9677 | 3 |
find_package(SDL REQUIRED) |
4 |
include_directories(${SDL_INCLUDE_DIR}) |
|
9703 | 5 |
else(${NOSDL2}) |
9677 | 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}) |
9703 | 9 |
endif(${NOSDL2}) |
9677 | 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 |