-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
cmake_minimum_required(VERSION 3.20) | ||
project(libsmacker C) | ||
|
||
option(LIBSMACKER_BUILD_TOOLS "Build smk2avi and driver executables" OFF) | ||
|
||
add_library(libsmacker smacker.c) | ||
|
||
if(WIN32 AND BUILD_SHARED_LIBS) | ||
target_sources(libsmacker PRIVATE smacker.def) | ||
endif() | ||
|
||
if(MSVC) | ||
target_compile_definitions(libsmacker PRIVATE -D_CRT_SECURE_NO_WARNINGS) | ||
endif() | ||
|
||
target_include_directories(libsmacker PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include>) | ||
set_target_properties(libsmacker PROPERTIES PUBLIC_HEADER "smacker.h") | ||
|
||
install(TARGETS libsmacker | ||
EXPORT libsmackerTargets | ||
PUBLIC_HEADER DESTINATION include | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib | ||
) | ||
|
||
install(EXPORT libsmackerTargets | ||
FILE unofficial-libsmacker-donfig.cmake | ||
NAMESPACE unofficial::libsmacker:: | ||
DESTINATION share/unofficial-libsmacker | ||
) | ||
|
||
if(LIBSMACKER_BUILD_TOOLS) | ||
add_executable(driver driver.c) | ||
target_include_directories(driver PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") | ||
target_link_libraries(driver libsmacker) | ||
install(TARGETS driver RUNTIME DESTINATION bin) | ||
|
||
add_executable(smk2avi smk2avi.c) | ||
target_include_directories(driver PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") | ||
target_link_libraries(smk2avi libsmacker) | ||
install(TARGETS smk2avi RUNTIME DESTINATION bin) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
vcpkg_from_sourceforge( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO libsmacker | ||
REF libsmacker-1.2 | ||
FILENAME "libsmacker-1.2.0r43.tar.gz" | ||
SHA512 1785b000884a6f93b621c1503adef100ac9b8c6e7ed5ef4d85b9ea4819715c40f9af3d930490b33ca079f531103acc69de2a800756ed7678c820ff155f86aaeb | ||
) | ||
|
||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/smacker.def" DESTINATION "${SOURCE_PATH}") | ||
|
||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
tools LIBSMACKER_BUILD_TOOLS | ||
) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
${FEATURE_OPTIONS} | ||
OPTIONS_DEBUG | ||
-DLIBSMACKER_BUILD_TOOLS=OFF | ||
) | ||
|
||
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libsmacker) | ||
vcpkg_copy_pdbs() | ||
|
||
file(REMOVE_RECURSE | ||
"${CURRENT_PACKAGES_DIR}/debug/share" | ||
"${CURRENT_PACKAGES_DIR}/debug/include" | ||
) | ||
|
||
if("tools" IN_LIST FEATURES) | ||
vcpkg_copy_tools(TOOL_NAMES driver smk2avi AUTO_CLEAN) | ||
endif() | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
LIBRARY libsmacker | ||
EXPORTS | ||
smk_open_file | ||
smk_open_filepointer | ||
smk_open_memory | ||
smk_close | ||
smk_info_all | ||
smk_info_video | ||
smk_info_audio | ||
smk_enable_all | ||
smk_enable_video | ||
smk_enable_audio | ||
smk_get_palette | ||
smk_get_video | ||
smk_get_audio | ||
smk_get_audio_size | ||
smk_first | ||
smk_next | ||
smk_seek_keyframe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "libsmacker", | ||
"version": "1.2.0", | ||
"description": "libsmacker is a cross-platform C library which can be used for decoding Smacker Video files produced by RAD Game Tools", | ||
"homepage": "https://libsmacker.sourceforge.net", | ||
"license": "LGPL-2.1-or-later", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"features": { | ||
"tools": { | ||
"description": "Build driver (dump tool) and smk2avi" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "0212e157d899076fb465f2e4664ab09420f7a907", | ||
"version": "1.2.0", | ||
"port-version": 0 | ||
} | ||
] | ||
} |