author | alfadur |
Sat, 08 Apr 2023 01:23:47 +0300 | |
changeset 15946 | 69479ac8f4c8 |
parent 15738 | 027a56b3895e |
permissions | -rw-r--r-- |
15555
107170c05bac
Add patch to correctly handle libsdl2 from system/cmake
LocutusOfBorg
parents:
12124
diff
changeset
|
1 |
find_package(SDL2 REQUIRED CONFIG) |
8526 | 2 |
|
15555
107170c05bac
Add patch to correctly handle libsdl2 from system/cmake
LocutusOfBorg
parents:
12124
diff
changeset
|
3 |
include_directories(${SDL2_INCLUDE_DIRS}) |
8526 | 4 |
include_directories(${PHYSFS_INCLUDE_DIR}) |
5 |
include_directories(${LUA_INCLUDE_DIR}) |
|
6 |
||
9270 | 7 |
|
8526 | 8 |
set(PHYSLAYER_SRCS |
9991 | 9 |
physfscompat.c |
8526 | 10 |
physfsrwops.c |
11 |
physfslualoader.c |
|
12 |
hwpacksmounter.c |
|
13 |
) |
|
14 |
||
9202
4d69569baabb
also physlayer can be comiled as static or shared now
koda
parents:
8526
diff
changeset
|
15 |
#compiles and links actual library |
4d69569baabb
also physlayer can be comiled as static or shared now
koda
parents:
8526
diff
changeset
|
16 |
add_library (physlayer ${PHYSLAYER_SRCS}) |
12124 | 17 |
set_target_properties(physlayer PROPERTIES |
18 |
VERSION 1.0 |
|
19 |
SOVERSION 1.0) |
|
15738 | 20 |
if(WIN32 AND VCPKG_TOOLCHAIN) |
21 |
target_link_libraries(physlayer SDL2::SDL2 lua physfs) |
|
22 |
else() |
|
23 |
target_link_libraries(physlayer ${SDL2_LIBRARIES} lua physfs) |
|
24 |
endif() |
|
9202
4d69569baabb
also physlayer can be comiled as static or shared now
koda
parents:
8526
diff
changeset
|
25 |
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
|
26 |
LIBRARY DESTINATION ${target_library_install_dir} |
4d69569baabb
also physlayer can be comiled as static or shared now
koda
parents:
8526
diff
changeset
|
27 |
ARCHIVE DESTINATION ${target_library_install_dir}) |
4d69569baabb
also physlayer can be comiled as static or shared now
koda
parents:
8526
diff
changeset
|
28 |
get_target_property(physlayer_fullpath physlayer LOCATION) |
8526 | 29 |
|
30 |
||
31 |
## 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
|
32 |
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
|
33 |
set(PHYSLAYER_LIBRARY ${physlayer_fullpath} CACHE STRING "Physlayer library" FORCE) |
8526 | 34 |
|
11659
71bdf987e41f
Fully support emscripten toolchain in our build system
koda
parents:
11374
diff
changeset
|
35 |
if(BUILD_ENGINE_JS) |
71bdf987e41f
Fully support emscripten toolchain in our build system
koda
parents:
11374
diff
changeset
|
36 |
set_target_properties(physlayer PROPERTIES SUFFIX ".bc") |
71bdf987e41f
Fully support emscripten toolchain in our build system
koda
parents:
11374
diff
changeset
|
37 |
endif() |
71bdf987e41f
Fully support emscripten toolchain in our build system
koda
parents:
11374
diff
changeset
|
38 |