0003-CMakeLists.patch (2686B)
1 diff --git a/CMakeLists.txt b/CMakeLists.txt 2 new file mode 100644 3 index 0000000..a95f3d3 4 --- /dev/null 5 +++ b/CMakeLists.txt 6 @@ -0,0 +1,108 @@ 7 +cmake_minimum_required(VERSION 3.19.0 ) 8 + 9 +project(onscripter LANGUAGES C CXX) 10 + 11 +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) 12 + 13 +set(HEADERS 14 + BaseReader.h 15 + ButtonLink.h 16 + DirectReader.h 17 + SarReader.h 18 + NsaReader.h 19 + ScriptHandler.h 20 + ScriptParser.h 21 + AnimationInfo.h 22 + FontInfo.h 23 + DirtyRect.h 24 + LUAHandler.h 25 + Encoding.h 26 +) 27 + 28 +set(SOURCES 29 + AnimationInfo.cpp 30 + conv_shared.cpp 31 + DirectReader.cpp 32 + DirtyRect.cpp 33 + Encoding.cpp 34 + FontInfo.cpp 35 + LUAHandler.cpp 36 + NsaReader.cpp 37 + ONScripter_animation.cpp 38 + ONScripter_command.cpp 39 + ONScripter.cpp 40 + ONScripter_effect_breakup.cpp 41 + ONScripter_effect_cascade.cpp 42 + ONScripter_effect.cpp 43 + ONScripter_event.cpp 44 + ONScripter_file2.cpp 45 + ONScripter_file.cpp 46 + ONScripter_image.cpp 47 + ONScripter_lut.cpp 48 + ONScripter_rmenu.cpp 49 + ONScripter_sound.cpp 50 + ONScripter_text.cpp 51 + resize_image.cpp 52 + SarReader.cpp 53 + ScriptHandler.cpp 54 + ScriptParser_command.cpp 55 + ScriptParser.cpp 56 + sjis2utf16.cpp 57 +) 58 + 59 +find_package(SDL REQUIRED) 60 +find_package(SDL_sound REQUIRED) 61 +find_package(SDL_mixer REQUIRED) 62 +find_package(SDL_image REQUIRED) 63 +find_package(SDL_ttf REQUIRED) 64 +find_package(Lua51 REQUIRED) 65 +find_package(BZip2 REQUIRED) 66 +find_package(Fontconfig REQUIRED) 67 +find_package(JPEG REQUIRED) 68 + 69 +# Find SMPEG 70 +find_library(SMPEG_LIBRARY 71 + NAMES smpeg SMPEG Smpeg SMpeg 72 + PATHS 73 + ENV SMPEGDIR 74 + ENV SDLSOUNDDIR 75 + ENV SDLDIR 76 + /opt 77 + PATH_SUFFIXES 78 + lib 79 +) 80 + 81 +add_compile_definitions(LINUX USE_SMPEG USE_FONTCONFIG USE_OGG_VORBIS USE_CDROM USE_LUA) 82 + 83 +set(ALL_LIBS 84 + SDL::SDL 85 + ${SDL_SOUND_LIBRARIES} 86 + ${SDL_IMAGE_LIBRARIES} 87 + ${SDL_MIXER_LIBRARIES} 88 + ${SDL_TTF_LIBRARIES} 89 + ${SMPEG_LIBRARY} 90 + ${LUA_LIBRARIES} 91 + ${BZIP2_LIBRARIES} 92 + Fontconfig::Fontconfig 93 + ${JPEG_LIBRARIES} 94 +) 95 + 96 +add_executable(onscripter onscripter_main.cpp ${HEADERS} ${SOURCES}) 97 +target_link_libraries(onscripter ${ALL_LIBS}) 98 +install(TARGETS onscripter DESTINATION bin) 99 + 100 +add_executable(sardec sardec.cpp ${HEADERS} ${SOURCES}) 101 +target_link_libraries(sardec ${ALL_LIBS}) 102 +install(TARGETS sardec DESTINATION bin) 103 + 104 +add_executable(nsadec nsadec.cpp ${HEADERS} ${SOURCES}) 105 +target_link_libraries(nsadec ${ALL_LIBS}) 106 +install(TARGETS nsadec DESTINATION bin) 107 + 108 +add_executable(sarconv sarconv.cpp ${HEADERS} ${SOURCES}) 109 +target_link_libraries(sarconv ${ALL_LIBS}) 110 +install(TARGETS sarconv DESTINATION bin) 111 + 112 +add_executable(nsaconv nsaconv.cpp ${HEADERS} ${SOURCES}) 113 +target_link_libraries(nsaconv ${ALL_LIBS}) 114 +install(TARGETS nsaconv DESTINATION bin)