diff options
Diffstat (limited to 'vcpkg/ports/libsmacker')
| -rw-r--r-- | vcpkg/ports/libsmacker/CMakeLists.txt | 43 | ||||
| -rw-r--r-- | vcpkg/ports/libsmacker/portfile.cmake | 38 | ||||
| -rw-r--r-- | vcpkg/ports/libsmacker/smacker.def | 19 | ||||
| -rw-r--r-- | vcpkg/ports/libsmacker/vcpkg.json | 22 |
4 files changed, 122 insertions, 0 deletions
diff --git a/vcpkg/ports/libsmacker/CMakeLists.txt b/vcpkg/ports/libsmacker/CMakeLists.txt new file mode 100644 index 0000000..08ba006 --- /dev/null +++ b/vcpkg/ports/libsmacker/CMakeLists.txt @@ -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-config.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()
diff --git a/vcpkg/ports/libsmacker/portfile.cmake b/vcpkg/ports/libsmacker/portfile.cmake new file mode 100644 index 0000000..07abaa8 --- /dev/null +++ b/vcpkg/ports/libsmacker/portfile.cmake @@ -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") diff --git a/vcpkg/ports/libsmacker/smacker.def b/vcpkg/ports/libsmacker/smacker.def new file mode 100644 index 0000000..6044797 --- /dev/null +++ b/vcpkg/ports/libsmacker/smacker.def @@ -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
diff --git a/vcpkg/ports/libsmacker/vcpkg.json b/vcpkg/ports/libsmacker/vcpkg.json new file mode 100644 index 0000000..6f9b689 --- /dev/null +++ b/vcpkg/ports/libsmacker/vcpkg.json @@ -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" + } + } +} |