-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
73 lines (46 loc) · 2.16 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.10)
# Project setup
project(gctools)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if (MSVC)
add_compile_options(/W4 /WX)
else()
add_compile_options(-Wall -Wextra -Werror -Wno-strict-aliasing)
endif()
set(LOCAL_INCLUDE_DIR "/usr/local/include")
set(LOCAL_LIB_DIR "/usr/local/lib")
list(APPEND CMAKE_PREFIX_PATH ${LOCAL_LIB_DIR})
include_directories(${LOCAL_INCLUDE_DIR})
link_directories(${LOCAL_LIB_DIR})
find_package(phosg REQUIRED)
# Library definitions
add_library(prs src/prs/PRSDataLog.cc src/prs/PRS.cc src/prs/Yay0.cc src/prs/Yaz0.cc)
# Executable definitions
find_package(OpenAL REQUIRED)
set(SimpleExecutableNames afsdump gcmasm gcmdump gsldump gvmdump rcfdump)
set(AllExecutableNames ${SimpleExecutableNames} pae2gvm prsd smsdumpbanks smssynth modsynth)
foreach(ExecutableName IN ITEMS ${SimpleExecutableNames})
add_executable(${ExecutableName} src/${ExecutableName}.cc)
target_link_libraries(${ExecutableName} phosg)
endforeach()
add_executable(pae2gvm src/pae2gvm.cc)
target_link_libraries(pae2gvm phosg prs)
add_executable(prsd src/prs/main.cc)
target_link_libraries(prsd phosg prs)
add_executable(smsdumpbanks src/sms/smsdumpbanks.cc src/sms/aaf.cc src/sms/afc.cc src/sms/instrument.cc)
target_include_directories(smsdumpbanks PUBLIC ${OPENAL_INCLUDE_DIR})
target_link_libraries(smsdumpbanks phosg phosg-audio ${OPENAL_LIBRARY})
add_executable(smssynth src/sms/smssynth.cc src/sms/SampleCache.cc src/sms/aaf.cc src/sms/afc.cc src/sms/instrument.cc)
target_include_directories(smssynth PUBLIC ${OPENAL_INCLUDE_DIR})
target_link_libraries(smssynth phosg phosg-audio samplerate ${OPENAL_LIBRARY})
add_executable(modsynth src/sms/modsynth.cc src/sms/SampleCache.cc)
target_include_directories(modsynth PUBLIC ${OPENAL_INCLUDE_DIR})
target_link_libraries(modsynth phosg phosg-audio samplerate ${OPENAL_LIBRARY})
# Installation configuration
foreach(ExecutableName IN ITEMS ${AllExecutableNames})
install(TARGETS ${ExecutableName} DESTINATION bin)
endforeach()
file(GLOB PRSHeaders ${CMAKE_SOURCE_DIR}/src/prs/*.hh)
install(TARGETS prs DESTINATION lib)
install(FILES ${PRSHeaders} DESTINATION include/prs)