summarylogtreecommitdiffstats
path: root/CMakeLists.txt
blob: a95f3d3588f86a10fbb939a1dfcc42f0a92745b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
cmake_minimum_required(VERSION 3.19.0 )

project(onscripter LANGUAGES C CXX)

set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

set(HEADERS
	BaseReader.h
	ButtonLink.h
	DirectReader.h
	SarReader.h
	NsaReader.h
	ScriptHandler.h
	ScriptParser.h
	AnimationInfo.h
	FontInfo.h
	DirtyRect.h
	LUAHandler.h
	Encoding.h
)

set(SOURCES
	AnimationInfo.cpp
	conv_shared.cpp
	DirectReader.cpp
	DirtyRect.cpp
	Encoding.cpp
	FontInfo.cpp
	LUAHandler.cpp
	NsaReader.cpp
	ONScripter_animation.cpp
	ONScripter_command.cpp
	ONScripter.cpp
	ONScripter_effect_breakup.cpp
	ONScripter_effect_cascade.cpp
	ONScripter_effect.cpp
	ONScripter_event.cpp
	ONScripter_file2.cpp
	ONScripter_file.cpp
	ONScripter_image.cpp
	ONScripter_lut.cpp
	ONScripter_rmenu.cpp
	ONScripter_sound.cpp
	ONScripter_text.cpp
	resize_image.cpp
	SarReader.cpp
	ScriptHandler.cpp
	ScriptParser_command.cpp
	ScriptParser.cpp
	sjis2utf16.cpp
)

find_package(SDL REQUIRED)
find_package(SDL_sound REQUIRED)
find_package(SDL_mixer REQUIRED)
find_package(SDL_image REQUIRED)
find_package(SDL_ttf REQUIRED)
find_package(Lua51 REQUIRED)
find_package(BZip2 REQUIRED)
find_package(Fontconfig REQUIRED)
find_package(JPEG REQUIRED)

# Find SMPEG
find_library(SMPEG_LIBRARY
    NAMES smpeg SMPEG Smpeg SMpeg
    PATHS
      ENV SMPEGDIR
      ENV SDLSOUNDDIR
      ENV SDLDIR
      /opt
    PATH_SUFFIXES
      lib
)

add_compile_definitions(LINUX USE_SMPEG USE_FONTCONFIG USE_OGG_VORBIS USE_CDROM USE_LUA)

set(ALL_LIBS
	SDL::SDL
	${SDL_SOUND_LIBRARIES}
	${SDL_IMAGE_LIBRARIES}
	${SDL_MIXER_LIBRARIES}
	${SDL_TTF_LIBRARIES}
	${SMPEG_LIBRARY}
	${LUA_LIBRARIES}
	${BZIP2_LIBRARIES}
	Fontconfig::Fontconfig
	${JPEG_LIBRARIES}
)

add_executable(onscripter onscripter_main.cpp ${HEADERS} ${SOURCES})
target_link_libraries(onscripter ${ALL_LIBS})
install(TARGETS onscripter DESTINATION bin)

add_executable(sardec sardec.cpp ${HEADERS} ${SOURCES})
target_link_libraries(sardec ${ALL_LIBS})
install(TARGETS sardec DESTINATION bin)

add_executable(nsadec nsadec.cpp ${HEADERS} ${SOURCES})
target_link_libraries(nsadec ${ALL_LIBS})
install(TARGETS nsadec DESTINATION bin)

add_executable(sarconv sarconv.cpp ${HEADERS} ${SOURCES})
target_link_libraries(sarconv ${ALL_LIBS})
install(TARGETS sarconv DESTINATION bin)

add_executable(nsaconv nsaconv.cpp ${HEADERS} ${SOURCES})
target_link_libraries(nsaconv ${ALL_LIBS})
install(TARGETS nsaconv DESTINATION bin)