diff --git a/ports/butteraugli/CMakeLists.txt b/ports/butteraugli/CMakeLists.txt index f3a59069ea7..3bd8a6c37f1 100644 --- a/ports/butteraugli/CMakeLists.txt +++ b/ports/butteraugli/CMakeLists.txt @@ -39,5 +39,5 @@ if(NOT DISABLE_INSTALL_TOOLS) endif() if(NOT DISABLE_INSTALL_HEADERS) - install(FILES butteraugli/butteraugli.h DESTINATION include) + install(FILES butteraugli/butteraugli.h DESTINATION include/butteraugli) endif() diff --git a/ports/guetzli/CMakeLists.txt b/ports/guetzli/CMakeLists.txt new file mode 100644 index 00000000000..5d594aabdd1 --- /dev/null +++ b/ports/guetzli/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.8.0) +project(guetzli) + +if(MSVC) + add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX) +endif() + +if(BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +find_path(butteraugli_include butteraugli/butteraugli.h) +find_library(butteraugli_library NAMES butteraugli_lib) +find_package(PNG REQUIRED) + +include_directories("." ${PNG_INCLUDE_DIRS} ${butteraugli_include}) + +file(GLOB guetzli_srcs "guetzli/*.cc") +file(GLOB guetzli_includes "guetzli/*.h") +list(REMOVE_ITEM guetzli_srcs "guetzli/guetzli.cc") + +add_library(guetzli_lib ${guetzli_srcs}) + +add_executable(guetzli guetzli/guetzli.cc) + +target_link_libraries(guetzli_lib ${butteraugli_library} ${PNG_LIBRARIES}) +target_link_libraries(guetzli guetzli_lib ${butteraugli_library} ${PNG_LIBRARIES}) + + +install( + TARGETS guetzli_lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +if(NOT DISABLE_INSTALL_TOOLS) + install ( + TARGETS guetzli + RUNTIME DESTINATION tools/guetzli + ) +endif() + +if(NOT DISABLE_INSTALL_HEADERS) + install(FILES ${guetzli_includes} DESTINATION include/guetzli) +endif() diff --git a/ports/guetzli/CONTROL b/ports/guetzli/CONTROL new file mode 100644 index 00000000000..9dab9f18f44 --- /dev/null +++ b/ports/guetzli/CONTROL @@ -0,0 +1,4 @@ +Source: guetzli +Version: 2017-09-02-cb5e4a86f69628 +Description: Perceptual JPEG encoder +Build-Depends: libpng, butteraugli diff --git a/ports/guetzli/portfile.cmake b/ports/guetzli/portfile.cmake new file mode 100644 index 00000000000..4fb0402bae1 --- /dev/null +++ b/ports/guetzli/portfile.cmake @@ -0,0 +1,24 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO google/guetzli + REF cb5e4a86f69628f685f2b78d7429e248ab83d8d7 + SHA512 695a87dc27573b8df74a7e7924e9b96a7bd375b1aae02e7b0fad800428d973cf17947d46ec7afefade2a86ebe3d39f3c3178aad1137b9dd013f5f85ee6569a75 + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/guetzli) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/guetzli RENAME copyright)