Disable webp support by default (related to #799)

There is a new WITH_WEBP_SUPPORT cmake option to enable webp support.
This commit is contained in:
David Capello 2015-09-07 14:43:31 -03:00
parent 361973d880
commit 2a0f8ca536
4 changed files with 42 additions and 21 deletions

View File

@ -33,6 +33,8 @@ project(aseprite C CXX)
# Options (these can be specified in cmake command line or modifying
# CMakeCache.txt)
option(WITH_WEBP_SUPPORT "Enable support to load/save .webp files" off)
option(USE_STATIC_LIBC "Use static version of C and C++ runtimes" off)
option(USE_SHARED_CURL "Use your installed copy of curl" off)
option(USE_SHARED_GIFLIB "Use your installed copy of giflib" off)
@ -173,17 +175,19 @@ 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")
if(WITH_WEBP_SUPPORT)
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()
else()
set(WEBP_LIBRARIES webp)
set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src)
include_directories(${WEBP_INCLUDE_DIR})
endif()
include_directories(${WEBP_INCLUDE_DIR})
# tinyxml
if(USE_SHARED_TINYXML)

View File

@ -56,6 +56,10 @@ list(APPEND generated_files ${output_fn})
# Directory where generated files by "gen" utility will stay.
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(WITH_WEBP_SUPPORT)
add_definitions(-DASEPRITE_WITH_WEBP_SUPPORT)
endif()
######################################################################
# app-lib target
@ -70,6 +74,20 @@ if(NOT ENABLE_TRIAL_MODE)
ui/data_recovery_view.cpp)
endif()
set(file_formats
file/ase_format.cpp
file/bmp_format.cpp
file/fli_format.cpp
file/gif_format.cpp
file/ico_format.cpp
file/jpeg_format.cpp
file/pcx_format.cpp
file/png_format.cpp
file/tga_format.cpp)
if(WITH_WEBP_SUPPORT)
list(APPEND file_formats file/webp_format.cpp)
endif()
add_library(app-lib
app.cpp
app_menus.cpp
@ -259,22 +277,13 @@ add_library(app-lib
document_range_ops.cpp
document_undo.cpp
extra_cel.cpp
file/ase_format.cpp
file/bmp_format.cpp
file/file.cpp
file/file_format.cpp
file/file_formats_manager.cpp
file/fli/fli.cpp
file/fli_format.cpp
file/gif_format.cpp
file/ico_format.cpp
file/jpeg_format.cpp
file/palette_file.cpp
file/pcx_format.cpp
file/png_format.cpp
file/split_filename.cpp
file/tga_format.cpp
file/webp_format.cpp
${file_formats}
file_selector.cpp
file_system.cpp
filename_formatter.cpp

View File

@ -29,7 +29,10 @@ extern FileFormat* CreateJpegFormat();
extern FileFormat* CreatePcxFormat();
extern FileFormat* CreatePngFormat();
extern FileFormat* CreateTgaFormat();
#ifdef ASEPRITE_WITH_WEBP_SUPPORT
extern FileFormat* CreateWebPFormat();
#endif
static FileFormatsManager* singleton = NULL;
@ -68,7 +71,10 @@ void FileFormatsManager::registerAllFormats()
registerFormat(CreatePcxFormat());
registerFormat(CreatePngFormat());
registerFormat(CreateTgaFormat());
#ifdef ASEPRITE_WITH_WEBP_SUPPORT
registerFormat(CreateWebPFormat());
#endif
}
void FileFormatsManager::registerFormat(FileFormat* fileFormat)

View File

@ -20,8 +20,10 @@ if(NOT USE_SHARED_LIBPNG)
add_subdirectory(libpng)
endif()
if(NOT USE_SHARED_LIBWEBP)
add_subdirectory(libwebp-cmake)
if(WITH_WEBP_SUPPORT)
if(NOT USE_SHARED_LIBWEBP)
add_subdirectory(libwebp-cmake)
endif()
endif()
if(NOT USE_SHARED_GIFLIB)