/[pcsx2_0.9.7]/trunk/cmake/SearchForStuff.cmake
ViewVC logotype

Annotation of /trunk/cmake/SearchForStuff.cmake

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (hide annotations) (download)
Tue Sep 7 03:24:11 2010 UTC (9 years, 11 months ago) by william
File size: 10253 byte(s)
committing r3113 initial commit again...
1 william 31 # Search for additional software.
2    
3     #-------------------------------------------------------------------------------
4     # Minmal required version of libraries
5     #-------------------------------------------------------------------------------
6     set(minimal_wxWidgets_version 2.8.0)
7     set(minimal_GTK2_version 2.10)
8     set(minimal_SDL_version 1.2)
9    
10     # to set the proper dependencies and decide which plugins should be build we
11     # need to know on which OS we are currenty working/running
12     detectOperatingSystem()
13    
14     SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS " ")
15     SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS " ")
16    
17     #-------------------------------------------------------------------------------
18     # FindStuff
19     #-------------------------------------------------------------------------------
20     #----------------------------------------
21     # Required
22     #----------------------------------------
23     if(Linux) # Linux only
24     # gtk required
25     find_package(GTK2 REQUIRED gtk)
26    
27     # gtk found
28     if(GTK2_FOUND)
29     # add gtk include directories
30     include_directories(${GTK2_INCLUDE_DIRS})
31     #else(GTK2_FOUND)
32     # message(FATAL_ERROR "GTK2 libraries and include files not found.
33     # Please install GTK2 version ${minimal_GTK2_version} or higher.")
34     endif(GTK2_FOUND)
35    
36     endif(Linux)
37    
38     #------------------------------------------------------------
39    
40     # wx required
41     find_package(wxWidgets REQUIRED base core adv)
42    
43     # wx found
44     if(wxWidgets_FOUND)
45     if(Linux) # Linux only
46     # Force the use of 32 bit library
47     STRING(REGEX REPLACE "/usr/lib/wx" "${32_LD_LIBRARY_PATH}/wx"
48     wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
49     endif(Linux)
50     include(${wxWidgets_USE_FILE})
51     #else(wxWidgets_FOUND)
52     # message(FATAL_ERROR "wxWidgets libraries and include files not found.\
53     # Please install wxWidgets version ${minimal_wxWidgets_version} \
54     # or higher.")
55     endif(wxWidgets_FOUND)
56    
57     #------------------------------------------------------------
58    
59     # zlib required (no require flag, because we can use project one as fallback)
60     find_package(ZLIB)
61    
62     # if we found zlib on the system, use it else use project one
63     if(ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB)
64     # add zlib include directories
65     include_directories(${ZLIB_INCLUDE_DIRS})
66     else(ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB)
67     # use project one
68     set(projectZLIB TRUE)
69     endif(ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB)
70    
71     #------------------------------------------------------------
72    
73    
74     #----------------------------------------
75     # Optional
76     #----------------------------------------
77     if(Linux) # Linux only
78     # x11 optional
79     find_package(X11)
80    
81     # x11 found
82     if(X11_FOUND)
83     # add x11 include directories
84     include_directories(${X11_INCLUDE_DIR})
85     #else(X11_FOUND)
86     # message(FATAL_ERROR "X11 libraries and include files not found.
87     # Please install X11.")
88     endif(X11_FOUND)
89     endif(Linux)
90    
91     # Manually find Xxf86vm because it is not done in the module...
92     FIND_LIBRARY(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH})
93     MARK_AS_ADVANCED(X11_Xxf86vm_LIB)
94    
95     #------------------------------------------------------------
96    
97     # A52 optional
98     include(FindA52)
99    
100     # if we found A52 on the system,
101     # use it else use project one
102     if(A52_FOUND AND NOT FORCE_INTERNAL_A52)
103     # add a52 include directories
104     include_directories(${A52_INCLUDE_DIR})
105     else(A52_FOUND AND NOT FORCE_INTERNAL_A52)
106     # use project one
107     set(projectA52 TRUE)
108     set(A52_LIBRARIES A52)
109     endif(A52_FOUND AND NOT FORCE_INTERNAL_A52)
110    
111    
112     # ALSA optional
113     find_package(ALSA)
114    
115     # ALSA found
116     if(ALSA_FOUND)
117     # add ALSA include directories
118     include_directories(${ALSA_INCLUDE_DIRS})
119     endif(ALSA_FOUND)
120    
121     #------------------------------------------------------------
122    
123     # bzip2 optional
124     find_package(BZip2)
125    
126     # if we found bzip2 on the system,
127     # use it else use project one
128     if(BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2)
129     # add zlib include directories
130     include_directories(${BZIP2_INCLUDE_DIR})
131     else(BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2)
132     # use project one
133     set(projectBZip2 TRUE)
134     set(BZIP2_LIBRARIES bzip2)
135     endif(BZIP2_FOUND AND NOT FORCE_INTERNAL_BZIP2)
136    
137     #------------------------------------------------------------
138    
139     # Cg optional
140     include(FindCg)
141    
142     # found Cg
143     if(CG_FOUND)
144     # add Cg include directories
145     include_directories(${CG_INCLUDE_DIR})
146     endif(CG_FOUND)
147    
148     #------------------------------------------------------------
149    
150     # GLEW optional
151     include(FindGlew)
152    
153     # found GLEW
154     if(GLEW_FOUND)
155     # add GLEW include directories
156     include_directories(${GLEW_INCLUDE_PATH})
157     endif(GLEW_FOUND)
158    
159     #------------------------------------------------------------
160    
161     # OpenGL optional
162     find_package(OpenGL)
163    
164     # opengl found
165     if(OPENGL_FOUND)
166     # add OpenGL include directories
167     include_directories(${OPENGL_INCLUDE_DIR})
168     endif(OPENGL_FOUND)
169    
170     #------------------------------------------------------------
171    
172     # PortAudio optional
173     include(FindPortAudio)
174    
175     # found PortAudio
176     if(PORTAUDIO_FOUND)
177     # add PortAudio include directories
178     include_directories(${PORTAUDIO_INCLUDE_DIR})
179     endif(PORTAUDIO_FOUND)
180    
181     #------------------------------------------------------------
182    
183     # SDL optional
184     set(SDL_BUILDING_LIBRARY TRUE)
185     find_package(SDL)
186    
187     # SDL found
188     if(SDL_FOUND)
189     # add SDL include directories
190     include_directories(${SDL_INCLUDE_DIR})
191     endif(SDL_FOUND)
192    
193     #------------------------------------------------------------
194    
195     # SoundTouch optional
196     #include(FindSoundTouch)
197    
198     # found SoundTouch
199     if(SOUNDTOUCH_FOUND AND NOT FORCE_INTERNAL_SOUNDTOUCH)
200     # add SoundTouch include directories
201     include_directories(${SOUNDTOUCH_INCLUDE_DIR})
202     else(SOUNDTOUCH_FOUND AND NOT FORCE_INTERNAL_SOUNDTOUCH)
203     # use project one
204     set(projectSoundTouch TRUE)
205     set(SOUNDTOUCH_LIBRARIES SoundTouch)
206    
207     # found
208     set(SOUNDTOUCH_FOUND TRUE)
209     endif(SOUNDTOUCH_FOUND AND NOT FORCE_INTERNAL_SOUNDTOUCH)
210    
211     #------------------------------------------------------------
212    
213     # Subversion optional
214     find_package(Subversion)
215    
216     # subversion found
217     if(Subversion_FOUND)
218     set(SVN TRUE)
219     else(Subversion_FOUND)
220     set(SVN FALSE)
221     endif(Subversion_FOUND)
222    
223     #-------------------------------------------------------------------------------
224     # Plugins
225     #-------------------------------------------------------------------------------
226     # Check all plugins for additional dependencies.
227     # If all dependencies of a plugin are available, including OS, the plugin will
228     # be build.
229     #-------------------------------------------------------------------------------
230     # null plugins should work on every platform, enable them all
231     #---------------------------------------
232     # CDVDnull
233     #---------------------------------------
234     set(CDVDnull TRUE)
235     #---------------------------------------
236    
237     #---------------------------------------
238     # CDVDiso
239     #---------------------------------------
240     # requires: -BZip2
241     #---------------------------------------
242     if(BZIP2_FOUND)
243     set(CDVDiso TRUE)
244     else(BZIP2_FOUND)
245     set(CDVDiso FALSE)
246     endif(BZIP2_FOUND)
247    
248     #---------------------------------------
249     # dev9null
250     #---------------------------------------
251     set(dev9null TRUE)
252     #---------------------------------------
253    
254     #---------------------------------------
255     # FWnull
256     #---------------------------------------
257     set(FWnull TRUE)
258     #---------------------------------------
259    
260     #---------------------------------------
261     # GSnull
262     #---------------------------------------
263     set(GSnull TRUE)
264     #---------------------------------------
265    
266     #---------------------------------------
267     # PadNull
268     #---------------------------------------
269     set(PadNull TRUE)
270     #---------------------------------------
271    
272     #---------------------------------------
273     # SPU2null
274     #---------------------------------------
275     set(SPU2null TRUE)
276     #---------------------------------------
277    
278     #---------------------------------------
279     # USBnull
280     #---------------------------------------
281     set(USBnull TRUE)
282     #---------------------------------------
283    
284     #---------------------------------------
285     # onepad
286     #---------------------------------------
287     # requires: -SDL
288     #---------------------------------------
289     if(SDL_FOUND)
290     set(onepad TRUE)
291     else(SDL_FOUND)
292     set(onepad FALSE)
293     endif(SDL_FOUND)
294     #---------------------------------------
295    
296     #---------------------------------------
297     # zeropad
298     #---------------------------------------
299     # requires: -SDL
300     #---------------------------------------
301     if(SDL_FOUND)
302     set(zeropad TRUE)
303     else(SDL_FOUND)
304     set(zeropad FALSE)
305     endif(SDL_FOUND)
306     #---------------------------------------
307    
308     #---------------------------------------
309     # spu2-x
310     #---------------------------------------
311     # requires: -SoundTouch
312     #---------------------------------------
313     if(SOUNDTOUCH_FOUND)
314     set(spu2-x TRUE)
315     else(SOUNDTOUCH_FOUND)
316     set(spu2-x FALSE)
317     endif(SOUNDTOUCH_FOUND)
318     #---------------------------------------
319    
320     #---------------------------------------
321     # zerogs
322     #---------------------------------------
323     # requires: -GLEW
324     # -OpenGL
325     # -X11
326     # -CG
327     #---------------------------------------
328     if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
329     set(zerogs TRUE)
330     else(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
331     set(zerogs FALSE)
332     endif(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
333     #---------------------------------------
334    
335     #---------------------------------------
336     # zzogl-pg
337     #---------------------------------------
338     # requires: -GLEW
339     # -OpenGL
340     # -X11
341     # -CG
342     #---------------------------------------
343     if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
344     set(zzogl TRUE)
345     else(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
346     set(zzogl FALSE)
347     endif(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
348    
349     #---------------------------------------
350     # zerospu2
351     #---------------------------------------
352     # requires: -SoundTouch
353     # -ALSA
354     # -PortAudio
355     #---------------------------------------
356     if(SOUNDTOUCH_FOUND AND ALSA_FOUND)
357     set(zerospu2 TRUE)
358     else(SOUNDTOUCH_FOUND AND ALSA_FOUND)
359     set(zerospu2 FALSE)
360     endif(SOUNDTOUCH_FOUND AND ALSA_FOUND)
361     #---------------------------------------
362    
363     #-------------------------------------------------------------------------------
364     # [TODO] Write CMakeLists.txt for these plugins.
365     set(cdvdGigaherz FALSE)
366     #set(CDVDiso FALSE)
367     set(CDVDisoEFP FALSE)
368     set(CDVDlinuz FALSE)
369     set(CDVDolio FALSE)
370     set(CDVDpeops FALSE)
371     set(GSdx FALSE)
372     set(LilyPad FALSE)
373     set(PeopsSPU2 FALSE)
374     set(SSSPSXPAD FALSE)
375     set(xpad FALSE)
376     #set(zeropad FALSE)
377     #-------------------------------------------------------------------------------
378    

  ViewVC Help
Powered by ViewVC 1.1.22