]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | cmake_minimum_required(VERSION 2.6) |
2 | project(SMPEG2 CXX) | |
3 | ||
4 | find_path(SDL_INCLUDE_DIR SDL2/SDL.h) | |
5 | find_package(SDL2 CONFIG REQUIRED) | |
6 | ||
7 | include_directories(${SDL_INCLUDE_DIR}) | |
8 | include_directories(${SDL_INCLUDE_DIR}/SDL2) | |
9 | include_directories(${CMAKE_SOURCE_DIR}) | |
10 | ||
11 | if(MSVC) | |
12 | add_definitions(-D_CRT_SECURE_NO_WARNINGS) | |
13 | endif() | |
14 | add_definitions(-DNOCONTROLS -DTHREADED_AUDIO) | |
15 | ||
16 | # some c++ code just assumes memset is available | |
17 | file(WRITE ${CMAKE_SOURCE_DIR}/declare_memset.h "#include <string.h>\n") | |
18 | add_definitions(-FIdeclare_memset.h) | |
19 | ||
20 | add_library(smpeg2 | |
21 | audio/bitwindow.cpp | |
22 | audio/filter.cpp | |
23 | audio/filter_2.cpp | |
24 | audio/hufftable.cpp | |
25 | audio/mpeglayer1.cpp | |
26 | audio/mpeglayer2.cpp | |
27 | audio/mpeglayer3.cpp | |
28 | audio/mpegtable.cpp | |
29 | audio/mpegtoraw.cpp | |
30 | audio/MPEGaudio.cpp | |
31 | video/decoders.cpp | |
32 | video/floatdct.cpp | |
33 | video/gdith.cpp | |
34 | video/jrevdct.cpp | |
35 | video/motionvec.cpp | |
36 | video/parseblock.cpp | |
37 | video/readfile.cpp | |
38 | video/util.cpp | |
39 | video/video.cpp | |
40 | video/MPEGvideo.cpp | |
41 | MPEG.cpp | |
42 | MPEGlist.cpp | |
43 | MPEGring.cpp | |
44 | MPEGstream.cpp | |
45 | MPEGsystem.cpp | |
46 | smpeg.cpp) | |
47 | ||
48 | set_target_properties(smpeg2 PROPERTIES DEFINE_SYMBOL DLL_EXPORT) | |
49 | if(BUILD_SHARED_LIBS) | |
50 | target_link_libraries(smpeg2 SDL2::SDL2) | |
51 | else() | |
52 | target_link_libraries(smpeg2 SDL2::SDL2-static) | |
53 | endif() | |
54 | ||
55 | install(TARGETS smpeg2 | |
56 | RUNTIME DESTINATION bin | |
57 | ARCHIVE DESTINATION lib | |
58 | LIBRARY DESTINATION lib) | |
59 | ||
60 | if(NOT DEFINED SMPEG_SKIP_HEADERS) | |
61 | install(FILES smpeg.h MPEGframe.h DESTINATION include) | |
62 | endif() | |
63 | ||
64 | message(STATUS "Link-time dependencies:") | |
65 | message(STATUS " " ${SDL_LIBRARY}) |