Skip to content

Commit c6ccedf

Browse files
authored
Merge pull request #1 from mchiasson/hunter
Hunterized libwebp
2 parents 6b7a95f + 62697c4 commit c6ccedf

File tree

4 files changed

+590
-56
lines changed

4 files changed

+590
-56
lines changed

CMakeLists.txt

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
cmake_minimum_required(VERSION 2.8.7)
1+
cmake_minimum_required(VERSION 3.0)
2+
3+
include("cmake/HunterGate.cmake")
4+
HunterGate(
5+
URL "https://github.com/ruslo/hunter/archive/v0.20.14.tar.gz"
6+
SHA1 "18cdbf5c47abdda437c73bf5437b7c3c65afe47c"
7+
)
28

39
project(libwebp C)
410

11+
hunter_add_package(PNG)
12+
hunter_add_package(Jpeg)
13+
hunter_add_package(TIFF)
14+
hunter_add_package(giflib)
15+
516
# Options for coder / decoder executables.
617
option(WEBP_ENABLE_SIMD "Enable any SIMD optimization." ON)
718
option(WEBP_BUILD_CWEBP "Build the cwebp command line tool." OFF)
@@ -320,10 +331,7 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/webp/decode.h
320331
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux.h
321332
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux_types.h
322333
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h
323-
DESTINATION include/webp)
324-
install(TARGETS ${INSTALLED_LIBRARIES}
325-
LIBRARY DESTINATION lib
326-
ARCHIVE DESTINATION lib)
334+
DESTINATION include/webp COMPONENT Development)
327335

328336
# Create the CMake version file.
329337
include(CMakePackageConfigHelpers)
@@ -333,16 +341,28 @@ write_basic_package_version_file(
333341
COMPATIBILITY AnyNewerVersion
334342
)
335343

344+
set(targets_export_name "WebPTargets")
345+
336346
# Create the Config file.
337347
include(CMakePackageConfigHelpers)
338-
set(ConfigPackageLocation share/WebP/cmake/)
348+
set(ConfigPackageLocation lib/cmake/WebP)
339349
configure_package_config_file(
340350
${CMAKE_CURRENT_SOURCE_DIR}/cmake/WebPConfig.cmake.in
341351
${CMAKE_CURRENT_BINARY_DIR}/WebPConfig.cmake
342352
INSTALL_DESTINATION ${ConfigPackageLocation}
343353
)
344354

355+
install(TARGETS ${INSTALLED_LIBRARIES}
356+
EXPORT ${targets_export_name}
357+
LIBRARY DESTINATION lib COMPONENT Runtime
358+
ARCHIVE DESTINATION lib COMPONENT Development
359+
RUNTIME DESTINATION bin COMPONENT Runtime
360+
PUBLIC_HEADER DESTINATION include COMPONENT Development
361+
BUNDLE DESTINATION bin COMPONENT Runtime
362+
)
363+
345364
# Install the generated CMake files.
365+
install(EXPORT ${targets_export_name} NAMESPACE "WebP::" DESTINATION lib/cmake/WebP)
346366
install(
347367
FILES "${CMAKE_CURRENT_BINARY_DIR}/WebPConfigVersion.cmake"
348368
"${CMAKE_CURRENT_BINARY_DIR}/WebPConfig.cmake"

0 commit comments

Comments
 (0)