-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
59 lines (47 loc) · 1.33 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
cmake_minimum_required(VERSION 3.5)
project(EmuEngine)
# Build options
option(USE_EXTERNAL_JSON "Use an external JSON library" OFF)
# Please make use of your brain if you have one, don't be me
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-operator-names")
# Add external libraries
add_subdirectory("./external")
# Add currently implemented emulators
add_subdirectory("./emulators")
# Add main engine stuff
add_subdirectory("./menus")
add_subdirectory("./gui")
# Add main executable files
add_executable(
EmuEngine
"main.cpp"
"state.cpp"
"window.cpp"
"audio.cpp"
"gamepad.cpp"
)
# SDL2 stuff
find_package(SDL2 CONFIG REQUIRED)
find_package(sdl2-ttf CONFIG REQUIRED)
# Dynarec stuff
find_package(xbyak CONFIG REQUIRED)
# Include directories
target_include_directories(EmuEngine PUBLIC ${SDL2_INCLUDE_DIR})
# Link external libraries
target_link_libraries(
EmuEngine
PRIVATE
Menus GUI
CHIP8 Gameboy Bytepusher
nlohmann_json::nlohmann_json
xbyak::xbyak
SDL2::SDL2
SDL2::SDL2main
SDL2::SDL2_ttf
)
# Copy the data directory to the build path
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/data/)
add_custom_command(TARGET EmuEngine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/data/ $<TARGET_FILE_DIR:EmuEngine>/data/)
endif()