/[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 401 - (hide annotations) (download)
Fri Feb 25 17:31:09 2011 UTC (9 years, 5 months ago) by william
File size: 5333 byte(s)
Auto Commited Import of: pcsx2-0.9.7-DEBUG (upstream: v0.9.7.4358 local: v0.9.7.313-latest) in ./trunk
1 william 31 #-------------------------------------------------------------------------------
2 william 62 # Search all libraries on the system
3 william 31 #-------------------------------------------------------------------------------
4 william 62 # Do not search Lib in /usr/lib64. Hope it is not overwritten in find_package or others macro
5     SET(FIND_LIBRARY_USE_LIB64_PATHS FALSE)
6 william 31
7 william 62 ## Linux only libraries
8     if(Linux)
9     # Most plugins (if not all) and PCSX2 core need gtk2, so
10     # set the required flags
11     find_package(GTK2 REQUIRED gtk)
12     if(GTK2_FOUND)
13     # From version 2.21.3 gtk moved gdk-pixbuf into a separate module
14     # Cmake need to be fixed. For the moment uses a manual detection.
15     find_path(GDK_PIXBUF_INCLUDE_DIRS NAMES gdk-pixbuf/gdk-pixbuf.h PATHS
16     /usr/include/gdk-pixbuf-2.0
17     /usr/include)
18     if (GDK_PIXBUF_INCLUDE_DIRS)
19     set(GTK2_INCLUDE_DIRS "${GDK_PIXBUF_INCLUDE_DIRS}" "${GTK2_INCLUDE_DIRS}")
20     # Remove duplicates when cmake will be fixed
21     list(REMOVE_DUPLICATES GTK2_INCLUDE_DIRS)
22     endif (GDK_PIXBUF_INCLUDE_DIRS)
23     endif(GTK2_FOUND)
24 william 31
25 william 62 find_package(X11)
26 william 31 endif(Linux)
27    
28 william 62 ## Use cmake package to find module
29     find_package(ALSA)
30     find_package(BZip2)
31 william 401 find_package(Gettext) # translation tool
32 william 62 find_package(JPEG)
33     find_package(OpenGL)
34     # Tell cmake that we use SDL as a library and not as an application
35     set(SDL_BUILDING_LIBRARY TRUE)
36     find_package(SDL)
37     find_package(Subversion)
38     # The requierement of wxWidgets is checked in SelectPcsx2Plugins module
39     # Does not requier the module (allow to compile non-wx plugins)
40 william 401 # Force the unicode build (the variable is only supported on cmake 2.8.3 and above)
41     set(wxWidgets_CONFIG_OPTIONS "--unicode=yes")
42 william 62 find_package(wxWidgets COMPONENTS base core adv)
43     if(NOT FORCE_INTERNAL_ZLIB)
44     find_package(ZLIB)
45     endif(NOT FORCE_INTERNAL_ZLIB)
46 william 31
47 william 62 ## Use pcsx2 package to find module
48     include(FindCg)
49     include(FindGlew)
50     include(FindPortAudio)
51     if(NOT FORCE_INTERNAL_SOUNDTOUCH)
52     include(FindSoundTouch)
53     endif(NOT FORCE_INTERNAL_SOUNDTOUCH)
54     include(FindSparseHash)
55 william 31
56 william 62 # Note for include_directory: The order is important to avoid a mess between include file from your system and the one of pcsx2
57     # If you include first 3rdparty, all 3rdpary include will have a higer priority...
58     # If you include first /usr/include, all system include will have a higer priority over the pcsx2 one...
59     # Current implementation:
60     # 1/ include 3rdparty sub-directory that we will used (either request or fallback)
61     # 2/ include system one
62     #----------------------------------------
63     # Fallback on 3rdparty libraries
64     #----------------------------------------
65     # Note to avoid some conflict with system include, we must include 3rdparty first
66     if(NOT ZLIB_FOUND OR FORCE_INTERNAL_ZLIB)
67 william 31 # use project one
68     set(projectZLIB TRUE)
69 william 62 set(ZLIB_FOUND TRUE)
70     # Set path
71     set(ZLIB_LIBRARIES pcsx2_zlib)
72     include_directories(${PROJECT_SOURCE_DIR}/3rdparty/zlib)
73     message(STATUS "Use internal pcsx2 zlib library")
74     endif(NOT ZLIB_FOUND OR FORCE_INTERNAL_ZLIB)
75 william 31
76 william 62 if(NOT SOUNDTOUCH_FOUND OR FORCE_INTERNAL_SOUNDTOUCH)
77     # use project one
78     set(projectSoundTouch TRUE)
79     set(SOUNDTOUCH_FOUND TRUE)
80     # Set path
81     set(SOUNDTOUCH_LIBRARIES pcsx2_SoundTouch)
82     include_directories(${PROJECT_SOURCE_DIR}/3rdparty/soundtouch_linux_include)
83     message(STATUS "Use internal pcsx2 SoundTouch library")
84     endif(NOT SOUNDTOUCH_FOUND OR FORCE_INTERNAL_SOUNDTOUCH)
85 william 31
86     #----------------------------------------
87 william 62 # Use system include (if not 3rdparty one)
88 william 31 #----------------------------------------
89 william 62 if(Linux)
90     # GTK2
91     if(GTK2_FOUND)
92     include_directories(${GTK2_INCLUDE_DIRS})
93     endif(GTK2_FOUND)
94 william 31
95 william 62 # x11
96 william 31 if(X11_FOUND)
97     include_directories(${X11_INCLUDE_DIR})
98     endif(X11_FOUND)
99     endif(Linux)
100    
101 william 62 # ALSA
102 william 31 if(ALSA_FOUND)
103     include_directories(${ALSA_INCLUDE_DIRS})
104     endif(ALSA_FOUND)
105    
106 william 62 # bzip2
107     if(BZIP2_FOUND)
108 william 31 include_directories(${BZIP2_INCLUDE_DIR})
109 william 62 endif(BZIP2_FOUND)
110 william 31
111 william 62 # Cg
112 william 31 if(CG_FOUND)
113 william 62 include_directories(${CG_INCLUDE_DIRS})
114 william 31 endif(CG_FOUND)
115    
116 william 62 # Jpeg
117     if(JPEG_FOUND)
118     include_directories(${JPEG_INCLUDE_DIR})
119     endif(JPEG_FOUND)
120 william 31
121 william 62 # GLEW
122 william 31 if(GLEW_FOUND)
123 william 273 include_directories(${GLEW_INCLUDE_DIR})
124 william 31 endif(GLEW_FOUND)
125    
126 william 62 # OpenGL
127 william 31 if(OPENGL_FOUND)
128     include_directories(${OPENGL_INCLUDE_DIR})
129     endif(OPENGL_FOUND)
130    
131 william 62 # PortAudio
132 william 31 if(PORTAUDIO_FOUND)
133     include_directories(${PORTAUDIO_INCLUDE_DIR})
134     endif(PORTAUDIO_FOUND)
135    
136 william 62 # SDL
137 william 31 if(SDL_FOUND)
138     include_directories(${SDL_INCLUDE_DIR})
139     endif(SDL_FOUND)
140    
141 william 62 # SoundTouch
142     if(SOUNDTOUCH_FOUND AND NOT projectSoundTouch)
143 william 31 include_directories(${SOUNDTOUCH_INCLUDE_DIR})
144 william 62 endif(SOUNDTOUCH_FOUND AND NOT projectSoundTouch)
145 william 31
146 william 62 # SPARSEHASH
147     if(SPARSEHASH_FOUND)
148     include_directories(${SPARSEHASH_INCLUDE_DIR})
149     endif(SPARSEHASH_FOUND)
150 william 31
151 william 62 # Wx
152     if(wxWidgets_FOUND)
153     if(Linux)
154     # Force the use of 32 bit library configuration on
155     # 64 bits machine with 32 bits library in /usr/lib32
156     if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND EXISTS "/usr/lib32")
157     STRING(REGEX REPLACE "/usr/lib/wx" "/usr/lib32/wx"
158     wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
159     endif(CMAKE_SIZEOF_VOID_P MATCHES "8" AND EXISTS "/usr/lib32")
160     endif(Linux)
161 william 31
162 william 62 include(${wxWidgets_USE_FILE})
163     endif(wxWidgets_FOUND)
164 william 31
165 william 62 # Zlib
166     if(ZLIB_FOUND AND NOT projectZLIB)
167     include_directories(${ZLIB_INCLUDE_DIRS})
168     endif(ZLIB_FOUND AND NOT projectZLIB)

  ViewVC Help
Powered by ViewVC 1.1.22