diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/smpeg2/CMakeLists.txt | |
Diffstat (limited to 'vcpkg/ports/smpeg2/CMakeLists.txt')
| -rw-r--r-- | vcpkg/ports/smpeg2/CMakeLists.txt | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/vcpkg/ports/smpeg2/CMakeLists.txt b/vcpkg/ports/smpeg2/CMakeLists.txt new file mode 100644 index 0000000..bdbe2d5 --- /dev/null +++ b/vcpkg/ports/smpeg2/CMakeLists.txt @@ -0,0 +1,73 @@ +cmake_minimum_required(VERSION 3.25) +project(smpeg2 CXX) + +set(CMAKE_CXX_STANDARD 11) # 17 does not allow 'register' + +find_package(SDL2 CONFIG REQUIRED) + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + # some c++ code just assumes memset is available + add_definitions(-FIstring.h) +endif() +add_definitions(-DNOCONTROLS -DTHREADED_AUDIO) + +add_library(smpeg2 + audio/bitwindow.cpp + audio/filter.cpp + audio/filter_2.cpp + audio/hufftable.cpp + audio/mpeglayer1.cpp + audio/mpeglayer2.cpp + audio/mpeglayer3.cpp + audio/mpegtable.cpp + audio/mpegtoraw.cpp + audio/MPEGaudio.cpp + video/decoders.cpp + video/floatdct.cpp + video/gdith.cpp + video/jrevdct.cpp + video/motionvec.cpp + video/parseblock.cpp + video/readfile.cpp + video/util.cpp + video/video.cpp + video/MPEGvideo.cpp + MPEG.cpp + MPEGlist.cpp + MPEGring.cpp + MPEGstream.cpp + MPEGsystem.cpp + smpeg.cpp) + +if(WIN32 AND BUILD_SHARED_LIBS) + target_compile_definitions(smpeg2 PRIVATE -DDLL_EXPORT) +endif() + +target_include_directories(smpeg2 PUBLIC + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>" + $<INSTALL_INTERFACE:include> +) + + +if(TARGET SDL2::SDL2) + target_link_libraries(smpeg2 SDL2::SDL2) +else() + target_link_libraries(smpeg2 SDL2::SDL2-static) +endif() + +install(TARGETS smpeg2 + EXPORT smpeg2-targets + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + +install(EXPORT smpeg2-targets + FILE unofficial-smpeg2-config.cmake + NAMESPACE unofficial::smpeg2:: + DESTINATION share/unofficial-smpeg2 +) + +if(NOT SMPEG_SKIP_HEADERS) + install(FILES smpeg.h MPEGframe.h DESTINATION include) +endif() |