-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathCMakeLists.txt
66 lines (47 loc) · 1.58 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
cmake_minimum_required(VERSION 3.5)
project(gbe_plus)
if (NOT MSVC)
add_definitions(-O3 -funroll-loops -Wno-error -Wno-narrowing -std=c++17)
endif()
if (MSVC AND WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE")
endif()
find_package(SDL2 REQUIRED)
option(LINK_CABLE "Enable link cable emulation (requires SDL2_net)" ON)
if (LINK_CABLE)
find_package(SDL2_net REQUIRED)
add_definitions(-DGBE_NETPLAY)
endif()
option(IMAGE_FORMATS "Enable image formats for screenshots and movies (requires SDL2_image)" OFF)
if (IMAGE_FORMATS)
find_package(SDL2_image REQUIRED)
add_definitions(-DGBE_IMAGE_FORMATS)
endif()
option(ADVANCED_DEBUG "Enable advanced debugging features (may affect performance)" OFF)
if (ADVANCED_DEBUG)
add_definitions(-DGBE_DEBUG)
endif()
option(USE_OGL "Enable OpenGL for drawing operations (requires OpenGL)" ON)
option(FAST_FETCH "Enables fast instruction fetching on the GBA without memory checks. Offers a small speedup, on by default. Required to be off for Campho Advance emulation." ON)
if (FAST_FETCH)
add_definitions(-DGBE_FAST_FETCH)
endif()
if (USE_OGL)
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
add_definitions(-DGBE_OGL)
endif()
if (WIN32 AND USE_OGL)
find_package(GLEW REQUIRED)
add_definitions(-DGBE_GLEW)
endif()
option(QT_GUI "Enable the Qt GUI" ON)
if(QT_GUI)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Gui REQUIRED)
set(GBE_QT_LIBS Qt5::Gui Qt5::Widgets Qt5::OpenGL)
endif()
add_subdirectory(src)
include(GNUInstallDirs)