Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 362 lines (319 sloc) 13.813 kB
908686e New CMake build system
Giacomo Spigler authored
1 #**************************************************************************
2 # Lightspark, a free flash player implementation
3 #
93e14d4 @alexp-sssup Bump copyright notices
alexp-sssup authored
4 # Copyright (C) 2010-2011 Alessandro Pignotti <a.pignotti@sssup.it>
908686e New CMake build system
Giacomo Spigler authored
5 # Copyright (C) 2010 Giacomo Spigler <g.spigler@sssup.it>
6 #
7 # This program is free software: you can redistribute it and/or modify
1b969ce @alexp-sssup Final fixes to license disclaimers
alexp-sssup authored
8 # it under the terms of the GNU Lesser General Public License as published by
908686e New CMake build system
Giacomo Spigler authored
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1b969ce @alexp-sssup Final fixes to license disclaimers
alexp-sssup authored
15 # GNU Lesser General Public License for more details.
908686e New CMake build system
Giacomo Spigler authored
16 #
1b969ce @alexp-sssup Final fixes to license disclaimers
alexp-sssup authored
17 # You should have received a copy of the GNU Lesser General Public License
908686e New CMake build system
Giacomo Spigler authored
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #**************************************************************************
20
21
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23
a0263f6 @QuLogic Rearrange CMakeLists.txt.
QuLogic authored
24 # Name & Version
908686e New CMake build system
Giacomo Spigler authored
25 PROJECT(LIGHTSPARK)
6c5351b @QuLogic Build a shared lightspark library.
QuLogic authored
26 SET(MAJOR_VERSION "0")
45b9eea @alexp-sssup Version bump for 0.5.0
alexp-sssup authored
27 SET(MINOR_VERSION "5")
887216b @janimo Update versionto 0.5.2.1
janimo authored
28 SET(PATCH_VERSION "2")
29 SET(SUBPATCH_VERSION "1")
200c692 @alexp-sssup Add --version|-v command line switch
alexp-sssup authored
30
2543fc1 @timonvo Add -git suffix to VERSION when .git directory is detected. Change co…
timonvo authored
31 IF(EXISTS "${CMAKE_SOURCE_DIR}/.git/")
32 SET(GIT_VERSION "-git")
33 ELSE(EXISTS "${CMAKE_SOURCE_DIR}/.git/")
34 SET(GIT_VERSION "")
35 ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/.git/")
36
7194f9a @alexp-sssup Strip trailing 0 from reported version
alexp-sssup authored
37 IF(SUBPATCH_VERSION EQUAL "0")
38 ADD_DEFINITIONS(-DVERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${GIT_VERSION}")
39 ELSE(SUBPATCH_VERSION EQUAL "0")
40 ADD_DEFINITIONS(-DVERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}.${SUBPATCH_VERSION}${GIT_VERSION}")
41 ENDIF(SUBPATCH_VERSION EQUAL "0")
42
200c692 @alexp-sssup Add --version|-v command line switch
alexp-sssup authored
43 ADD_DEFINITIONS(-DSHORTVERSION="${MINOR_VERSION}${PATCH_VERSION}${SUBPATCH_VERSION}")
6c5351b @QuLogic Build a shared lightspark library.
QuLogic authored
44
a1f988f @QuLogic Require GCC 4.4+.
QuLogic authored
45 # GCC 4.4+ is required, GCC_VERSION macro taken from GCC manual
46 INCLUDE(CheckCSourceCompiles)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
47 IF(CMAKE_COMPILER_IS_GNUCC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
48 CHECK_C_SOURCE_COMPILES("
49 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
50 #if GCC_VERSION < 40400
51 #error
52 #endif
53 int main() { return 0; }" GCC_IS_4_4)
54 IF(NOT GCC_IS_4_4)
55 MESSAGE(FATAL_ERROR "GCC 4.4+ is required.")
56 ENDIF(NOT GCC_IS_4_4)
727b49e Some other fixes since last merge from master
Alexandre Demers authored
57 ENDIF(CMAKE_COMPILER_IS_GNUCC)
a1f988f @QuLogic Require GCC 4.4+.
QuLogic authored
58
5e3a183 @alexp-sssup Make gnash path configurable
alexp-sssup authored
59 # Find put the path of the gnash executable, if available
60 FIND_PROGRAM(GNASH_EXE_PATH NAMES gnash)
61
62 IF(GNASH_EXE_PATH)
63 MESSAGE(STATUS "Found gnash path: ${GNASH_EXE_PATH}")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
64 ELSE(GNASH_EXE_PATH)
5e3a183 @alexp-sssup Make gnash path configurable
alexp-sssup authored
65 # Set a default path
66 MESSAGE(STATUS "Gnash not found")
67 SET(GNASH_EXE_PATH "/usr/bin/gnash")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
68 ENDIF(GNASH_EXE_PATH)
5e3a183 @alexp-sssup Make gnash path configurable
alexp-sssup authored
69
4a27ce5 Use relative pathes for installation
Alexandre Demers authored
70 # Find out CPU architecture ...
71 # we could also use IF(CMAKE_SIZEOF_VOID_P EQUAL 4) to determine if it's a 32 or a 64bit arch
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
72 #
73 # Setting the value of LIB_SUFFIX if not specified (We could build 32bit version on 64bit)
74 # However, some distro don't implement FHS the same way
75 # Suse, Redhat put 64bit libs in /lib64; Debian use /lib for 64bit, but specifies /lib32 for 32bit libs
76 # See FHS 2.3 for Lib directories under each architecture
9fcf4ac Added initial PPC support
DaNiMoTh authored
77
78 # Some directory shortcuts
79 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/conf)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
80 # If we're gcc, then use nasm to get fastpath. If MSVC, just use inline asm to get around
81 # CMake issues
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
82 IF(CMAKE_COMPILER_IS_GNUCC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
83 INCLUDE(CMakeASM-NASMCompiler)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
84 ENDIF(CMAKE_COMPILER_IS_GNUCC)
4c764af @alexp-sssup Fix 64bit building
alexp-sssup authored
85 IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$|^x86$")
f6bda0a Fixed installation pathes between 32 and 64bit architectures by deter…
Alexandre Demers authored
86 SET(i386 1)
559ed0f @alexp-sssup Fix some spaces-tabs
alexp-sssup authored
87 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 32")
9fcf4ac Added initial PPC support
DaNiMoTh authored
88 # nasm for assembly optimizations
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
89 IF(CMAKE_COMPILER_IS_GNUCC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
90 ENABLE_LANGUAGE(ASM-NASM)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
91 ENDIF(CMAKE_COMPILER_IS_GNUCC)
2de307a @OdyX Add support for Hurd and common fallback for various architectures to…
OdyX authored
92 ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "unknown" AND ${CMAKE_SYSTEM} MATCHES "GNU-0.3")
93 # GNU Hurd is i386
94 SET(i386 1)
95 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 32")
96 # nasm for assembly optimizations
97 IF(CMAKE_COMPILER_IS_GNUCC)
98 ENABLE_LANGUAGE(ASM-NASM)
99 ENDIF ()
4c764af @alexp-sssup Fix 64bit building
alexp-sssup authored
100 ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86_64$|^amd64$")
f6bda0a Fixed installation pathes between 32 and 64bit architectures by deter…
Alexandre Demers authored
101 SET(x86_64 1)
0403e83 @alexp-sssup Install libraries in FHS compliant place by default
alexp-sssup authored
102 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 64")
9fcf4ac Added initial PPC support
DaNiMoTh authored
103 # nasm for assembly optimizations
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
104 IF(CMAKE_COMPILER_IS_GNUCC)
105 ENABLE_LANGUAGE(ASM-NASM)
106 ENDIF(CMAKE_COMPILER_IS_GNUCC)
9fcf4ac Added initial PPC support
DaNiMoTh authored
107 ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
108 SET(ppc 1)
109 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None ppc")
a765034 First try to ppc fastpaths.
DaNiMoTh authored
110 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec -D__STDC_CONSTANT_MACROS -fPIC")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
111 ELSE(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$|^x86$")
2de307a @OdyX Add support for Hurd and common fallback for various architectures to…
OdyX authored
112 # All non-x86 non-ppc architectures.
113 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
114 ENDIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$|^x86$")
f6bda0a Fixed installation pathes between 32 and 64bit architectures by deter…
Alexandre Demers authored
115
78c4a3b @mgehre cmake: detect crosscompiling
mgehre authored
116 IF(CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME)
117 SET(CROSSCOMPILING FALSE)
118 ELSE()
119 SET(CROSSCOMPILING TRUE)
120 ENDIF()
121
df76f19 @mgehre cmake: setup for mingw-cross-env with static dependencies
mgehre authored
122 #On mingw-cross-env, all depedencies are static libs
123 IF(CROSSCOMPILING AND MINGW)
124 SET(STATICDEPS TRUE)
125 ELSE()
126 SET(STATICDEPS FALSE)
127 ENDIF()
128
4a27ce5 Use relative pathes for installation
Alexandre Demers authored
129 # Using relative folders, cmake happens by itself CMAKE_INSTALL_PREFIX
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
130 IF(UNIX)
e083644 @timonvo Add support for configuration files. Currently audio backend, cache d…
timonvo authored
131 SET(ETCDIR "/etc") #Using absolute folder
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
132 SET(BINDIR "bin")
022893b @timonvo Fix DATADIR path in CMakeLists.txt
timonvo authored
133 SET(DATADIR "${CMAKE_INSTALL_PREFIX}/share")
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
134 SET(LIBDIR "lib${LIB_SUFFIX}")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
135 SET(PRIVATELIBDIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}/lightspark")
136 SET(CMAKE_INSTALL_RPATH "${PRIVATELIBDIR}")
137 ENDIF(UNIX)
f6bda0a Fixed installation pathes between 32 and 64bit architectures by deter…
Alexandre Demers authored
138
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
139 # Setting variables
da80ca6 @alexp-sssup Add default AUDIO_BACKEND=pulseaudio
alexp-sssup authored
140 SET(AUDIO_BACKEND "pulseaudio" CACHE STRING "Which audio backends should be built?")
c36b827 @alexp-sssup Fix string escape
alexp-sssup authored
141 SET(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Install prefix, default is /usr/local (UNIX) and C:\\Program Files (Windows)")
908686e New CMake build system
Giacomo Spigler authored
142 SET(COMPILE_LIGHTSPARK TRUE CACHE BOOL "Compile Lightspark?")
143 SET(COMPILE_TIGHTSPARK TRUE CACHE BOOL "Compile Tightspark?")
ebda96e @janimo build browser plugin by default
janimo authored
144 SET(COMPILE_PLUGIN TRUE CACHE BOOL "Compile the browser plugin?")
b85bfd5 @ZeroStride CURL support optional
ZeroStride authored
145 SET(ENABLE_CURL TRUE CACHE BOOL "Enable CURL? (Required for Downloader functionality)")
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
146 SET(ENABLE_GLES2 FALSE CACHE BOOL "Build with OpenGLES 2.0 support instead of OpenGL")
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
147 SET(ENABLE_LIBAVCODEC TRUE CACHE BOOL "Enable libavcodec and dependent functionality?")
9f5530d @alexp-sssup Document ENABLE_RTMP switch
alexp-sssup authored
148 SET(ENABLE_RTMP FALSE CACHE BOOL "Enable librtmp and dependent functionality?")
9df12c4 @alexp-sssup Add profiling configuration switch
alexp-sssup authored
149 SET(ENABLE_PROFILING FALSE CACHE BOOL "Enable profiling support? (Causes performance issues)")
4a27ce5 Use relative pathes for installation
Alexandre Demers authored
150 SET(PLUGIN_DIRECTORY "${LIBDIR}/mozilla/plugins" CACHE STRING "Directory to install Firefox plugin to")
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
151 IF(NOT CMAKE_BUILD_TYPE)
559ed0f @alexp-sssup Fix some spaces-tabs
alexp-sssup authored
152 SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
63e0fd4 @thomasdziedzic get rid of debian build type because O3 was removed
thomasdziedzic authored
153 "Choose the type of build, options are: Debug Release RelWithDebInfo Profile" FORCE)
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
154 ENDIF(NOT CMAKE_BUILD_TYPE)
908686e New CMake build system
Giacomo Spigler authored
155
6fd0251 @alexp-sssup Fix build system
alexp-sssup authored
156 # The library is searched in its private library directory
157 SET(CMAKE_SKIP_BUILD_RPATH FALSE)
580d54d The audioManager is now able to find and load the audio plugins.
Alexandre Demers authored
158 SET(PRIVATELIBDIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}/lightspark")
159 SET(CMAKE_INSTALL_RPATH "${PRIVATELIBDIR}")
6fd0251 @alexp-sssup Fix build system
alexp-sssup authored
160
a0263f6 @QuLogic Rearrange CMakeLists.txt.
QuLogic authored
161 # Libraries we need
d13b59a @mgehre cmake: always include pkg-config (it is available on win32, too)
mgehre authored
162 INCLUDE(FindPkgConfig REQUIRED)
b42892d @thomasdziedzic Add gettext support.
thomasdziedzic authored
163 INCLUDE(FindGettext REQUIRED)
ee2199e @alexp-sssup Fixed detection of ZLib and other libraries
alexp-sssup authored
164 INCLUDE(FindLLVM REQUIRED)
ae0696f @mgehre CMakeList: fix check for LLVM >= 2.8
mgehre authored
165 IF(${LLVM_STRING_VERSION} VERSION_LESS 2.8)
6431d35 @mgehre Require llvm-2.8 or higher (but no llvm-2.9)
mgehre authored
166 MESSAGE(FATAL_ERROR "LLVM >=2.8 is required!")
ae0696f @mgehre CMakeList: fix check for LLVM >= 2.8
mgehre authored
167 ENDIF(${LLVM_STRING_VERSION} VERSION_LESS 2.8)
6431d35 @mgehre Require llvm-2.8 or higher (but no llvm-2.9)
mgehre authored
168 IF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.9)
169 MESSAGE(FATAL_ERROR "LLVM !=2.9 is required!")
170 ENDIF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.9)
171 IF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.8)
92894b7 @alexp-sssup Fix support for newer LLVM
alexp-sssup authored
172 ADD_DEFINITIONS(-DLLVM_28)
6431d35 @mgehre Require llvm-2.8 or higher (but no llvm-2.9)
mgehre authored
173 ENDIF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.8)
ee2199e @alexp-sssup Fixed detection of ZLib and other libraries
alexp-sssup authored
174 INCLUDE(FindZLIB REQUIRED)
0401571 @bzztbomb Fix Linux issues introduced by previous commit.
bzztbomb authored
175 INCLUDE(FindFreetype REQUIRED)
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
176 IF(NOT(ENABLE_GLES2))
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
177 INCLUDE(FindOpenGL REQUIRED)
178 INCLUDE(FindGLEW REQUIRED)
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
179 ENDIF(NOT(ENABLE_GLES2))
180 INCLUDE(FindPCRE REQUIRED)
f92bf55 @mgehre Implemented backends/jpeg
mgehre authored
181 INCLUDE(FindJPEG REQUIRED)
4ab7b03 @mgehre cmake: look for libxml++-2.6 on win32, too
mgehre authored
182 pkg_check_modules(XMLPP REQUIRED libxml++-2.6>=2.33.1)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
183
7f1a01b @alexp-sssup Purge reference to boost::regex
alexp-sssup authored
184 find_package(Boost COMPONENTS filesystem system REQUIRED)
7aef583 Some default initialization for interfaces
Alexandre Demers authored
185 if(Boost_FOUND)
186 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
b609cde @thomasdziedzic Switch all pcrecpp to pcre
thomasdziedzic authored
187 ENDIF(Boost_FOUND)
1f0646b @mgehre cmake: cairo is also required on win32
mgehre authored
188
189 pkg_check_modules(CAIRO_LIBS REQUIRED cairo pangocairo)
190
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
191 IF(UNIX)
1f0646b @mgehre cmake: cairo is also required on win32
mgehre authored
192 pkg_check_modules(X11 REQUIRED x11)
193 INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS})
727b49e Some other fixes since last merge from master
Alexandre Demers authored
194 ENDIF(UNIX)
908686e New CMake build system
Giacomo Spigler authored
195
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
196 IF(ENABLE_GLES2)
197 pkg_check_modules(GLES2 REQUIRED egl glesv2)
198 ADD_DEFINITIONS(-DENABLE_GLES2)
199 ENDIF(ENABLE_GLES2)
200
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
201 IF(WIN32)
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
202 SET(EXTRA_LIBS_LIBRARIES ${EXTRA_LIBS_LIBRARIES} ws2_32.lib imagehlp.lib)
727b49e Some other fixes since last merge from master
Alexandre Demers authored
203 ENDIF(WIN32)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
204
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
205 IF(UNIX)
206 IF(AUDIO_BACKEND)
825036c Removed a remaining (and unused) flag for audio.
Alexandre Demers authored
207 ADD_DEFINITIONS(-DAUDIO_BACKEND="${AUDIO_BACKEND}")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
208 ENDIF(AUDIO_BACKEND)
209 ENDIF(UNIX)
3ee14f5 @alexp-sssup Avoid checking for libpulse if sound is disabled
alexp-sssup authored
210
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
211 IF(ENABLE_LIBAVCODEC)
db06212 @alexp-sssup Add libavformat based stream decoder
alexp-sssup authored
212 pkg_check_modules(FFMPEG libavcodec libavutil libavformat)
dde985e @QuLogic Fallback to old FindFFMpeg script when pkg-config fails.
QuLogic authored
213 IF(NOT(FFMPEG_FOUND))
214 INCLUDE(FindFFMpeg REQUIRED)
215 ENDIF(NOT(FFMPEG_FOUND))
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
216 # Compatibility checks for ffmpeg deprecated functions
727b49e Some other fixes since last merge from master
Alexandre Demers authored
217 INCLUDE(CheckFunctionExists REQUIRED)
218 SET(CMAKE_REQUIRED_FLAGS ${LIBAVCODEC_CFLAGS})
219 SET(CMAKE_REQUIRED_INCLUDES ${FFMPEG_INCLUDE_DIRS})
220 SET(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES})
221 CHECK_FUNCTION_EXISTS(avcodec_decode_video2 HAVE_AVCODEC_DECODE_VIDEO2)
222 CHECK_FUNCTION_EXISTS(avcodec_decode_audio3 HAVE_AVCODEC_DECODE_AUDIO3)
223 SET(CMAKE_REQUIRED_FLAGS)
224 SET(CMAKE_REQUIRED_INCLUDES)
225 SET(CMAKE_REQUIRED_LIBRARIES)
226 IF(HAVE_AVCODEC_DECODE_VIDEO2)
227 ADD_DEFINITIONS(-DHAVE_AVCODEC_DECODE_VIDEO2)
228 ENDIF(HAVE_AVCODEC_DECODE_VIDEO2)
229 IF(HAVE_AVCODEC_DECODE_AUDIO3)
230 ADD_DEFINITIONS(-DHAVE_AVCODEC_DECODE_AUDIO3)
231 ENDIF(HAVE_AVCODEC_DECODE_AUDIO3)
232 ADD_DEFINITIONS(-DENABLE_LIBAVCODEC)
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
233 ENDIF(ENABLE_LIBAVCODEC)
4aebf14 @QuLogic Re-apply "Removed deprecated functions (from avcodec.h) and replaced …
QuLogic authored
234
170e404 @magcius Fix build.
magcius authored
235 pkg_check_modules(GLIB REQUIRED glib-2.0)
d33fbeb @mgehre cmake: find glibmm explicitly (was found though xml++ previously)
mgehre authored
236 pkg_check_modules(GLIBMM REQUIRED glibmm-2.4)
237 INCLUDE_DIRECTORIES(${GLIBMM_INCLUDE_DIRS})
170e404 @magcius Fix build.
magcius authored
238 pkg_check_modules(GTK REQUIRED gtk+-2.0)
459f4a7 @aajanki gtk is needed even when COMPILE_PLUGIN is not set
aajanki authored
239
908686e New CMake build system
Giacomo Spigler authored
240 INCLUDE_DIRECTORIES(${LLVM_INCLUDE_DIR})
ee2199e @alexp-sssup Fixed detection of ZLib and other libraries
alexp-sssup authored
241 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
242 INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
243 IF(ENABLE_GLES2)
244 INCLUDE_DIRECTORIES(${GLES2_INCLUDE_DIRS})
245 ELSE()
246 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
247 INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR})
248 ENDIF(ENABLE_GLES2)
b609cde @thomasdziedzic Switch all pcrecpp to pcre
thomasdziedzic authored
249 INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR})
f92bf55 @mgehre Implemented backends/jpeg
mgehre authored
250 INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
ed5ca69 @timonvo Initial policy files support (master only). Needs a lot of testing, c…
timonvo authored
251 INCLUDE_DIRECTORIES(${XMLPP_INCLUDE_DIRS})
1f0646b @mgehre cmake: cairo is also required on win32
mgehre authored
252 INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIRS})
a75bcca @magcius toplevel: Use glib's ASCII string functions so we aren't dependent on…
magcius authored
253 INCLUDE_DIRECTORIES(${GLIB_INCLUDE_DIRS})
459f4a7 @aajanki gtk is needed even when COMPILE_PLUGIN is not set
aajanki authored
254 INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIRS})
3b28ca6 Linking againt boost for file and directory iteration (still a bit of…
Alexandre Demers authored
255
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
256 IF(ENABLE_LIBAVCODEC)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
257 INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})
258 SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${FFMPEG_LIBRARIES})
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
259 ENDIF(ENABLE_LIBAVCODEC)
908686e New CMake build system
Giacomo Spigler authored
260
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
261 IF(CMAKE_COMPILER_IS_GNUCC)
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
262 IF(MINGW)
263 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed,--no-undefined -mthreads ${CMAKE_EXE_LINKER_FLAGS}")
264 SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed,--no-undefined -mthreads ${CMAKE_SHARED_LINKER_FLAGS}")
265 ELSE()
266 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined ${CMAKE_EXE_LINKER_FLAGS}")
267 SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed,-z,noexecstack,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
268 ENDIF()
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
269 ENDIF(CMAKE_COMPILER_IS_GNUCC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
270
271 LINK_DIRECTORIES(${LLVM_LIB_DIR})
ec3ea21 Fixed dependencies by explicitly adding them to the compiler options …
Alexandre Demers authored
272
b85bfd5 @ZeroStride CURL support optional
ZeroStride authored
273 IF(ENABLE_CURL)
df76f19 @mgehre cmake: setup for mingw-cross-env with static dependencies
mgehre authored
274 pkg_check_modules(CURL REQUIRED libcurl)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
275 INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
df76f19 @mgehre cmake: setup for mingw-cross-env with static dependencies
mgehre authored
276 IF(STATICDEPS)
277 SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${CURL_STATIC_LIBRARIES})
278 ELSE()
279 SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${CURL_LIBRARIES})
280 ENDIF()
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
281 ADD_DEFINITIONS(-DENABLE_CURL)
b85bfd5 @ZeroStride CURL support optional
ZeroStride authored
282 ENDIF(ENABLE_CURL)
283
dc9a5fd @alexp-sssup Add ENABLE_RTMP compile time switch
alexp-sssup authored
284 IF(ENABLE_RTMP)
285 pkg_check_modules(RTMP REQUIRED librtmp)
286 SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${RTMP_LIBRARIES})
287 ADD_DEFINITIONS(-DENABLE_RTMP)
288 ENDIF(ENABLE_RTMP)
3363ea8 @alexp-sssup Make use of RTMP support
alexp-sssup authored
289
9df12c4 @alexp-sssup Add profiling configuration switch
alexp-sssup authored
290 IF(ENABLE_PROFILING)
291 ADD_DEFINITIONS(-DPROFILING_SUPPORT)
292 ENDIF(ENABLE_PROFILING)
293
7e0d51c @alexp-sssup Prepare for release
alexp-sssup authored
294 IF(ENABLE_DEBIAN_ALTERNATIVES)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
295 SET(PLUGIN_DIRECTORY ${PRIVATELIBDIR})
7e0d51c @alexp-sssup Prepare for release
alexp-sssup authored
296 ENDIF(ENABLE_DEBIAN_ALTERNATIVES)
297
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
298 # Compiler defaults flags for different profiles
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
299 IF(CMAKE_COMPILER_IS_GNUCC)
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
300 IF(MINGW)
301 SET(CMAKE_CXX_FLAGS
302 "${CMAKE_CXX_FLAGS} -mms-bitfields -mthreads -fexceptions -Wall -Wnon-virtual-dtor -Woverloaded-virtual -pipe -std=c++0x -Wdisabled-optimization -Wextra -Wno-unused-parameter -Wno-invalid-offsetof")
303 ELSE()
304 SET(CMAKE_CXX_FLAGS
d1205e7 @mgehre Silence offsetof warnings
mgehre authored
305 "${CMAKE_CXX_FLAGS} -Wall -Wnon-virtual-dtor -Woverloaded-virtual -pipe -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -Wdisabled-optimization -Wextra -Wno-unused-parameter -Wno-invalid-offsetof")
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
306 ENDIF()
9df12c4 @alexp-sssup Add profiling configuration switch
alexp-sssup authored
307 SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DEXPENSIVE_DEBUG")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
308 SET(CMAKE_CXX_FLAGS_PROFILE "-g -pg -O2")
fbde36f Merge branch 'master' of git://github.com/lightspark/lightspark.git
Alexandre Demers authored
309 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
310 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG")
311 SET(CMAKE_CXX_FLAGS_LEANDEBUG "-g -O2")
60af417 @mgehre win32: Look in executables path for data files
mgehre authored
312 ADD_DEFINITIONS(-DLS_DATADIR="${DATADIR}/lightspark" -DGNASH_PATH="${GNASH_EXE_PATH}" -DPRIVATELIBDIR="${PRIVATELIBDIR}")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
313 ENDIF(CMAKE_COMPILER_IS_GNUCC)
314
315 IF(MSVC)
316 ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DVPCOMPAT -DPTW32_STATIC_LIB -DPCRE_STATIC)
317 ENDIF(MSVC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
318
df76f19 @mgehre cmake: setup for mingw-cross-env with static dependencies
mgehre authored
319 IF(STATICDEPS)
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
320 ADD_DEFINITIONS(-DLIBXML_STATIC -DGLEW_STATIC)
321 ENDIF()
322
09ea0cf @timonvo Move HAVE_ATOMIC check to _after_ the setting of default compiler che…
timonvo authored
323 # Check if the system have atomic header ( gcc >= 4.6 )
324 INCLUDE (CheckIncludeFileCXX)
325 CHECK_INCLUDE_FILE_CXX (atomic HAVE_ATOMIC)
326 IF(HAVE_ATOMIC)
327 ADD_DEFINITIONS(-DHAVE_ATOMIC)
328 ENDIF(HAVE_ATOMIC)
329
faa80aa Simplified make procedure by automatically creating the output binary…
Alexandre Demers authored
330 # Setting the output directories, so we can build all profiles without mixmatching
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
331 IF(CMAKE_COMPILER_IS_GNUCC)
332 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/bin")
333 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/lib${LIB_SUFFIX}")
334 #SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/objs/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/lib${LIB_SUFFIX}" CACHE PATH "Static libraries output directory")
335 ENDIF(CMAKE_COMPILER_IS_GNUCC)
faa80aa Simplified make procedure by automatically creating the output binary…
Alexandre Demers authored
336
d554846 @thomasdziedzic apply Hicham's 'Add desktop file and sized icons' patch
thomasdziedzic authored
337 #Install icons and desktop file
338 if(UNIX)
339 FOREACH(i 16 20 22 24 32 36 48 64 72 96 128 192 256 )
340 INSTALL(FILES media/lightspark-ico-${i}x${i}.png
341 DESTINATION ${DATADIR}/icons/hicolor/${i}x${i}/apps
342 RENAME lightspark.png
343 )
344 ENDFOREACH(i)
345 INSTALL(FILES media/lightspark-ico.svg
346 DESTINATION ${DATADIR}/icons/hicolor/scalable/apps
347 RENAME lightspark.svg
348 )
349 INSTALL(FILES media/lightspark.desktop DESTINATION ${DATADIR}/applications )
350 endif(UNIX)
e083644 @timonvo Add support for configuration files. Currently audio backend, cache d…
timonvo authored
351
34ef15c @magcius Move all source code into a new src folder
magcius authored
352 # generate locales for gettext
353 GETTEXT_CREATE_TRANSLATIONS(i18n/lightspark.pot ALL i18n/pl.po i18n/fr.po
354 i18n/zh_CN.po)
355
e083644 @timonvo Add support for configuration files. Currently audio backend, cache d…
timonvo authored
356 if(UNIX)
357 INSTALL(FILES etc/xdg/lightspark.conf
200c692 @alexp-sssup Add --version|-v command line switch
alexp-sssup authored
358 DESTINATION ${ETCDIR}/xdg/)
e083644 @timonvo Add support for configuration files. Currently audio backend, cache d…
timonvo authored
359 endif(UNIX)
34ef15c @magcius Move all source code into a new src folder
magcius authored
360
361 SUBDIRS(src)
Something went wrong with that request. Please try again.