annotate Resources/CMake/SdlConfiguration.cmake @ 1120:11b7785dd01b

This cpp file leads the optimizer bugging off out of the Solar System
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 05 Nov 2019 16:30:45 +0100
parents 412a2d01a189
children 2d8ab34c8c91
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
1 # Stone of Orthanc
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
3 # Department, University Hospital of Liege, Belgium
439
b70e9be013e4 preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 308
diff changeset
4 # Copyright (C) 2017-2019 Osimis S.A., Belgium
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
5 #
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
6 # This program is free software: you can redistribute it and/or
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
7 # modify it under the terms of the GNU Affero General Public License
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
8 # as published by the Free Software Foundation, either version 3 of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
9 # the License, or (at your option) any later version.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
10 #
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
11 # This program is distributed in the hope that it will be useful, but
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
14 # Affero General Public License for more details.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
15 #
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
18
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
19
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 if (STATIC_BUILD OR NOT USE_SYSTEM_SDL)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 SET(SDL_SOURCES_DIR ${CMAKE_BINARY_DIR}/SDL2-2.0.4)
449
bb658baeb967 moving third-party dependencies to another server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 439
diff changeset
22 SET(SDL_URL "http://orthanc.osimis.io/ThirdPartyDownloads/SDL2-2.0.4.tar.gz")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 SET(SDL_MD5 "44fc4a023349933e7f5d7a582f7b886e")
607
f4b37a991dac using glew to build on Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 449
diff changeset
24 DownloadPackage(${SDL_MD5} ${SDL_URL} "${SDL_SOURCES_DIR}")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 include_directories(${SDL_SOURCES_DIR}/include)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 set(TMP "${SDL_SOURCES_DIR}/include/SDL_config_premake.h")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 if (NOT EXISTS "${TMP}")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 file(WRITE "${TMP}" "
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include \"SDL_platform.h\"
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 #define HAVE_STDARG_H 1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 #define HAVE_STDDEF_H 1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 #define HAVE_STDINT_H 1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 ")
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 # General source files
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 file(GLOB SDL_SOURCES
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 ${SDL_SOURCES_DIR}/src/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 ${SDL_SOURCES_DIR}/src/atomic/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 ${SDL_SOURCES_DIR}/src/audio/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 ${SDL_SOURCES_DIR}/src/cpuinfo/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 ${SDL_SOURCES_DIR}/src/dynapi/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 ${SDL_SOURCES_DIR}/src/events/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 ${SDL_SOURCES_DIR}/src/file/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 ${SDL_SOURCES_DIR}/src/haptic/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 ${SDL_SOURCES_DIR}/src/joystick/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 ${SDL_SOURCES_DIR}/src/libm/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 ${SDL_SOURCES_DIR}/src/power/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 ${SDL_SOURCES_DIR}/src/render/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 ${SDL_SOURCES_DIR}/src/stdlib/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 ${SDL_SOURCES_DIR}/src/thread/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 ${SDL_SOURCES_DIR}/src/timer/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 ${SDL_SOURCES_DIR}/src/video/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 ${SDL_SOURCES_DIR}/src/loadso/dummy/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 #${SDL_SOURCES_DIR}/src/timer/dummy/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 ${SDL_SOURCES_DIR}/src/audio/dummy/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 ${SDL_SOURCES_DIR}/src/filesystem/dummy/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 ${SDL_SOURCES_DIR}/src/haptic/dummy/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 ${SDL_SOURCES_DIR}/src/joystick/dummy/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 #${SDL_SOURCES_DIR}/src/main/dummy/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 ${SDL_SOURCES_DIR}/src/video/dummy/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 -DUSING_PREMAKE_CONFIG_H=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 -DSDL_AUDIO_DISABLED=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 -DSDL_AUDIO_DRIVER_DUMMY=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 -DSDL_FILESYSTEM_DISABLED=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 -DSDL_FILESYSTEM_DUMMY=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 -DSDL_FILE_DISABLED=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 -DSDL_HAPTIC_DISABLED=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 -DSDL_JOYSTICK_DISABLED=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 #-DSDL_THREADS_DISABLED=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
81 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 file(GLOB TMP
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 ${SDL_SOURCES_DIR}/src/core/linux/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 ${SDL_SOURCES_DIR}/src/loadso/dlopen/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 ${SDL_SOURCES_DIR}/src/render/software/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 ${SDL_SOURCES_DIR}/src/thread/pthread/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 ${SDL_SOURCES_DIR}/src/timer/unix/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 ${SDL_SOURCES_DIR}/src/video/x11/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 list(APPEND SDL_SOURCES ${TMP})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 -DSDL_LOADSO_DLOPEN=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 -DSDL_THREAD_PTHREAD=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 -DSDL_TIMER_UNIX=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 -DSDL_POWER_DISABLED=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 -DSDL_VIDEO_DRIVER_X11=1
308
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
100
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 -DSDL_ASSEMBLY_ROUTINES=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 -DSDL_THREAD_PTHREAD_RECURSIVE_MUTEX=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 -DSDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 -DHAVE_GCC_SYNC_LOCK_TEST_AND_SET=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 link_libraries(X11 Xext)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
308
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
109 if (NOT CMAKE_SYSTEM_VERSION STREQUAL "Raspberry")
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
110 # Raspberry Pi has no support for OpenGL
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
111 file(GLOB TMP
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
112 ${SDL_SOURCES_DIR}/src/render/opengl/*.c
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
113 ${SDL_SOURCES_DIR}/src/render/opengles2/*.c
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
114 )
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
115
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
116 list(APPEND SDL_SOURCES ${TMP})
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
117
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
118 add_definitions(
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
119 -DSDL_VIDEO_OPENGL=1
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
120 -DSDL_VIDEO_OPENGL_ES2=1
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
121 -DSDL_VIDEO_RENDER_OGL=1
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
122 -DSDL_VIDEO_RENDER_OGL_ES2=1
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
123 -DSDL_VIDEO_OPENGL_GLX=1
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
124 -DSDL_VIDEO_OPENGL_EGL=1
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
125 )
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
126 endif()
dd951b6afd08 raspberry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 134
diff changeset
127
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
128 elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 file(GLOB TMP
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 ${SDL_SOURCES_DIR}/src/audio/directsound/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 ${SDL_SOURCES_DIR}/src/audio/disk/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 ${SDL_SOURCES_DIR}/src/audio/winmm/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 ${SDL_SOURCES_DIR}/src/joystick/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 ${SDL_SOURCES_DIR}/src/haptic/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 ${SDL_SOURCES_DIR}/src/power/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 ${SDL_SOURCES_DIR}/src/main/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 ${SDL_SOURCES_DIR}/src/core/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 ${SDL_SOURCES_DIR}/src/loadso/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 ${SDL_SOURCES_DIR}/src/render/direct3d/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 ${SDL_SOURCES_DIR}/src/render/direct3d11/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 ${SDL_SOURCES_DIR}/src/render/opengl/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 ${SDL_SOURCES_DIR}/src/render/psp/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 ${SDL_SOURCES_DIR}/src/render/opengles/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 ${SDL_SOURCES_DIR}/src/render/opengles2/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 ${SDL_SOURCES_DIR}/src/render/software/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 ${SDL_SOURCES_DIR}/src/thread/generic/SDL_syscond.c # Don't include more files from "thread/generic/*.c"!
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 ${SDL_SOURCES_DIR}/src/thread/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 ${SDL_SOURCES_DIR}/src/timer/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 ${SDL_SOURCES_DIR}/src/video/windows/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 ${SDL_SOURCES_DIR}/src/windows/dlopen/*.c
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 list(APPEND SDL_SOURCES ${TMP})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 # NB: OpenGL ES headers are not available in MinGW-W64
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 -DSDL_LOADSO_WINDOWS=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 -DSDL_THREAD_WINDOWS=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 -DSDL_TIMER_WINDOWS=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 -DSDL_POWER_WINDOWS=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 -DSDL_VIDEO_OPENGL=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 -DSDL_VIDEO_OPENGL_WGL=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 -DSDL_VIDEO_RENDER_D3D=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 -DSDL_VIDEO_RENDER_OGL=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 -DSDL_VIDEO_DRIVER_WINDOWS=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 if (MSVC)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 -D__FLTUSED__
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 -DHAVE_LIBC=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 add_definitions(
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 -DHAVE_GCC_ATOMICS=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 -DSDL_ASSEMBLY_ROUTINES=1
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 )
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 link_libraries(imm32 winmm version)
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
183
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
184 elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
185 file(GLOB TMP
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
186 ${SDL_SOURCES_DIR}/src/loadso/dlopen/*.c
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
187 ${SDL_SOURCES_DIR}/src/render/opengl/*.c
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
188 ${SDL_SOURCES_DIR}/src/render/opengles2/*.c
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
189 ${SDL_SOURCES_DIR}/src/render/software/*.c
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
190 ${SDL_SOURCES_DIR}/src/thread/pthread/*.c
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
191 ${SDL_SOURCES_DIR}/src/timer/unix/*.c
5
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
192 ${SDL_SOURCES_DIR}/src/video/cocoa/*.m
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
193 )
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
194
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
195 list(APPEND SDL_SOURCES ${TMP})
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
196
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
197 add_definitions(
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
198 -DSDL_LOADSO_DLOPEN=1
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
199 -DSDL_THREAD_PTHREAD=1
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
200 -DSDL_TIMER_UNIX=1
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
201 -DSDL_POWER_DISABLED=1
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
202
5
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
203 -DSDL_VIDEO_DRIVER_COCOA=1
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
204 -DSDL_VIDEO_OPENGL=1
5
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
205 -DSDL_VIDEO_OPENGL_CGL=1
3
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
206 -DSDL_VIDEO_RENDER_OGL=1
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
207
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
208 -DSDL_ASSEMBLY_ROUTINES=1
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
209 -DSDL_THREAD_PTHREAD_RECURSIVE_MUTEX=1
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
210 )
490347621f42 attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
211
5
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
212 find_library(CARBON_LIBRARY Carbon)
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
213 find_library(COCOA_LIBRARY Cocoa)
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
214 find_library(IOKIT_LIBRARY IOKit)
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
215 find_library(QUARTZ_LIBRARY QuartzCore)
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
216 link_libraries(${CARBON_LIBRARY} ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${QUARTZ_LIBRARY})
d9452f5a5346 fix build on Mac OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3
diff changeset
217
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 endif()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 else()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 pkg_search_module(SDL2 REQUIRED sdl2)
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 include_directories(${SDL2_INCLUDE_DIRS})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 link_libraries(${SDL2_LIBRARIES})
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 endif()