Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 453 lines (404 sloc) 17.578 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")
b8c03fd @janimo Bump version to 0.5.3
janimo authored
28 SET(PATCH_VERSION "3")
29 SET(SUBPATCH_VERSION "0")
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")
186f057 @mgehre cmake: append current git revision to version
mgehre authored
33
34 #Find out if we are exactly at a tag. Then the version
f74f22b @mgehre cmake: when determining if we are at a release version, only consider…
mgehre authored
35 #is enough. Only consider the official release tags like
36 #'lightspark-0.5.3'
37 EXECUTE_PROCESS(COMMAND git describe --match "lightspark-*" --tags
186f057 @mgehre cmake: append current git revision to version
mgehre authored
38 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
39 OUTPUT_VARIABLE GIT_DESC
40 ERROR_QUIET
41 OUTPUT_STRIP_TRAILING_WHITESPACE)
42 #Check if that command failed (maybe git is not installed at all)
43 IF(GIT_DESC)
f74f22b @mgehre cmake: when determining if we are at a release version, only consider…
mgehre authored
44 EXECUTE_PROCESS(COMMAND git describe --match "lightspark-*" --tags --abbrev=0
186f057 @mgehre cmake: append current git revision to version
mgehre authored
45 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
46 OUTPUT_VARIABLE GIT_DESC_ABBREV
47 ERROR_QUIET
48 OUTPUT_STRIP_TRAILING_WHITESPACE)
49
50 IF(${GIT_DESC} STREQUAL ${GIT_DESC_ABBREV})
51 #We are exactly at a tag
52 SET(GIT_VERSION "")
53 ELSE()
54 #Append the git hash to GIT_VERSION
55 EXECUTE_PROCESS(COMMAND git rev-parse --short HEAD
56 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
57 OUTPUT_VARIABLE GIT_REVISION
58 ERROR_QUIET
59 OUTPUT_STRIP_TRAILING_WHITESPACE)
60 IF(GIT_REVISION)
61 SET(GIT_VERSION "-${GIT_REVISION}")
62 ENDIF()
63 ENDIF()
64 ENDIF()
2543fc1 @timonvo Add -git suffix to VERSION when .git directory is detected. Change co…
timonvo authored
65 ELSE(EXISTS "${CMAKE_SOURCE_DIR}/.git/")
66 SET(GIT_VERSION "")
67 ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/.git/")
68
7194f9a @alexp-sssup Strip trailing 0 from reported version
alexp-sssup authored
69 IF(SUBPATCH_VERSION EQUAL "0")
186f057 @mgehre cmake: append current git revision to version
mgehre authored
70 SET(FULLVERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${GIT_VERSION}")
7194f9a @alexp-sssup Strip trailing 0 from reported version
alexp-sssup authored
71 ELSE(SUBPATCH_VERSION EQUAL "0")
186f057 @mgehre cmake: append current git revision to version
mgehre authored
72 SET(FULLVERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}.${SUBPATCH_VERSION}${GIT_VERSION}")
7194f9a @alexp-sssup Strip trailing 0 from reported version
alexp-sssup authored
73 ENDIF(SUBPATCH_VERSION EQUAL "0")
74
186f057 @mgehre cmake: append current git revision to version
mgehre authored
75 SET(SHORTVERSION "${MINOR_VERSION}${PATCH_VERSION}${SUBPATCH_VERSION}")
76
77 CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/src/version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/version.h" @ONLY)
78 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
6c5351b @QuLogic Build a shared lightspark library.
QuLogic authored
79
a1f988f @QuLogic Require GCC 4.4+.
QuLogic authored
80 # GCC 4.4+ is required, GCC_VERSION macro taken from GCC manual
81 INCLUDE(CheckCSourceCompiles)
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 CHECK_C_SOURCE_COMPILES("
84 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
85 #if GCC_VERSION < 40400
86 #error
87 #endif
88 int main() { return 0; }" GCC_IS_4_4)
89 IF(NOT GCC_IS_4_4)
90 MESSAGE(FATAL_ERROR "GCC 4.4+ is required.")
91 ENDIF(NOT GCC_IS_4_4)
727b49e Some other fixes since last merge from master
Alexandre Demers authored
92 ENDIF(CMAKE_COMPILER_IS_GNUCC)
a1f988f @QuLogic Require GCC 4.4+.
QuLogic authored
93
5e3a183 @alexp-sssup Make gnash path configurable
alexp-sssup authored
94 # Find put the path of the gnash executable, if available
95 FIND_PROGRAM(GNASH_EXE_PATH NAMES gnash)
96
97 IF(GNASH_EXE_PATH)
98 MESSAGE(STATUS "Found gnash path: ${GNASH_EXE_PATH}")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
99 ELSE(GNASH_EXE_PATH)
5e3a183 @alexp-sssup Make gnash path configurable
alexp-sssup authored
100 # Set a default path
101 MESSAGE(STATUS "Gnash not found")
102 SET(GNASH_EXE_PATH "/usr/bin/gnash")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
103 ENDIF(GNASH_EXE_PATH)
5e3a183 @alexp-sssup Make gnash path configurable
alexp-sssup authored
104
4a27ce5 Use relative pathes for installation
Alexandre Demers authored
105 # Find out CPU architecture ...
106 # 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
107 #
108 # Setting the value of LIB_SUFFIX if not specified (We could build 32bit version on 64bit)
109 # However, some distro don't implement FHS the same way
110 # Suse, Redhat put 64bit libs in /lib64; Debian use /lib for 64bit, but specifies /lib32 for 32bit libs
111 # See FHS 2.3 for Lib directories under each architecture
9fcf4ac Added initial PPC support
DaNiMoTh authored
112
113 # Some directory shortcuts
114 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/conf)
421128b @mgehre cmake: enable compression by upx
mgehre authored
115 INCLUDE(Pack)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
116 # If we're gcc, then use nasm to get fastpath. If MSVC, just use inline asm to get around
117 # CMake issues
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
118 IF(CMAKE_COMPILER_IS_GNUCC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
119 INCLUDE(CMakeASM-NASMCompiler)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
120 ENDIF(CMAKE_COMPILER_IS_GNUCC)
4c764af @alexp-sssup Fix 64bit building
alexp-sssup authored
121 IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$|^x86$")
f6bda0a Fixed installation pathes between 32 and 64bit architectures by deter…
Alexandre Demers authored
122 SET(i386 1)
559ed0f @alexp-sssup Fix some spaces-tabs
alexp-sssup authored
123 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 32")
9fcf4ac Added initial PPC support
DaNiMoTh authored
124 # nasm for assembly optimizations
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
125 IF(CMAKE_COMPILER_IS_GNUCC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
126 ENABLE_LANGUAGE(ASM-NASM)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
127 ENDIF(CMAKE_COMPILER_IS_GNUCC)
2de307a @OdyX Add support for Hurd and common fallback for various architectures to…
OdyX authored
128 ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "unknown" AND ${CMAKE_SYSTEM} MATCHES "GNU-0.3")
129 # GNU Hurd is i386
130 SET(i386 1)
131 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 32")
132 # nasm for assembly optimizations
133 IF(CMAKE_COMPILER_IS_GNUCC)
134 ENABLE_LANGUAGE(ASM-NASM)
135 ENDIF ()
4c764af @alexp-sssup Fix 64bit building
alexp-sssup authored
136 ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86_64$|^amd64$")
f6bda0a Fixed installation pathes between 32 and 64bit architectures by deter…
Alexandre Demers authored
137 SET(x86_64 1)
0403e83 @alexp-sssup Install libraries in FHS compliant place by default
alexp-sssup authored
138 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None 64")
9fcf4ac Added initial PPC support
DaNiMoTh authored
139 # nasm for assembly optimizations
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
140 IF(CMAKE_COMPILER_IS_GNUCC)
141 ENABLE_LANGUAGE(ASM-NASM)
142 ENDIF(CMAKE_COMPILER_IS_GNUCC)
9fcf4ac Added initial PPC support
DaNiMoTh authored
143 ELSEIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
144 SET(ppc 1)
145 SET(LIB_SUFFIX "" CACHE STRING "Choose the suffix of the lib folder (if any) : None ppc")
a765034 First try to ppc fastpaths.
DaNiMoTh authored
146 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
147 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
148 # All non-x86 non-ppc architectures.
149 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
150 ENDIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$|^x86$")
f6bda0a Fixed installation pathes between 32 and 64bit architectures by deter…
Alexandre Demers authored
151
78c4a3b @mgehre cmake: detect crosscompiling
mgehre authored
152 IF(CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME)
153 SET(CROSSCOMPILING FALSE)
154 ELSE()
155 SET(CROSSCOMPILING TRUE)
156 ENDIF()
157
df76f19 @mgehre cmake: setup for mingw-cross-env with static dependencies
mgehre authored
158 #On mingw-cross-env, all depedencies are static libs
159 IF(CROSSCOMPILING AND MINGW)
160 SET(STATICDEPS TRUE)
161 ELSE()
162 SET(STATICDEPS FALSE)
163 ENDIF()
164
4a27ce5 Use relative pathes for installation
Alexandre Demers authored
165 # 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
166 IF(UNIX)
3faef65 @mgehre cmake: setup install paths for win32 build
mgehre authored
167 SET(ETCDIR "/etc") #Using absolute folder
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
168 SET(BINDIR "bin")
d94f545 @mgehre cmake: configure install paths for win32
mgehre authored
169 SET(DATADIR "share")
2679268 @aajanki cmake: Use absolute path for LSDATADIR
aajanki authored
170 # Absolute path, because this path is embedded in the binary
171 SET(LSDATADIR "${CMAKE_INSTALL_PREFIX}/${DATADIR}/lightspark")
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
172 SET(LIBDIR "lib${LIB_SUFFIX}")
d94f545 @mgehre cmake: configure install paths for win32
mgehre authored
173 #We need a absolute path here because we use it for rpath
174 #later on
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
175 SET(PRIVATELIBDIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}/lightspark")
176 SET(CMAKE_INSTALL_RPATH "${PRIVATELIBDIR}")
7177eed @mgehre cmake: install audio plugins on win32
mgehre authored
177 SET(PLUGINSDIR "${PRIVATELIBDIR}/plugins")
3faef65 @mgehre cmake: setup install paths for win32 build
mgehre authored
178 ELSE()
179 SET(ETCDIR ".")
180 SET(BINDIR ".")
181 SET(DATADIR ".")
182 SET(LSDATADIR ".")
183 SET(LIBDIR ".")
184 SET(PRIVATELIBDIR ".")
7177eed @mgehre cmake: install audio plugins on win32
mgehre authored
185 SET(PLUGINSDIR ".")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
186 ENDIF(UNIX)
f6bda0a Fixed installation pathes between 32 and 64bit architectures by deter…
Alexandre Demers authored
187
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
188 # Setting variables
96fc8d5 @mgehre cmake: Make 'sdl' backend default on win32
mgehre authored
189 IF(WIN32)
0488f3d @mgehre cmake: win32: switch default audio from sdl to winmm
mgehre authored
190 SET(AUDIO_BACKEND "winmm" CACHE STRING "Which audio backends should be built?")
96fc8d5 @mgehre cmake: Make 'sdl' backend default on win32
mgehre authored
191 ELSE()
192 SET(AUDIO_BACKEND "pulseaudio" CACHE STRING "Which audio backends should be built?")
193 ENDIF()
194
c36b827 @alexp-sssup Fix string escape
alexp-sssup authored
195 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
196 SET(COMPILE_LIGHTSPARK TRUE CACHE BOOL "Compile Lightspark?")
197 SET(COMPILE_TIGHTSPARK TRUE CACHE BOOL "Compile Tightspark?")
ebda96e @janimo build browser plugin by default
janimo authored
198 SET(COMPILE_PLUGIN TRUE CACHE BOOL "Compile the browser plugin?")
b85bfd5 @ZeroStride CURL support optional
ZeroStride authored
199 SET(ENABLE_CURL TRUE CACHE BOOL "Enable CURL? (Required for Downloader functionality)")
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
200 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
201 SET(ENABLE_LIBAVCODEC TRUE CACHE BOOL "Enable libavcodec and dependent functionality?")
9f5530d @alexp-sssup Document ENABLE_RTMP switch
alexp-sssup authored
202 SET(ENABLE_RTMP FALSE CACHE BOOL "Enable librtmp and dependent functionality?")
9df12c4 @alexp-sssup Add profiling configuration switch
alexp-sssup authored
203 SET(ENABLE_PROFILING FALSE CACHE BOOL "Enable profiling support? (Causes performance issues)")
4a27ce5 Use relative pathes for installation
Alexandre Demers authored
204 SET(PLUGIN_DIRECTORY "${LIBDIR}/mozilla/plugins" CACHE STRING "Directory to install Firefox plugin to")
3faef65 @mgehre cmake: setup install paths for win32 build
mgehre authored
205
d94f545 @mgehre cmake: configure install paths for win32
mgehre authored
206 IF(ENABLE_DEBIAN_ALTERNATIVES OR WIN32)
3faef65 @mgehre cmake: setup install paths for win32 build
mgehre authored
207 SET(PLUGIN_DIRECTORY ${PRIVATELIBDIR})
208 ENDIF()
209
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
210 IF(NOT CMAKE_BUILD_TYPE)
559ed0f @alexp-sssup Fix some spaces-tabs
alexp-sssup authored
211 SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
63e0fd4 @thomasdziedzic get rid of debian build type because O3 was removed
thomasdziedzic authored
212 "Choose the type of build, options are: Debug Release RelWithDebInfo Profile" FORCE)
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
213 ENDIF(NOT CMAKE_BUILD_TYPE)
908686e New CMake build system
Giacomo Spigler authored
214
6fd0251 @alexp-sssup Fix build system
alexp-sssup authored
215 # The library is searched in its private library directory
216 SET(CMAKE_SKIP_BUILD_RPATH FALSE)
580d54d The audioManager is now able to find and load the audio plugins.
Alexandre Demers authored
217 SET(CMAKE_INSTALL_RPATH "${PRIVATELIBDIR}")
6fd0251 @alexp-sssup Fix build system
alexp-sssup authored
218
a0263f6 @QuLogic Rearrange CMakeLists.txt.
QuLogic authored
219 # Libraries we need
d13b59a @mgehre cmake: always include pkg-config (it is available on win32, too)
mgehre authored
220 INCLUDE(FindPkgConfig REQUIRED)
b42892d @thomasdziedzic Add gettext support.
thomasdziedzic authored
221 INCLUDE(FindGettext REQUIRED)
ee2199e @alexp-sssup Fixed detection of ZLib and other libraries
alexp-sssup authored
222 INCLUDE(FindLLVM REQUIRED)
ae0696f @mgehre CMakeList: fix check for LLVM >= 2.8
mgehre authored
223 IF(${LLVM_STRING_VERSION} VERSION_LESS 2.8)
6431d35 @mgehre Require llvm-2.8 or higher (but no llvm-2.9)
mgehre authored
224 MESSAGE(FATAL_ERROR "LLVM >=2.8 is required!")
ae0696f @mgehre CMakeList: fix check for LLVM >= 2.8
mgehre authored
225 ENDIF(${LLVM_STRING_VERSION} VERSION_LESS 2.8)
6431d35 @mgehre Require llvm-2.8 or higher (but no llvm-2.9)
mgehre authored
226 IF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.9)
227 MESSAGE(FATAL_ERROR "LLVM !=2.9 is required!")
228 ENDIF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.9)
229 IF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.8)
92894b7 @alexp-sssup Fix support for newer LLVM
alexp-sssup authored
230 ADD_DEFINITIONS(-DLLVM_28)
6431d35 @mgehre Require llvm-2.8 or higher (but no llvm-2.9)
mgehre authored
231 ENDIF(${LLVM_STRING_VERSION} VERSION_EQUAL 2.8)
ee2199e @alexp-sssup Fixed detection of ZLib and other libraries
alexp-sssup authored
232 INCLUDE(FindZLIB REQUIRED)
0401571 @bzztbomb Fix Linux issues introduced by previous commit.
bzztbomb authored
233 INCLUDE(FindFreetype REQUIRED)
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
234 IF(NOT(ENABLE_GLES2))
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
235 INCLUDE(FindOpenGL REQUIRED)
236 INCLUDE(FindGLEW REQUIRED)
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
237 ENDIF(NOT(ENABLE_GLES2))
238 INCLUDE(FindPCRE REQUIRED)
f92bf55 @mgehre Implemented backends/jpeg
mgehre authored
239 INCLUDE(FindJPEG REQUIRED)
4ab7b03 @mgehre cmake: look for libxml++-2.6 on win32, too
mgehre authored
240 pkg_check_modules(XMLPP REQUIRED libxml++-2.6>=2.33.1)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
241
7f1a01b @alexp-sssup Purge reference to boost::regex
alexp-sssup authored
242 find_package(Boost COMPONENTS filesystem system REQUIRED)
7aef583 Some default initialization for interfaces
Alexandre Demers authored
243 if(Boost_FOUND)
244 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
b609cde @thomasdziedzic Switch all pcrecpp to pcre
thomasdziedzic authored
245 ENDIF(Boost_FOUND)
1f0646b @mgehre cmake: cairo is also required on win32
mgehre authored
246
247 pkg_check_modules(CAIRO_LIBS REQUIRED cairo pangocairo)
248
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
249 IF(UNIX)
1f0646b @mgehre cmake: cairo is also required on win32
mgehre authored
250 pkg_check_modules(X11 REQUIRED x11)
251 INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS})
727b49e Some other fixes since last merge from master
Alexandre Demers authored
252 ENDIF(UNIX)
908686e New CMake build system
Giacomo Spigler authored
253
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
254 IF(ENABLE_GLES2)
255 pkg_check_modules(GLES2 REQUIRED egl glesv2)
256 ADD_DEFINITIONS(-DENABLE_GLES2)
257 ENDIF(ENABLE_GLES2)
258
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
259 IF(WIN32)
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
260 SET(EXTRA_LIBS_LIBRARIES ${EXTRA_LIBS_LIBRARIES} ws2_32.lib imagehlp.lib)
727b49e Some other fixes since last merge from master
Alexandre Demers authored
261 ENDIF(WIN32)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
262
518816d @mgehre config: if only one audio plugin was compiled, use that as default
mgehre authored
263 IF(AUDIO_BACKEND)
264 ADD_DEFINITIONS(-DAUDIO_BACKEND="${AUDIO_BACKEND}")
265 ENDIF(AUDIO_BACKEND)
3ee14f5 @alexp-sssup Avoid checking for libpulse if sound is disabled
alexp-sssup authored
266
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
267 IF(ENABLE_LIBAVCODEC)
db06212 @alexp-sssup Add libavformat based stream decoder
alexp-sssup authored
268 pkg_check_modules(FFMPEG libavcodec libavutil libavformat)
dde985e @QuLogic Fallback to old FindFFMpeg script when pkg-config fails.
QuLogic authored
269 IF(NOT(FFMPEG_FOUND))
270 INCLUDE(FindFFMpeg REQUIRED)
271 ENDIF(NOT(FFMPEG_FOUND))
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
272 # Compatibility checks for ffmpeg deprecated functions
727b49e Some other fixes since last merge from master
Alexandre Demers authored
273 INCLUDE(CheckFunctionExists REQUIRED)
274 SET(CMAKE_REQUIRED_FLAGS ${LIBAVCODEC_CFLAGS})
275 SET(CMAKE_REQUIRED_INCLUDES ${FFMPEG_INCLUDE_DIRS})
276 SET(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES})
277 CHECK_FUNCTION_EXISTS(avcodec_decode_video2 HAVE_AVCODEC_DECODE_VIDEO2)
278 CHECK_FUNCTION_EXISTS(avcodec_decode_audio3 HAVE_AVCODEC_DECODE_AUDIO3)
279 SET(CMAKE_REQUIRED_FLAGS)
280 SET(CMAKE_REQUIRED_INCLUDES)
281 SET(CMAKE_REQUIRED_LIBRARIES)
282 IF(HAVE_AVCODEC_DECODE_VIDEO2)
283 ADD_DEFINITIONS(-DHAVE_AVCODEC_DECODE_VIDEO2)
284 ENDIF(HAVE_AVCODEC_DECODE_VIDEO2)
285 IF(HAVE_AVCODEC_DECODE_AUDIO3)
286 ADD_DEFINITIONS(-DHAVE_AVCODEC_DECODE_AUDIO3)
287 ENDIF(HAVE_AVCODEC_DECODE_AUDIO3)
288 ADD_DEFINITIONS(-DENABLE_LIBAVCODEC)
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
289 ENDIF(ENABLE_LIBAVCODEC)
4aebf14 @QuLogic Re-apply "Removed deprecated functions (from avcodec.h) and replaced …
QuLogic authored
290
170e404 @magcius Fix build.
magcius authored
291 pkg_check_modules(GLIB REQUIRED glib-2.0)
d33fbeb @mgehre cmake: find glibmm explicitly (was found though xml++ previously)
mgehre authored
292 pkg_check_modules(GLIBMM REQUIRED glibmm-2.4)
293 INCLUDE_DIRECTORIES(${GLIBMM_INCLUDE_DIRS})
170e404 @magcius Fix build.
magcius authored
294 pkg_check_modules(GTK REQUIRED gtk+-2.0)
459f4a7 @aajanki gtk is needed even when COMPILE_PLUGIN is not set
aajanki authored
295
908686e New CMake build system
Giacomo Spigler authored
296 INCLUDE_DIRECTORIES(${LLVM_INCLUDE_DIR})
ee2199e @alexp-sssup Fixed detection of ZLib and other libraries
alexp-sssup authored
297 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
298 INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
cd70b20 @janimo Add ENABLE_GLES2 config option to the build
janimo authored
299 IF(ENABLE_GLES2)
300 INCLUDE_DIRECTORIES(${GLES2_INCLUDE_DIRS})
301 ELSE()
302 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
303 INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR})
304 ENDIF(ENABLE_GLES2)
b609cde @thomasdziedzic Switch all pcrecpp to pcre
thomasdziedzic authored
305 INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR})
f92bf55 @mgehre Implemented backends/jpeg
mgehre authored
306 INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
ed5ca69 @timonvo Initial policy files support (master only). Needs a lot of testing, c…
timonvo authored
307 INCLUDE_DIRECTORIES(${XMLPP_INCLUDE_DIRS})
1f0646b @mgehre cmake: cairo is also required on win32
mgehre authored
308 INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIRS})
a75bcca @magcius toplevel: Use glib's ASCII string functions so we aren't dependent on…
magcius authored
309 INCLUDE_DIRECTORIES(${GLIB_INCLUDE_DIRS})
459f4a7 @aajanki gtk is needed even when COMPILE_PLUGIN is not set
aajanki authored
310 INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIRS})
3b28ca6 Linking againt boost for file and directory iteration (still a bit of…
Alexandre Demers authored
311
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
312 IF(ENABLE_LIBAVCODEC)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
313 INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})
314 SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${FFMPEG_LIBRARIES})
64c5bb5 @ZeroStride CMAKE now has an ENABLE_LIBAVCODEC flag, which is true by default.
ZeroStride authored
315 ENDIF(ENABLE_LIBAVCODEC)
908686e New CMake build system
Giacomo Spigler authored
316
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
317 IF(CMAKE_COMPILER_IS_GNUCC)
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
318 IF(MINGW)
1af941c @mgehre cmake: strip on win32
mgehre authored
319 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed,--no-undefined -mthreads -s ${CMAKE_EXE_LINKER_FLAGS}")
8a0b099 @mgehre cmake: silence a win32 linker warning
mgehre authored
320 SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed,--no-undefined,--enable-stdcall-fixup -mthreads -s ${CMAKE_SHARED_LINKER_FLAGS}")
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
321 ELSE()
322 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined ${CMAKE_EXE_LINKER_FLAGS}")
323 SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed,-z,noexecstack,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
324 ENDIF()
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
325 ENDIF(CMAKE_COMPILER_IS_GNUCC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
326
327 LINK_DIRECTORIES(${LLVM_LIB_DIR})
ec3ea21 Fixed dependencies by explicitly adding them to the compiler options …
Alexandre Demers authored
328
b85bfd5 @ZeroStride CURL support optional
ZeroStride authored
329 IF(ENABLE_CURL)
df76f19 @mgehre cmake: setup for mingw-cross-env with static dependencies
mgehre authored
330 pkg_check_modules(CURL REQUIRED libcurl)
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
331 INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
df76f19 @mgehre cmake: setup for mingw-cross-env with static dependencies
mgehre authored
332 IF(STATICDEPS)
333 SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${CURL_STATIC_LIBRARIES})
334 ELSE()
335 SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${CURL_LIBRARIES})
336 ENDIF()
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
337 ADD_DEFINITIONS(-DENABLE_CURL)
b85bfd5 @ZeroStride CURL support optional
ZeroStride authored
338 ENDIF(ENABLE_CURL)
339
dc9a5fd @alexp-sssup Add ENABLE_RTMP compile time switch
alexp-sssup authored
340 IF(ENABLE_RTMP)
341 pkg_check_modules(RTMP REQUIRED librtmp)
342 SET(OPTIONAL_LIBRARIES ${OPTIONAL_LIBRARIES} ${RTMP_LIBRARIES})
343 ADD_DEFINITIONS(-DENABLE_RTMP)
344 ENDIF(ENABLE_RTMP)
3363ea8 @alexp-sssup Make use of RTMP support
alexp-sssup authored
345
9df12c4 @alexp-sssup Add profiling configuration switch
alexp-sssup authored
346 IF(ENABLE_PROFILING)
347 ADD_DEFINITIONS(-DPROFILING_SUPPORT)
348 ENDIF(ENABLE_PROFILING)
349
3aab45f Better usage of LIB_SUFFIX
Alexandre Demers authored
350 # Compiler defaults flags for different profiles
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
351 IF(CMAKE_COMPILER_IS_GNUCC)
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
352 IF(MINGW)
353 SET(CMAKE_CXX_FLAGS
354 "${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")
355 ELSE()
356 SET(CMAKE_CXX_FLAGS
d1205e7 @mgehre Silence offsetof warnings
mgehre authored
357 "${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
358 ENDIF()
9df12c4 @alexp-sssup Add profiling configuration switch
alexp-sssup authored
359 SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DEXPENSIVE_DEBUG")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
360 SET(CMAKE_CXX_FLAGS_PROFILE "-g -pg -O2")
fbde36f Merge branch 'master' of git://github.com/lightspark/lightspark.git
Alexandre Demers authored
361 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
362 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG")
363 SET(CMAKE_CXX_FLAGS_LEANDEBUG "-g -O2")
3faef65 @mgehre cmake: setup install paths for win32 build
mgehre authored
364 ADD_DEFINITIONS(-DLS_DATADIR="${LSDATADIR}" -DGNASH_PATH="${GNASH_EXE_PATH}" -DPRIVATELIBDIR="${PRIVATELIBDIR}")
dc1ebd9 Merge branch 'master' of git://github.com/alexp-sssup/lightspark.git
Alexandre Demers authored
365 ENDIF(CMAKE_COMPILER_IS_GNUCC)
366
367 IF(MSVC)
368 ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DVPCOMPAT -DPTW32_STATIC_LIB -DPCRE_STATIC)
369 ENDIF(MSVC)
0497e0a @bzztbomb Enable CMake generation of MSVC projects on Win32.
bzztbomb authored
370
df76f19 @mgehre cmake: setup for mingw-cross-env with static dependencies
mgehre authored
371 IF(STATICDEPS)
971abb6 @mgehre cmake: adjust for mingw
mgehre authored
372 ADD_DEFINITIONS(-DLIBXML_STATIC -DGLEW_STATIC)
373 ENDIF()
374
09ea0cf @timonvo Move HAVE_ATOMIC check to _after_ the setting of default compiler che…
timonvo authored
375 # Check if the system have atomic header ( gcc >= 4.6 )
376 INCLUDE (CheckIncludeFileCXX)
377 CHECK_INCLUDE_FILE_CXX (atomic HAVE_ATOMIC)
378 IF(HAVE_ATOMIC)
379 ADD_DEFINITIONS(-DHAVE_ATOMIC)
380 ENDIF(HAVE_ATOMIC)
381
faa80aa Simplified make procedure by automatically creating the output binary…
Alexandre Demers authored
382 # 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
383 IF(CMAKE_COMPILER_IS_GNUCC)
384 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/bin")
385 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/lib${LIB_SUFFIX}")
386 #SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/objs/${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE}/lib${LIB_SUFFIX}" CACHE PATH "Static libraries output directory")
387 ENDIF(CMAKE_COMPILER_IS_GNUCC)
faa80aa Simplified make procedure by automatically creating the output binary…
Alexandre Demers authored
388
d554846 @thomasdziedzic apply Hicham's 'Add desktop file and sized icons' patch
thomasdziedzic authored
389 #Install icons and desktop file
390 if(UNIX)
391 FOREACH(i 16 20 22 24 32 36 48 64 72 96 128 192 256 )
392 INSTALL(FILES media/lightspark-ico-${i}x${i}.png
393 DESTINATION ${DATADIR}/icons/hicolor/${i}x${i}/apps
394 RENAME lightspark.png
395 )
396 ENDFOREACH(i)
397 INSTALL(FILES media/lightspark-ico.svg
398 DESTINATION ${DATADIR}/icons/hicolor/scalable/apps
399 RENAME lightspark.svg
400 )
401 INSTALL(FILES media/lightspark.desktop DESTINATION ${DATADIR}/applications )
402 endif(UNIX)
e083644 @timonvo Add support for configuration files. Currently audio backend, cache d…
timonvo authored
403
34ef15c @magcius Move all source code into a new src folder
magcius authored
404 # generate locales for gettext
405 GETTEXT_CREATE_TRANSLATIONS(i18n/lightspark.pot ALL i18n/pl.po i18n/fr.po
406 i18n/zh_CN.po)
407
e083644 @timonvo Add support for configuration files. Currently audio backend, cache d…
timonvo authored
408 if(UNIX)
409 INSTALL(FILES etc/xdg/lightspark.conf
200c692 @alexp-sssup Add --version|-v command line switch
alexp-sssup authored
410 DESTINATION ${ETCDIR}/xdg/)
921d8a0 @mgehre cmake: include LGPL in win32 installer
mgehre authored
411 ELSE()
412 INSTALL(FILES COPYING DESTINATION "." RENAME COPYING.txt)
413 INSTALL(FILES COPYING.LESSER DESTINATION "." RENAME COPYING.LESSER.txt)
e083644 @timonvo Add support for configuration files. Currently audio backend, cache d…
timonvo authored
414 endif(UNIX)
34ef15c @magcius Move all source code into a new src folder
magcius authored
415
416 SUBDIRS(src)
cfc0b37 @mgehre cmake: create win32 installer by 'make package'
mgehre authored
417
418 #-- CPack setup - use 'make package' to build
419 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Lightspark is an LGPLv3 licensed cross-platform Flash player and browser plugin")
420 SET(CPACK_PACKAGE_VENDOR "Lightspark Team")
421 SET(CPACK_PACKAGE_NAME "Lightspark")
422 SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
423 SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
7898f1a @mgehre cpack: add subpatch version and git version
mgehre authored
424 IF(SUBPATCH_VERSION EQUAL "0")
425 SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}${GIT_VERSION}")
426 ELSE()
427 SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}.${SUBPATCH_VERSION}${GIT_VERSION}")
428 ENDIF()
cfc0b37 @mgehre cmake: create win32 installer by 'make package'
mgehre authored
429 SET(CPACK_NSIS_MENU_LINKS "")
421128b @mgehre cmake: enable compression by upx
mgehre authored
430 #In release builds, we already strip symbols (see LDFLAGS), and compress by upx
431 #Therefore we cannot strip afterwards
432 SET(CPACK_STRIP_FILES FALSE)
cfc0b37 @mgehre cmake: create win32 installer by 'make package'
mgehre authored
433 SET(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/COPYING)
7128612 @mgehre cmake: change url to www.lightspark.org
mgehre authored
434 SET(CPACK_NSIS_HELP_LINK "http:////www.lightspark.org")
435 SET(CPACK_NSIS_URL_INFO_ABOUT "http:////www.lightspark.org")
cfc0b37 @mgehre cmake: create win32 installer by 'make package'
mgehre authored
436 SET(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/media/lightspark-logo.svg)
437 IF(WIN32)
e87f758 @mgehre cmake/win32: do not append version to Lightspark installation directory
mgehre authored
438 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Lightspark")
cfc0b37 @mgehre cmake: create win32 installer by 'make package'
mgehre authored
439 SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
440 WriteRegStr HKCU 'Software\\\\MozillaPlugins\\\\@lightspark.github.com/Lightspark;version=1' 'Description' 'Lightspark'
441 WriteRegStr HKCU 'Software\\\\MozillaPlugins\\\\@lightspark.github.com/Lightspark;version=1' 'ProductName' 'Lightspark'
442 WriteRegStr HKCU 'Software\\\\MozillaPlugins\\\\@lightspark.github.com/Lightspark;version=1' 'Vendor' 'Lightspark Team'
443 WriteRegStr HKCU 'Software\\\\MozillaPlugins\\\\@lightspark.github.com/Lightspark;version=1' 'Version' '1'
444 WriteRegStr HKCU 'Software\\\\MozillaPlugins\\\\@lightspark.github.com/Lightspark;version=1' 'Path' '$INSTDIR\\\\nplightsparkplugin.dll'
445 WriteRegStr HKCU 'Software\\\\MozillaPlugins\\\\@lightspark.github.com/Lightspark;version=1\\\\MimeTypes\\\\application/x-shockwave-flash' '' ''
446 ")
447 SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
448 DeleteRegKey HKLM 'Software\\\\MozillaPlugins\\\\@lightspark.github.com/Lightspark;version=1'
449 ")
450 ENDIF(WIN32)
451 #Must come after the definitions
452 INCLUDE(CPack)
Something went wrong with that request. Please try again.