Skip to content

Commit cc5d8e1

Browse files
Moved the event stuff in a seperate directory
1 parent 1143964 commit cc5d8e1

19 files changed

+36
-15
lines changed

CMakeLists.txt

+5-13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ add_definitions (-std=c++14 -O0)
44

55
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
66

7+
add_subdirectory (events)
8+
79
add_library (ObjSDL
810
color_names.cc color.cc color.hh # color_names provides the values for the named colors
911
cursor.cc cursor.hh
@@ -12,15 +14,8 @@ add_library (ObjSDL
1214
clipboard.cc clipboard.hh
1315
geometry.hh geometry.cc # header only
1416
version.cc version.hh
15-
event.cc event.hh
16-
window_event.cc window_event.hh
17-
keyboard_event.cc keyboard_event.hh
18-
mouse_event.cc mouse_event.hh
19-
joystick_event.cc joystick_event.hh
20-
controller_event.cc controller_event.hh
21-
touch_event.cc touch_event.hh
22-
various_events.cc various_events.hh
2317
audio.cc audio.hh
18+
keys.cc keys.hh
2419
)
2520

2621
include (cmake/FindSDL2.cmake)
@@ -29,14 +24,11 @@ find_package (Boost COMPONENTS system REQUIRED)
2924
find_package (SDL2 REQUIRED)
3025

3126
include_directories (${SDL2_INCLUDE_DIR})
27+
include_directories (${Boost_INCLUDE_DIRS})
3228

3329
link_directories (${Boost_LIBRARY_DIRS})
3430

35-
if (Boost_FOUND)
36-
include_directories (${Boost_INCLUDE_DIRS})
37-
target_link_libraries (ObjSDL ${Boost_SYSTEM_LIBRARY})
38-
endif ()
39-
31+
target_link_libraries (ObjSDL ${Boost_SYSTEM_LIBRARY})
4032
target_link_libraries (ObjSDL ${SDL2_LIBRARY})
4133

4234
install (TARGETS ObjSDL DESTINATION bin)

events/CMakeLists.txt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
add_definitions (-std=c++14 -O0)
2+
3+
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
4+
5+
add_library (ObjSDL_events
6+
event.cc event.hh
7+
window_event.cc window_event.hh
8+
keyboard_event.cc keyboard_event.hh
9+
mouse_event.cc mouse_event.hh
10+
joystick_event.cc joystick_event.hh
11+
controller_event.cc controller_event.hh
12+
touch_event.cc touch_event.hh
13+
various_events.cc various_events.hh
14+
)
15+
16+
include (../cmake/FindSDL2.cmake)
17+
18+
find_package (Boost COMPONENTS system REQUIRED)
19+
find_package (SDL2 REQUIRED)
20+
21+
include_directories (${SDL2_INCLUDE_DIR})
22+
include_directories (${Boost_INCLUDE_DIRS})
23+
24+
install (TARGETS ObjSDL_events DESTINATION bin)
File renamed without changes.
File renamed without changes.
File renamed without changes.

event.hh renamed to events/event.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <chrono>
1111
#include <unordered_map>
1212
#include <functional>
13-
#include "window.hh"
13+
#include "../window.hh"
1414

1515
namespace SDL {
1616
class Event;
File renamed without changes.
File renamed without changes.
File renamed without changes.

keyboard_event.hh renamed to events/keyboard_event.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef OBJSDL_KEYBOARD_EVENT_HH
22
#define OBJSDL_KEYBOARD_EVENT_HH
33
#include "event.hh"
4+
#include "../keys.hh"
45

5-
#include "keys.hh"
66

77
namespace SDL {
88
namespace events {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

window.hh

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
#ifndef OBJSDL_WINDOW_HH
2+
#define OBJSDL_WINDOW_HH
3+
14
namespace SDL {
25
struct Window {
36
};
47
}
8+
9+
#endif

0 commit comments

Comments
 (0)