[aseprite] 12/250: add submodule libwebp for #273
Tobias Hansen
thansen at moszumanska.debian.org
Sun Dec 20 15:27:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 884b5f2e6fd3a708780a43f0ae7662afaf0e926d
Author: Gabriel Rauter <rauter.gabriel at gmail.com>
Date: Tue Sep 1 13:04:11 2015 +0200
add submodule libwebp for #273
---
.gitmodules | 3 +++
CMakeLists.txt | 15 +++++++++++
third_party/CMakeLists.txt | 4 +++
third_party/libwebp | 1 +
third_party/libwebp-cmake/CMakeLists.txt | 45 ++++++++++++++++++++++++++++++++
5 files changed, 68 insertions(+)
diff --git a/.gitmodules b/.gitmodules
index 6d8632a..83da9fb 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -10,3 +10,6 @@
[submodule "third_party/duktape"]
path = third_party/duktape
url = https://github.com/aseprite/duktape.git
+[submodule "third_party/libwebp"]
+ path = third_party/libwebp
+ url = https://chromium.googlesource.com/webm/libwebp
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eff1bc0..a381608 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,6 +40,7 @@ option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off)
option(USE_SHARED_ZLIB "Use your installed copy of zlib" off)
option(USE_SHARED_LIBPNG "Use your installed copy of libpng" off)
option(USE_SHARED_LIBLOADPNG "Use your installed copy of libloadpng" off)
+option(USE_SHARED_LIBWEBP "Use your installed copy of libwebp" off)
option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off)
option(USE_SHARED_PIXMAN "Use your installed copy of pixman" off)
option(USE_SHARED_ALLEGRO4 "Use shared Allegro 4 library (without resize support)" off)
@@ -106,6 +107,7 @@ set(LIBFREETYPE_DIR ${CMAKE_SOURCE_DIR}/third_party/freetype)
set(LIBJPEG_DIR ${CMAKE_SOURCE_DIR}/third_party/jpeg)
set(LIBPNG_DIR ${CMAKE_SOURCE_DIR}/third_party/libpng)
set(LOADPNG_DIR ${CMAKE_SOURCE_DIR}/third_party/loadpng)
+set(LIBWEBP_DIR ${CMAKE_SOURCE_DIR}/third_party/libwebp)
set(MONGOOSE_DIR ${CMAKE_SOURCE_DIR}/third_party/mongoose)
set(PIXMAN_DIR ${CMAKE_SOURCE_DIR}/third_party/pixman)
set(SIMPLEINI_DIR ${CMAKE_SOURCE_DIR}/third_party/simpleini)
@@ -170,6 +172,19 @@ endif()
include_directories(${PNG_INCLUDE_DIR})
add_definitions(-DPNG_NO_MMX_CODE) # Do not use MMX optimizations in PNG code
+# libwebp
+if(USE_SHARED_LIBWEBP)
+ find_package(PkgConfig)
+ pkg_check_modules(WEBP libwebp)
+ if(NOT WEBP_FOUND)
+ message(FATAL_ERROR "libwebp not found")
+ endif()
+else()
+ set(WEBP_LIBRARIES webp)
+ set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src)
+endif()
+include_directories(${WEBP_INCLUDE_DIR})
+
# tinyxml
if(USE_SHARED_TINYXML)
find_library(TINYXML_LIBRARY NAMES tinyxml)
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 59cd5aa..9bcedd1 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -20,6 +20,10 @@ if(NOT USE_SHARED_LIBPNG)
add_subdirectory(libpng)
endif()
+if(NOT USE_SHARED_LIBWEBP)
+ add_subdirectory(libwebp-cmake)
+endif()
+
if(NOT USE_SHARED_GIFLIB)
add_subdirectory(giflib)
endif()
diff --git a/third_party/libwebp b/third_party/libwebp
new file mode 160000
index 0000000..03fb752
--- /dev/null
+++ b/third_party/libwebp
@@ -0,0 +1 @@
+Subproject commit 03fb75221c36ff773379eb5f018d7206f1ef30c9
diff --git a/third_party/libwebp-cmake/CMakeLists.txt b/third_party/libwebp-cmake/CMakeLists.txt
new file mode 100644
index 0000000..fad8869
--- /dev/null
+++ b/third_party/libwebp-cmake/CMakeLists.txt
@@ -0,0 +1,45 @@
+project (webp C)
+cmake_minimum_required(VERSION 2.6)
+
+add_definitions(-DNDEBUG -DWEBP_USE_THREAD)
+
+set(LIBWEBP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../libwebp")
+
+file(GLOB WEBP_DEC_SRCS
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${LIBWEBP_SOURCE_DIR}/src/dec/*c
+)
+
+file(GLOB WEBP_DEMUX_SRCS
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${LIBWEBP_SOURCE_DIR}/src/demux/*c
+)
+
+file(GLOB WEBP_DSP_SRCS
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${LIBWEBP_SOURCE_DIR}/src/dsp/*c
+)
+
+file(GLOB WEBP_ENC_SRCS
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${LIBWEBP_SOURCE_DIR}/src/enc/*c
+)
+
+file(GLOB WEBP_UTILS_SRCS
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${LIBWEBP_SOURCE_DIR}/src/utils/*c
+)
+
+file(GLOB WEBP_MUX_SRCS
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${LIBWEBP_SOURCE_DIR}/src/mux/*c
+)
+
+file(GLOB WEBP_HEADERS
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${LIBWEBP_SOURCE_DIR}/src/webp/*.h
+)
+
+SET(CMAKE_DEBUG_POSTFIX "d")
+set(WEBP_SOURCE ${WEBP_DEC_SRCS} ${WEBP_DEMUX_SRCS} ${WEBP_DSP_SRCS} ${WEBP_ENC_SRCS} ${WEBP_UTILS_SRCS} ${WEBP_MUX_SRC})
+add_library(${PROJECT_NAME} STATIC ${WEBP_SOURCE} ${WEBP_HEADERS})
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list