author | sheepluva |
Wed, 11 Nov 2015 21:59:06 +0100 | |
branch | sdl2transition |
changeset 11367 | a91c4c4fd85c |
parent 11362 | ed5a6478e710 |
child 11374 | 28c309f45269 |
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 |
||
9270 | 14 |
|
8526 | 15 |
set(PHYSLAYER_SRCS |
9991 | 16 |
physfscompat.c |
8526 | 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 |