Fix up CMake to create targets.

Change-Id: I4b0b71d0ab7e49e237bd928de690915cc3b86be2
This commit is contained in:
Vincent Rabaud 2018-07-24 09:20:21 +02:00
parent 907208f97e
commit 423f257930
2 changed files with 9 additions and 0 deletions

View File

@ -213,6 +213,10 @@ set_target_properties(webpdecoder PROPERTIES VERSION ${PACKAGE_VERSION}
parse_version(demux/Makefile.am webpdemux WEBP_DEMUX_SOVERSION)
set_target_properties(webpdemux PROPERTIES VERSION ${PACKAGE_VERSION}
SOVERSION ${WEBP_DEMUX_SOVERSION})
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/configure.ac CONFIGURE_FILE)
string(REGEX MATCH "AC_INIT\\([^\n]*\\[[0-9\\.]+\\]" TMP
${CONFIGURE_FILE})
string(REGEX MATCH "[0-9\\.]+" PROJECT_VERSION ${TMP})
# Define the libraries to install.
set(INSTALLED_LIBRARIES webpdecoder webp webpdemux)

View File

@ -1,5 +1,10 @@
set(WebP_VERSION @PROJECT_VERSION@)
set(WEBP_VERSION ${WebP_VERSION})
@PACKAGE_INIT@
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
set(WebP_INCLUDE_DIRS "webp")
set(WEBP_INCLUDE_DIRS ${WebP_INCLUDE_DIRS})
set(WebP_LIBRARIES "@INSTALLED_LIBRARIES@")