2018-03-30 10:58:33 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2015-12-21 15:35:13 +01:00
|
|
|
|
2018-03-30 10:58:33 +02:00
|
|
|
project(WebP C)
|
2015-12-21 15:35:13 +01:00
|
|
|
|
|
|
|
# Options for coder / decoder executables.
|
2017-02-03 16:47:59 +01:00
|
|
|
option(WEBP_ENABLE_SIMD "Enable any SIMD optimization." ON)
|
2018-06-01 21:36:13 +02:00
|
|
|
option(WEBP_BUILD_ANIM_UTILS "Build animation utilities." ON)
|
2018-03-30 10:58:33 +02:00
|
|
|
option(WEBP_BUILD_CWEBP "Build the cwebp command line tool." ON)
|
|
|
|
option(WEBP_BUILD_DWEBP "Build the dwebp command line tool." ON)
|
|
|
|
option(WEBP_BUILD_GIF2WEBP "Build the gif2webp conversion tool." ON)
|
|
|
|
option(WEBP_BUILD_IMG2WEBP "Build the img2webp animation tool." ON)
|
2018-04-20 10:48:12 +02:00
|
|
|
option(WEBP_BUILD_VWEBP "Build the vwebp viewer tool." ON)
|
2018-03-30 10:58:33 +02:00
|
|
|
option(WEBP_BUILD_WEBPINFO "Build the webpinfo command line tool." ON)
|
2018-06-02 05:05:40 +02:00
|
|
|
option(WEBP_BUILD_WEBPMUX "Build the webpmux command line tool." ON)
|
2018-10-04 15:09:01 +02:00
|
|
|
option(WEBP_BUILD_EXTRAS "Build extras." ON)
|
2017-02-07 10:25:41 +01:00
|
|
|
option(WEBP_BUILD_WEBP_JS "Emscripten build of webp.js." OFF)
|
2018-03-30 10:58:33 +02:00
|
|
|
option(WEBP_NEAR_LOSSLESS "Enable near-lossless encoding" ON)
|
2018-10-05 11:32:39 +02:00
|
|
|
option(WEBP_ENABLE_SWAP_16BIT_CSP "Enable byte swap for 16 bit colorspaces."
|
|
|
|
OFF)
|
2015-12-21 15:35:13 +01:00
|
|
|
|
2017-02-07 10:25:41 +01:00
|
|
|
if(WEBP_BUILD_WEBP_JS)
|
|
|
|
set(WEBP_ENABLE_SIMD OFF)
|
|
|
|
endif()
|
|
|
|
|
2015-12-21 15:35:13 +01:00
|
|
|
set(WEBP_DEP_LIBRARIES)
|
|
|
|
set(WEBP_DEP_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2018-10-05 11:32:39 +02:00
|
|
|
set(CMAKE_BUILD_TYPE "Release"
|
|
|
|
CACHE "Build type: Release, Debug, MinSizeRel or RelWithDebInfo" STRING
|
|
|
|
FORCE)
|
2015-12-21 15:35:13 +01:00
|
|
|
endif()
|
|
|
|
|
2017-08-25 13:54:06 +02:00
|
|
|
# Include dependencies.
|
|
|
|
include(cmake/deps.cmake)
|
2018-03-30 10:58:33 +02:00
|
|
|
include(GNUInstallDirs)
|
2017-02-22 15:57:06 +01:00
|
|
|
|
2018-10-05 11:32:39 +02:00
|
|
|
# ##############################################################################
|
2016-08-05 09:45:34 +02:00
|
|
|
# Options.
|
|
|
|
if(WEBP_ENABLE_SWAP_16BIT_CSP)
|
2017-08-01 03:53:29 +02:00
|
|
|
add_definitions(-DWEBP_SWAP_16BIT_CSP=1)
|
2016-08-05 09:45:34 +02:00
|
|
|
endif()
|
|
|
|
|
2018-10-05 11:32:39 +02:00
|
|
|
# ##############################################################################
|
2016-08-05 09:26:32 +02:00
|
|
|
# Android only.
|
|
|
|
if(ANDROID)
|
|
|
|
include_directories(${ANDROID_NDK}/sources/android/cpufeatures)
|
|
|
|
add_library(cpufeatures STATIC
|
2018-10-05 11:32:39 +02:00
|
|
|
${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
|
2016-08-05 09:26:32 +02:00
|
|
|
target_link_libraries(cpufeatures dl)
|
|
|
|
set(WEBP_DEP_LIBRARIES ${WEBP_DEP_LIBRARIES} cpufeatures)
|
|
|
|
set(WEBP_DEP_INCLUDE_DIRS ${WEBP_DEP_INCLUDE_DIRS}
|
2018-10-05 11:32:39 +02:00
|
|
|
${ANDROID_NDK}/sources/android/cpufeatures)
|
2017-09-25 14:43:20 +02:00
|
|
|
add_definitions(-DHAVE_CPU_FEATURES_H=1)
|
2017-08-25 13:54:06 +02:00
|
|
|
set(HAVE_CPU_FEATURES_H 1)
|
|
|
|
else()
|
|
|
|
set(HAVE_CPU_FEATURES_H 0)
|
2016-08-05 09:26:32 +02:00
|
|
|
endif()
|
|
|
|
|
2018-10-05 11:32:39 +02:00
|
|
|
# ##############################################################################
|
|
|
|
# WebP source files. Read the Makefile.am to get the source files.
|
2015-12-21 15:35:13 +01:00
|
|
|
|
2018-10-05 11:32:39 +02:00
|
|
|
# We expect the Makefiles to define the sources as defined in the first regex.
|
|
|
|
# E.g.: libimagedec_la_SOURCES = image_dec.c image_dec.h
|
2017-01-31 16:22:32 +01:00
|
|
|
function(parse_Makefile_am FOLDER VAR SRC_REGEX)
|
2015-12-21 15:35:13 +01:00
|
|
|
file(READ ${FOLDER}/Makefile.am MAKEFILE_AM)
|
2018-10-05 11:32:39 +02:00
|
|
|
string(REGEX MATCHALL
|
|
|
|
"${SRC_REGEX}_SOURCES[ ]*\\+?=[ ]+[0-9a-z\\._ ]*"
|
|
|
|
FILES_PER_LINE
|
|
|
|
${MAKEFILE_AM})
|
2016-09-05 16:13:06 +02:00
|
|
|
set(SRCS ${${VAR}})
|
2015-12-21 15:35:13 +01:00
|
|
|
foreach(FILES ${FILES_PER_LINE})
|
2017-01-31 16:22:32 +01:00
|
|
|
string(FIND ${FILES} "=" OFFSET)
|
|
|
|
math(EXPR OFFSET "${OFFSET} + 2")
|
2018-10-05 11:32:39 +02:00
|
|
|
string(SUBSTRING ${FILES}
|
|
|
|
${OFFSET}
|
|
|
|
-1
|
|
|
|
FILES)
|
2017-01-31 16:22:32 +01:00
|
|
|
if(FILES)
|
2018-10-05 11:32:39 +02:00
|
|
|
string(REGEX MATCHALL
|
|
|
|
"[0-9a-z\\._]+"
|
|
|
|
FILES
|
|
|
|
${FILES})
|
2017-01-31 16:22:32 +01:00
|
|
|
foreach(FILE ${FILES})
|
|
|
|
list(APPEND SRCS ${FOLDER}/${FILE})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2015-12-21 15:35:13 +01:00
|
|
|
endforeach()
|
2016-09-05 16:13:06 +02:00
|
|
|
set(${VAR} ${SRCS} PARENT_SCOPE)
|
2015-12-21 15:35:13 +01:00
|
|
|
endfunction()
|
|
|
|
|
2017-01-31 16:22:32 +01:00
|
|
|
set(WEBP_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/dec "WEBP_DEC_SRCS" "")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/demux "WEBP_DEMUX_SRCS" "")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/dsp "WEBP_DSP_COMMON_SRCS" "COMMON")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/dsp "WEBP_DSP_ENC_SRCS" "ENC")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/dsp "WEBP_DSP_ENC_SRCS" "dsp_[^ ]*")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/dsp "WEBP_DSP_DEC_SRCS" "decode_[^ ]*")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/enc "WEBP_ENC_SRCS" "")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/utils "WEBP_UTILS_COMMON_SRCS" "COMMON")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/utils "WEBP_UTILS_ENC_SRCS" "ENC")
|
|
|
|
parse_makefile_am(${WEBP_SRC_DIR}/utils "WEBP_UTILS_DEC_SRCS" "decode_[^ ]*")
|
2015-12-21 15:35:13 +01:00
|
|
|
|
2016-08-05 09:26:32 +02:00
|
|
|
# Remove the files specific to SIMD we don't use.
|
2015-12-21 15:35:13 +01:00
|
|
|
foreach(FILE ${WEBP_SIMD_FILES_NOT_TO_INCLUDE})
|
2017-01-31 16:22:32 +01:00
|
|
|
list(REMOVE_ITEM WEBP_DSP_ENC_SRCS ${FILE})
|
|
|
|
list(REMOVE_ITEM WEBP_DSP_DEC_SRCS ${FILE})
|
2015-12-21 15:35:13 +01:00
|
|
|
endforeach()
|
|
|
|
|
2018-03-30 10:58:33 +02:00
|
|
|
# Generate the config.h file.
|
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake/config.h.in
|
2018-10-05 11:32:39 +02:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src/webp/config.h)
|
2018-03-30 10:58:33 +02:00
|
|
|
add_definitions(-DHAVE_CONFIG_H)
|
|
|
|
|
2018-10-05 11:32:39 +02:00
|
|
|
# ##############################################################################
|
2017-01-31 16:22:32 +01:00
|
|
|
# Build the webpdecoder library.
|
2017-11-16 03:41:34 +01:00
|
|
|
if(MSVC)
|
|
|
|
# avoid security warnings for e.g., fopen() used in the examples.
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
|
|
else()
|
2017-11-16 03:29:15 +01:00
|
|
|
add_definitions(-Wall)
|
|
|
|
endif()
|
2018-03-30 10:58:33 +02:00
|
|
|
include_directories(${WEBP_DEP_INCLUDE_DIRS})
|
2017-01-31 16:22:32 +01:00
|
|
|
add_library(webpdecode OBJECT ${WEBP_DEC_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_include_directories(webpdecode
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
2017-01-31 16:22:32 +01:00
|
|
|
add_library(webpdspdecode OBJECT ${WEBP_DSP_COMMON_SRCS} ${WEBP_DSP_DEC_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_include_directories(webpdspdecode
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_library(webputilsdecode
|
|
|
|
OBJECT
|
|
|
|
${WEBP_UTILS_COMMON_SRCS}
|
|
|
|
${WEBP_UTILS_DEC_SRCS})
|
|
|
|
target_include_directories(webputilsdecode
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_library(webpdecoder
|
|
|
|
$<TARGET_OBJECTS:webpdecode>
|
|
|
|
$<TARGET_OBJECTS:webpdspdecode>
|
|
|
|
$<TARGET_OBJECTS:webputilsdecode>)
|
2017-01-31 16:22:32 +01:00
|
|
|
target_link_libraries(webpdecoder ${WEBP_DEP_LIBRARIES})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_include_directories(
|
|
|
|
webpdecoder
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
|
2018-04-04 11:59:50 +02:00
|
|
|
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
2018-10-05 11:32:39 +02:00
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
|
|
|
set_target_properties(
|
|
|
|
webpdecoder
|
|
|
|
PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/webp/decode.h;\
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h")
|
2017-01-31 16:22:32 +01:00
|
|
|
|
|
|
|
# Build the webp library.
|
|
|
|
add_library(webpencode OBJECT ${WEBP_ENC_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_include_directories(webpencode
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_library(webpdsp
|
|
|
|
OBJECT
|
|
|
|
${WEBP_DSP_COMMON_SRCS}
|
|
|
|
${WEBP_DSP_DEC_SRCS}
|
|
|
|
${WEBP_DSP_ENC_SRCS})
|
|
|
|
target_include_directories(webpdsp
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_library(webputils
|
|
|
|
OBJECT
|
|
|
|
${WEBP_UTILS_COMMON_SRCS}
|
|
|
|
${WEBP_UTILS_DEC_SRCS}
|
|
|
|
${WEBP_UTILS_ENC_SRCS})
|
|
|
|
target_include_directories(webputils
|
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_library(webp
|
|
|
|
$<TARGET_OBJECTS:webpdecode>
|
|
|
|
$<TARGET_OBJECTS:webpdsp>
|
|
|
|
$<TARGET_OBJECTS:webpencode>
|
|
|
|
$<TARGET_OBJECTS:webputils>)
|
2015-12-21 15:35:13 +01:00
|
|
|
target_link_libraries(webp ${WEBP_DEP_LIBRARIES})
|
2018-03-30 10:58:33 +02:00
|
|
|
target_include_directories(webp
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2018-10-05 11:32:39 +02:00
|
|
|
PUBLIC $<INSTALL_INTERFACE:include>)
|
|
|
|
set_target_properties(
|
|
|
|
webp
|
|
|
|
PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/webp/decode.h;\
|
2018-03-30 10:58:33 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/encode.h;\
|
2018-10-05 11:32:39 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h")
|
|
|
|
|
|
|
|
# Make sure the OBJECT libraries are built with position independent code (it is
|
|
|
|
# not ON by default).
|
|
|
|
set_target_properties(webpdecode
|
|
|
|
webpdspdecode
|
|
|
|
webputilsdecode
|
|
|
|
webpencode
|
|
|
|
webpdsp
|
|
|
|
webputils
|
|
|
|
PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
2017-01-31 16:22:32 +01:00
|
|
|
|
|
|
|
# Build the webp demux library.
|
|
|
|
add_library(webpdemux ${WEBP_DEMUX_SRCS})
|
|
|
|
target_link_libraries(webpdemux webp)
|
2018-03-30 10:58:33 +02:00
|
|
|
target_include_directories(webpdemux
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2018-10-05 11:32:39 +02:00
|
|
|
PUBLIC $<INSTALL_INTERFACE:include>)
|
|
|
|
set_target_properties(
|
|
|
|
webpdemux
|
|
|
|
PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/webp/decode.h;\
|
2018-03-30 10:58:33 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/demux.h;\
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux_types.h;\
|
2018-10-05 11:32:39 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h")
|
2017-01-31 16:22:32 +01:00
|
|
|
|
2017-02-22 15:57:06 +01:00
|
|
|
# Set the version numbers.
|
|
|
|
function(parse_version FILE NAME VAR)
|
|
|
|
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/src/${FILE} SOURCE_FILE)
|
2018-10-05 11:32:39 +02:00
|
|
|
string(REGEX MATCH
|
|
|
|
"${NAME}_la_LDFLAGS[^\n]* -version-info [0-9:]+"
|
|
|
|
TMP
|
|
|
|
${SOURCE_FILE})
|
|
|
|
string(REGEX MATCH
|
|
|
|
"[0-9:]+"
|
|
|
|
TMP
|
|
|
|
${TMP})
|
|
|
|
string(REGEX
|
|
|
|
REPLACE ":"
|
|
|
|
"."
|
|
|
|
VERSION
|
|
|
|
${TMP})
|
2017-02-22 15:57:06 +01:00
|
|
|
set(${VAR} "${VERSION}" PARENT_SCOPE)
|
|
|
|
endfunction()
|
|
|
|
parse_version(Makefile.am webp WEBP_WEBP_SOVERSION)
|
2018-10-05 11:32:39 +02:00
|
|
|
set_target_properties(webp
|
|
|
|
PROPERTIES VERSION
|
|
|
|
${PACKAGE_VERSION}
|
|
|
|
SOVERSION
|
|
|
|
${WEBP_WEBP_SOVERSION})
|
2017-02-22 15:57:06 +01:00
|
|
|
parse_version(Makefile.am webpdecoder WEBP_DECODER_SOVERSION)
|
2018-10-05 11:32:39 +02:00
|
|
|
set_target_properties(webpdecoder
|
|
|
|
PROPERTIES VERSION
|
|
|
|
${PACKAGE_VERSION}
|
|
|
|
SOVERSION
|
|
|
|
${WEBP_DECODER_SOVERSION})
|
2017-02-22 15:57:06 +01:00
|
|
|
parse_version(demux/Makefile.am webpdemux WEBP_DEMUX_SOVERSION)
|
2018-10-05 11:32:39 +02:00
|
|
|
set_target_properties(webpdemux
|
|
|
|
PROPERTIES VERSION
|
|
|
|
${PACKAGE_VERSION}
|
|
|
|
SOVERSION
|
|
|
|
${WEBP_DEMUX_SOVERSION})
|
2018-07-24 09:20:21 +02:00
|
|
|
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/configure.ac CONFIGURE_FILE)
|
2018-10-05 11:32:39 +02:00
|
|
|
string(REGEX MATCH
|
|
|
|
"AC_INIT\\([^\n]*\\[[0-9\\.]+\\]"
|
|
|
|
TMP
|
|
|
|
${CONFIGURE_FILE})
|
|
|
|
string(REGEX MATCH
|
|
|
|
"[0-9\\.]+"
|
|
|
|
PROJECT_VERSION
|
|
|
|
${TMP})
|
2017-02-22 15:57:06 +01:00
|
|
|
|
|
|
|
# Define the libraries to install.
|
|
|
|
set(INSTALLED_LIBRARIES webpdecoder webp webpdemux)
|
|
|
|
|
2018-10-05 11:32:39 +02:00
|
|
|
# Deal with SIMD. Change the compile flags for SIMD files we use.
|
2015-12-21 15:35:13 +01:00
|
|
|
list(LENGTH WEBP_SIMD_FILES_TO_INCLUDE WEBP_SIMD_FILES_TO_INCLUDE_LENGTH)
|
|
|
|
math(EXPR WEBP_SIMD_FILES_TO_INCLUDE_RANGE
|
2018-10-05 11:32:39 +02:00
|
|
|
"${WEBP_SIMD_FILES_TO_INCLUDE_LENGTH}-1")
|
2015-12-21 15:35:13 +01:00
|
|
|
|
|
|
|
foreach(I_FILE RANGE ${WEBP_SIMD_FILES_TO_INCLUDE_RANGE})
|
|
|
|
list(GET WEBP_SIMD_FILES_TO_INCLUDE ${I_FILE} FILE)
|
|
|
|
list(GET WEBP_SIMD_FLAGS_TO_INCLUDE ${I_FILE} SIMD_COMPILE_FLAG)
|
2018-10-05 11:32:39 +02:00
|
|
|
set_source_files_properties(${FILE}
|
|
|
|
PROPERTIES
|
|
|
|
COMPILE_FLAGS
|
|
|
|
${SIMD_COMPILE_FLAG})
|
2015-12-21 15:35:13 +01:00
|
|
|
endforeach()
|
|
|
|
|
2018-10-01 13:47:25 +02:00
|
|
|
if(WEBP_BUILD_GIF2WEBP AND NOT GIF_FOUND)
|
|
|
|
set(WEBP_BUILD_GIF2WEBP OFF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WEBP_BUILD_ANIM_UTILS AND NOT GIF_FOUND)
|
|
|
|
set(WEBP_BUILD_ANIM_UTILS OFF)
|
|
|
|
endif()
|
|
|
|
|
2015-12-21 15:35:13 +01:00
|
|
|
# Build the executables if asked for.
|
2018-10-05 11:32:39 +02:00
|
|
|
if(WEBP_BUILD_ANIM_UTILS
|
|
|
|
OR WEBP_BUILD_CWEBP
|
|
|
|
OR WEBP_BUILD_DWEBP
|
|
|
|
OR WEBP_BUILD_GIF2WEBP
|
|
|
|
OR WEBP_BUILD_IMG2WEBP
|
|
|
|
OR WEBP_BUILD_VWEBP
|
|
|
|
OR WEBP_BUILD_WEBP_JS)
|
2015-12-21 15:35:13 +01:00
|
|
|
# Example utility library.
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "EXAMPLEUTIL_SRCS"
|
|
|
|
"example_util_[^ ]*")
|
|
|
|
list(APPEND EXAMPLEUTIL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/examples/stopwatch.h)
|
2017-01-31 16:22:32 +01:00
|
|
|
add_library(exampleutil ${EXAMPLEUTIL_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_include_directories(
|
|
|
|
exampleutil
|
2018-03-30 10:58:33 +02:00
|
|
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
|
2017-01-31 16:22:32 +01:00
|
|
|
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEIOUTILS_SRCS"
|
|
|
|
"imageio_util_[^ ]*")
|
2017-01-31 16:22:32 +01:00
|
|
|
add_library(imageioutil ${IMAGEIOUTILS_SRCS})
|
|
|
|
target_link_libraries(imageioutil webp)
|
2016-07-21 03:25:00 +02:00
|
|
|
|
2016-05-31 06:45:38 +02:00
|
|
|
# Image-decoding utility library.
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEDEC_SRCS"
|
|
|
|
"imagedec_[^ ]*")
|
2017-01-31 16:22:32 +01:00
|
|
|
add_library(imagedec ${IMAGEDEC_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_link_libraries(imagedec
|
|
|
|
imageioutil
|
|
|
|
webpdemux
|
|
|
|
webp
|
|
|
|
${WEBP_DEP_IMG_LIBRARIES})
|
2016-09-07 07:46:31 +02:00
|
|
|
|
|
|
|
# Image-encoding utility library.
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEENC_SRCS"
|
|
|
|
"imageenc_[^ ]*")
|
2017-01-31 16:22:32 +01:00
|
|
|
add_library(imageenc ${IMAGEENC_SRCS})
|
|
|
|
target_link_libraries(imageenc webp)
|
2017-10-07 23:15:11 +02:00
|
|
|
|
2018-10-05 11:32:39 +02:00
|
|
|
set_property(TARGET exampleutil
|
|
|
|
imageioutil
|
|
|
|
imagedec
|
|
|
|
imageenc
|
|
|
|
PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src)
|
2016-05-31 06:45:38 +02:00
|
|
|
endif()
|
|
|
|
|
2015-12-21 15:35:13 +01:00
|
|
|
if(WEBP_BUILD_DWEBP)
|
|
|
|
# dwebp
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "DWEBP_SRCS" "dwebp")
|
2017-01-31 16:22:32 +01:00
|
|
|
add_executable(dwebp ${DWEBP_SRCS})
|
2018-04-04 11:59:50 +02:00
|
|
|
target_link_libraries(dwebp exampleutil imagedec imageenc)
|
|
|
|
target_include_directories(dwebp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
2018-03-30 10:58:33 +02:00
|
|
|
install(TARGETS dwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2015-12-21 15:35:13 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WEBP_BUILD_CWEBP)
|
|
|
|
# cwebp
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "CWEBP_SRCS" "cwebp")
|
2017-01-31 16:22:32 +01:00
|
|
|
add_executable(cwebp ${CWEBP_SRCS})
|
|
|
|
target_link_libraries(cwebp exampleutil imagedec webp)
|
2018-04-04 11:59:50 +02:00
|
|
|
target_include_directories(cwebp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
2018-03-30 10:58:33 +02:00
|
|
|
install(TARGETS cwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2017-01-31 16:22:32 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP)
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "")
|
2018-06-02 05:05:40 +02:00
|
|
|
add_library(libwebpmux ${WEBP_MUX_SRCS})
|
|
|
|
target_link_libraries(libwebpmux webp)
|
|
|
|
target_include_directories(libwebpmux
|
2018-10-05 11:32:39 +02:00
|
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR})
|
2017-02-22 15:57:06 +01:00
|
|
|
parse_version(mux/Makefile.am webpmux WEBP_MUX_SOVERSION)
|
2018-10-05 11:32:39 +02:00
|
|
|
set_target_properties(libwebpmux
|
|
|
|
PROPERTIES VERSION
|
|
|
|
${PACKAGE_VERSION}
|
|
|
|
SOVERSION
|
|
|
|
${WEBP_MUX_SOVERSION})
|
|
|
|
set_target_properties(libwebpmux
|
|
|
|
PROPERTIES PUBLIC_HEADER
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux.h;\
|
2018-03-30 10:58:33 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux_types.h;\
|
2018-10-05 11:32:39 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h;")
|
2018-06-02 05:05:40 +02:00
|
|
|
set_target_properties(libwebpmux PROPERTIES OUTPUT_NAME webpmux)
|
|
|
|
list(APPEND INSTALLED_LIBRARIES libwebpmux)
|
2015-12-21 15:35:13 +01:00
|
|
|
endif()
|
2016-09-05 16:13:06 +02:00
|
|
|
|
|
|
|
if(WEBP_BUILD_GIF2WEBP)
|
|
|
|
# gif2webp
|
2017-07-06 20:45:47 +02:00
|
|
|
include_directories(${WEBP_DEP_GIF_INCLUDE_DIRS})
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "GIF2WEBP_SRCS"
|
|
|
|
"gif2webp")
|
2016-09-05 16:13:06 +02:00
|
|
|
add_executable(gif2webp ${GIF2WEBP_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_link_libraries(gif2webp
|
|
|
|
exampleutil
|
|
|
|
imageioutil
|
|
|
|
webp
|
|
|
|
libwebpmux
|
|
|
|
${WEBP_DEP_GIF_LIBRARIES})
|
2018-04-04 11:59:50 +02:00
|
|
|
target_include_directories(gif2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
2018-03-30 10:58:33 +02:00
|
|
|
install(TARGETS gif2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2016-09-05 16:13:06 +02:00
|
|
|
endif()
|
2016-12-02 11:44:17 +01:00
|
|
|
|
|
|
|
if(WEBP_BUILD_IMG2WEBP)
|
|
|
|
# img2webp
|
|
|
|
include_directories(${WEBP_DEP_IMG_INCLUDE_DIRS})
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "IMG2WEBP_SRCS"
|
|
|
|
"img2webp")
|
2016-12-02 11:44:17 +01:00
|
|
|
add_executable(img2webp ${IMG2WEBP_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_link_libraries(img2webp
|
|
|
|
exampleutil
|
|
|
|
imagedec
|
|
|
|
imageioutil
|
|
|
|
webp
|
|
|
|
libwebpmux)
|
2018-04-04 11:59:50 +02:00
|
|
|
target_include_directories(img2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
2018-03-30 10:58:33 +02:00
|
|
|
install(TARGETS img2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2016-12-02 11:44:17 +01:00
|
|
|
endif()
|
2017-02-07 10:25:41 +01:00
|
|
|
|
2018-04-20 10:48:12 +02:00
|
|
|
if(WEBP_BUILD_VWEBP)
|
|
|
|
# vwebp
|
|
|
|
find_package(GLUT)
|
|
|
|
if(GLUT_FOUND)
|
|
|
|
include_directories(${WEBP_DEP_IMG_INCLUDE_DIRS})
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "VWEBP_SRCS" "vwebp")
|
2018-04-20 10:48:12 +02:00
|
|
|
add_executable(vwebp ${VWEBP_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_link_libraries(vwebp
|
|
|
|
${OPENGL_LIBRARIES}
|
|
|
|
exampleutil
|
|
|
|
GLUT::GLUT
|
|
|
|
imageioutil
|
|
|
|
webp
|
|
|
|
webpdemux)
|
|
|
|
target_include_directories(vwebp
|
|
|
|
PRIVATE GLUT::GLUT
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src
|
|
|
|
${OPENGL_INCLUDE_DIR})
|
2018-04-20 10:48:12 +02:00
|
|
|
install(TARGETS vwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2018-04-21 04:57:16 +02:00
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
|
|
|
check_c_compiler_flag("-Wno-deprecated-declarations" HAS_NO_DEPRECATED)
|
|
|
|
if(HAS_NO_DEPRECATED)
|
|
|
|
target_compile_options(vwebp PRIVATE "-Wno-deprecated-declarations")
|
|
|
|
endif()
|
|
|
|
endif()
|
2018-04-20 10:48:12 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2018-06-02 05:09:03 +02:00
|
|
|
if(WEBP_BUILD_WEBPINFO)
|
2017-03-24 04:37:52 +01:00
|
|
|
# webpinfo
|
|
|
|
include_directories(${WEBP_DEP_IMG_INCLUDE_DIRS})
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "WEBPINFO_SRCS"
|
|
|
|
"webpinfo")
|
2017-03-24 04:37:52 +01:00
|
|
|
add_executable(webpinfo ${WEBPINFO_SRCS})
|
|
|
|
target_link_libraries(webpinfo exampleutil imageioutil)
|
2018-04-04 11:59:50 +02:00
|
|
|
target_include_directories(webpinfo PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
2018-03-30 10:58:33 +02:00
|
|
|
install(TARGETS webpinfo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2017-03-24 04:37:52 +01:00
|
|
|
endif()
|
|
|
|
|
2018-06-02 05:05:40 +02:00
|
|
|
if(WEBP_BUILD_WEBPMUX)
|
|
|
|
# webpmux
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "WEBPMUX_SRCS"
|
|
|
|
"webpmux")
|
2018-06-02 05:05:40 +02:00
|
|
|
add_executable(webpmux ${WEBPMUX_SRCS})
|
|
|
|
target_link_libraries(webpmux exampleutil imageioutil libwebpmux webp)
|
|
|
|
target_include_directories(webpmux PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
|
|
|
install(TARGETS webpmux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
|
2018-10-04 15:09:01 +02:00
|
|
|
if(WEBP_BUILD_EXTRAS)
|
|
|
|
set(EXTRAS_MAKEFILE "${CMAKE_CURRENT_SOURCE_DIR}/extras")
|
2018-10-05 11:32:39 +02:00
|
|
|
parse_makefile_am(${EXTRAS_MAKEFILE} "WEBP_EXTRAS_SRCS" "libwebpextras_la")
|
|
|
|
parse_makefile_am(${EXTRAS_MAKEFILE} "GET_DISTO_SRCS" "get_disto")
|
|
|
|
parse_makefile_am(${EXTRAS_MAKEFILE} "WEBP_QUALITY_SRCS" "webp_quality")
|
|
|
|
parse_makefile_am(${EXTRAS_MAKEFILE} "VWEBP_SDL_SRCS" "vwebp_sdl")
|
2018-10-04 15:09:01 +02:00
|
|
|
|
|
|
|
# get_disto
|
|
|
|
add_executable(get_disto ${GET_DISTO_SRCS})
|
|
|
|
target_link_libraries(get_disto imagedec)
|
2018-10-05 11:32:39 +02:00
|
|
|
target_include_directories(get_disto
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src)
|
2018-10-04 15:09:01 +02:00
|
|
|
install(TARGETS get_disto RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
|
|
|
# webp_quality
|
|
|
|
add_executable(webp_quality ${WEBP_QUALITY_SRCS} ${WEBP_EXTRAS_SRCS})
|
|
|
|
target_link_libraries(webp_quality exampleutil imagedec)
|
|
|
|
target_include_directories(webp_quality PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
install(TARGETS webp_quality RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
|
|
|
# vwebp_sdl
|
|
|
|
find_package(SDL)
|
|
|
|
if(SDL_FOUND)
|
|
|
|
add_executable(vwebp_sdl ${VWEBP_SDL_SRCS})
|
|
|
|
target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp)
|
2018-10-05 11:32:39 +02:00
|
|
|
target_include_directories(vwebp_sdl
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/src
|
|
|
|
${SDL_INCLUDE_DIR})
|
2018-10-04 15:09:01 +02:00
|
|
|
set(WEBP_HAVE_SDL 1)
|
|
|
|
target_compile_definitions(vwebp_sdl PUBLIC WEBP_HAVE_SDL)
|
|
|
|
install(TARGETS vwebp_sdl RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-02-07 10:25:41 +01:00
|
|
|
if(WEBP_BUILD_WEBP_JS)
|
2017-03-20 14:03:57 +01:00
|
|
|
# JavaScript version
|
2018-04-04 11:59:50 +02:00
|
|
|
add_executable(webp_js ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)
|
2017-02-07 10:25:41 +01:00
|
|
|
target_link_libraries(webp_js webpdecoder SDL)
|
2018-04-04 11:59:50 +02:00
|
|
|
target_include_directories(webp_js PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2017-08-25 13:54:06 +02:00
|
|
|
set(WEBP_HAVE_SDL 1)
|
2018-10-05 11:32:39 +02:00
|
|
|
set_target_properties(
|
|
|
|
webp_js
|
|
|
|
PROPERTIES LINK_FLAGS
|
|
|
|
"-s EXPORTED_FUNCTIONS='[\"_WebpToSDL\"]' -s INVOKE_RUN=0 \
|
2018-04-03 13:55:33 +02:00
|
|
|
-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")
|
2017-02-07 10:25:41 +01:00
|
|
|
set_target_properties(webp_js PROPERTIES OUTPUT_NAME webp)
|
|
|
|
target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
|
2017-03-20 14:03:57 +01:00
|
|
|
|
|
|
|
# WASM version
|
2018-04-04 11:59:50 +02:00
|
|
|
add_executable(webp_wasm ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)
|
2017-03-20 14:03:57 +01:00
|
|
|
target_link_libraries(webp_wasm webpdecoder SDL)
|
2018-04-04 11:59:50 +02:00
|
|
|
target_include_directories(webp_wasm PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2018-10-05 11:32:39 +02:00
|
|
|
set_target_properties(
|
|
|
|
webp_wasm
|
|
|
|
PROPERTIES LINK_FLAGS "-s WASM=1 -s 'BINARYEN_METHOD=\"native-wasm\"' \
|
2018-04-03 13:55:33 +02:00
|
|
|
-s EXPORTED_FUNCTIONS='[\"_WebpToSDL\"]' -s INVOKE_RUN=0 \
|
|
|
|
-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")
|
2017-03-20 14:03:57 +01:00
|
|
|
target_compile_definitions(webp_wasm PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
|
|
|
|
|
2018-04-04 11:59:50 +02:00
|
|
|
target_compile_definitions(webpdspdecode PUBLIC EMSCRIPTEN)
|
2017-02-07 10:25:41 +01:00
|
|
|
endif()
|
2017-02-22 15:57:06 +01:00
|
|
|
|
2018-06-01 21:36:13 +02:00
|
|
|
if(WEBP_BUILD_ANIM_UTILS)
|
|
|
|
# anim_diff
|
2018-10-05 11:32:39 +02:00
|
|
|
include_directories(${WEBP_DEP_IMG_INCLUDE_DIRS} ${WEBP_DEP_GIF_INCLUDE_DIRS})
|
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "ANIM_DIFF_SRCS"
|
|
|
|
"anim_diff")
|
2018-06-01 21:36:13 +02:00
|
|
|
add_executable(anim_diff ${ANIM_DIFF_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_link_libraries(anim_diff
|
|
|
|
exampleutil
|
|
|
|
imagedec
|
|
|
|
imageenc
|
|
|
|
imageioutil
|
|
|
|
webp
|
|
|
|
libwebpmux
|
|
|
|
webpdemux
|
|
|
|
${WEBP_DEP_GIF_LIBRARIES})
|
2018-06-01 21:36:13 +02:00
|
|
|
target_include_directories(anim_diff PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
|
|
|
|
|
|
|
# anim_dump
|
2018-10-05 11:32:39 +02:00
|
|
|
include_directories(${WEBP_DEP_IMG_INCLUDE_DIRS} ${WEBP_DEP_GIF_INCLUDE_DIRS})
|
|
|
|
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "ANIM_DUMP_SRCS"
|
|
|
|
"anim_dump")
|
2018-06-01 21:36:13 +02:00
|
|
|
add_executable(anim_dump ${ANIM_DUMP_SRCS})
|
2018-10-05 11:32:39 +02:00
|
|
|
target_link_libraries(anim_dump
|
|
|
|
exampleutil
|
|
|
|
imagedec
|
|
|
|
imageenc
|
|
|
|
imageioutil
|
|
|
|
webp
|
|
|
|
libwebpmux
|
|
|
|
webpdemux
|
|
|
|
${WEBP_DEP_GIF_LIBRARIES})
|
2018-06-01 21:36:13 +02:00
|
|
|
target_include_directories(anim_dump PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
|
|
|
endif()
|
|
|
|
|
2017-02-22 15:57:06 +01:00
|
|
|
# Install the different headers and libraries.
|
2018-03-30 10:58:33 +02:00
|
|
|
include(GNUInstallDirs)
|
2018-10-05 11:32:39 +02:00
|
|
|
install(TARGETS ${INSTALLED_LIBRARIES}
|
|
|
|
EXPORT ${PROJECT_NAME}Targets
|
|
|
|
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webp
|
|
|
|
INCLUDES
|
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2018-03-30 10:58:33 +02:00
|
|
|
set(ConfigPackageLocation ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake/)
|
|
|
|
install(EXPORT ${PROJECT_NAME}Targets
|
|
|
|
NAMESPACE ${PROJECT_NAME}::
|
2018-10-05 11:32:39 +02:00
|
|
|
DESTINATION ${ConfigPackageLocation})
|
2017-02-22 15:57:06 +01:00
|
|
|
|
|
|
|
# Create the CMake version file.
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
write_basic_package_version_file(
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/WebPConfigVersion.cmake"
|
2017-08-25 13:54:06 +02:00
|
|
|
VERSION ${PACKAGE_VERSION}
|
2018-10-05 11:32:39 +02:00
|
|
|
COMPATIBILITY AnyNewerVersion)
|
2017-02-22 15:57:06 +01:00
|
|
|
|
|
|
|
# Create the Config file.
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
configure_package_config_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/WebPConfig.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/WebPConfig.cmake
|
2018-10-05 11:32:39 +02:00
|
|
|
INSTALL_DESTINATION
|
|
|
|
${ConfigPackageLocation})
|
2017-02-22 15:57:06 +01:00
|
|
|
|
|
|
|
# Install the generated CMake files.
|
2018-10-05 11:32:39 +02:00
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/WebPConfigVersion.cmake"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/WebPConfig.cmake"
|
|
|
|
DESTINATION ${ConfigPackageLocation})
|
2017-05-09 11:41:48 +02:00
|
|
|
|
|
|
|
# Install the man pages.
|
2018-10-05 11:32:39 +02:00
|
|
|
set(MAN_PAGES
|
|
|
|
cwebp.1
|
|
|
|
dwebp.1
|
|
|
|
gif2webp.1
|
|
|
|
img2webp.1
|
|
|
|
vwebp.1
|
|
|
|
webpmux.1
|
|
|
|
webpinfo.1)
|
|
|
|
set(EXEC_BUILDS
|
|
|
|
"CWEBP"
|
|
|
|
"DWEBP"
|
|
|
|
"GIF2WEBP"
|
|
|
|
"IMG2WEBP"
|
|
|
|
"VWEBP"
|
|
|
|
"WEBPMUX"
|
|
|
|
"WEBPINFO")
|
2017-05-09 11:41:48 +02:00
|
|
|
list(LENGTH MAN_PAGES MAN_PAGES_LENGTH)
|
|
|
|
math(EXPR MAN_PAGES_RANGE "${MAN_PAGES_LENGTH} - 1")
|
|
|
|
|
|
|
|
foreach(I_MAN RANGE ${MAN_PAGES_RANGE})
|
|
|
|
list(GET EXEC_BUILDS ${I_MAN} EXEC_BUILD)
|
|
|
|
if(WEBP_BUILD_${EXEC_BUILD})
|
|
|
|
list(GET MAN_PAGES ${I_MAN} MAN_PAGE)
|
|
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man/${MAN_PAGE}
|
2018-10-05 11:32:39 +02:00
|
|
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
|
|
|
|
COMPONENT doc)
|
2017-05-09 11:41:48 +02:00
|
|
|
endif()
|
|
|
|
endforeach()
|