mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 14:32:49 +08:00
[mozjpeg]Fix installation files to the wrong directory (#5833)
* [jemalloc]Fix dll generated when generating static library
* Revert "[jemalloc]Fix dll generated when generating static library"
This reverts commit a833bf5593
.
* [mozjpeg]1.Fix installation files to the wrong directory. 2.Change how dynamic and static library built macros are used
This commit is contained in:
parent
72c574d9be
commit
7f13cec4e3
@ -1,3 +1,3 @@
|
||||
Source: mozjpeg
|
||||
Version: 3.2-1
|
||||
Version: 3.2-2
|
||||
Description: MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world's deployed decoders. It's compatible with libjpeg API and ABI, and can be used as a drop-in replacement for libjpeg.
|
||||
|
87
ports/mozjpeg/fix-install-error.patch
Normal file
87
ports/mozjpeg/fix-install-error.patch
Normal file
@ -0,0 +1,87 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index ac0ebdb..483bf0f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -875,43 +875,51 @@ add_custom_target(installer
|
||||
cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
|
||||
SOURCES mozjpeg.nsi)
|
||||
|
||||
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
+ set(REAL_BUILDS_PATH "Debug/")
|
||||
+else()
|
||||
+ set(REAL_BUILDS_PATH "Release/")
|
||||
+endif()
|
||||
+
|
||||
if(WITH_TURBOJPEG)
|
||||
if(ENABLE_SHARED)
|
||||
install(TARGETS turbojpeg tjbench
|
||||
- ARCHIVE DESTINATION lib
|
||||
- LIBRARY DESTINATION lib
|
||||
- RUNTIME DESTINATION bin)
|
||||
+ ARCHIVE DESTINATION lib/mozjpeg
|
||||
+ LIBRARY DESTINATION lib/mozjpeg
|
||||
+ RUNTIME DESTINATION tools/mozjpeg)
|
||||
endif()
|
||||
if(ENABLE_STATIC)
|
||||
- install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib)
|
||||
+ install(TARGETS turbojpeg-static
|
||||
+ LIBRARY DESTINATION lib/mozjpeg
|
||||
+ ARCHIVE DESTINATION lib/mozjpeg)
|
||||
if(NOT ENABLE_SHARED)
|
||||
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe
|
||||
- DESTINATION bin RENAME tjbench.exe)
|
||||
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/tjbench-static.exe
|
||||
+ DESTINATION tools/mozjpeg RENAME tjbench.exe)
|
||||
endif()
|
||||
endif()
|
||||
- install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include)
|
||||
+ install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include/mozjpeg)
|
||||
endif()
|
||||
|
||||
if(ENABLE_STATIC)
|
||||
- install(TARGETS jpeg-static ARCHIVE DESTINATION lib)
|
||||
+ install(TARGETS jpeg-static ARCHIVE DESTINATION lib/mozjpeg)
|
||||
if(NOT ENABLE_SHARED)
|
||||
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe
|
||||
- DESTINATION bin RENAME cjpeg.exe)
|
||||
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe
|
||||
- DESTINATION bin RENAME djpeg.exe)
|
||||
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe
|
||||
- DESTINATION bin RENAME jpegtran.exe)
|
||||
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/cjpeg-static.exe
|
||||
+ DESTINATION tools/mozjpeg RENAME cjpeg.exe)
|
||||
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/djpeg-static.exe
|
||||
+ DESTINATION tools/mozjpeg RENAME djpeg.exe)
|
||||
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${REAL_BUILDS_PATH}mozjpeg/jpegtran-static.exe
|
||||
+ DESTINATION tools/mozjpeg RENAME jpegtran.exe)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin)
|
||||
+install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION tools/mozjpeg)
|
||||
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README-mozilla.txt
|
||||
${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt
|
||||
${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt
|
||||
${CMAKE_SOURCE_DIR}/wizard.txt
|
||||
- DESTINATION doc)
|
||||
+ DESTINATION share/mozjpeg)
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h
|
||||
${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h
|
||||
- DESTINATION include)
|
||||
+ DESTINATION include/mozjpeg)
|
||||
diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt
|
||||
index 268cc14..d067d2a 100644
|
||||
--- a/sharedlib/CMakeLists.txt
|
||||
+++ b/sharedlib/CMakeLists.txt
|
||||
@@ -68,6 +68,6 @@ add_executable(jcstest ../jcstest.c)
|
||||
target_link_libraries(jcstest jpeg)
|
||||
|
||||
install(TARGETS jpeg cjpeg djpeg jpegtran
|
||||
- ARCHIVE DESTINATION lib
|
||||
- LIBRARY DESTINATION lib
|
||||
- RUNTIME DESTINATION bin)
|
||||
+ ARCHIVE DESTINATION lib/mozjpeg
|
||||
+ LIBRARY DESTINATION lib/mozjpeg
|
||||
+ RUNTIME DESTINATION tools/mozjpeg)
|
@ -6,6 +6,8 @@ vcpkg_from_github(
|
||||
REF v3.2
|
||||
SHA512 d14789827a9f4f78139a3945d3169d37eb891758b5ab40ef19e99ebebb2fb6d7c3a05495de245bba54cfd913b153af352159aa9fc0218127f97819137e0f1ab8
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-install-error.patch
|
||||
)
|
||||
|
||||
vcpkg_find_acquire_program(NASM)
|
||||
@ -13,9 +15,11 @@ get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
|
||||
set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
set(OPTIONS "-DENABLE_SHARED=FALSE")
|
||||
set(ENABLE_STATIC_BUILD ON)
|
||||
set(ENABLE_SHARED_BUILD OFF)
|
||||
else()
|
||||
set(OPTIONS "-DENABLE_STATIC=FALSE")
|
||||
set(ENABLE_STATIC_BUILD OFF)
|
||||
set(ENABLE_SHARED_BUILD ON)
|
||||
endif()
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL)
|
||||
@ -23,7 +27,8 @@ string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_CRT_DLL)
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS
|
||||
${OPTIONS}
|
||||
-DDENABLE_SHARED=${ENABLE_SHARED_BUILD}
|
||||
-DENABLE_STATIC=${ENABLE_STATIC_BUILD}
|
||||
-DWITH_CRT_DLL=${WITH_CRT_DLL}
|
||||
)
|
||||
|
||||
@ -31,15 +36,7 @@ vcpkg_install_cmake()
|
||||
|
||||
#remove extra debug files
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc)
|
||||
file(GLOB DEBUGEXES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
||||
file(REMOVE ${DEBUGEXES})
|
||||
|
||||
#move exes to tools
|
||||
file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/mozjpeg)
|
||||
file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/mozjpeg)
|
||||
file(REMOVE ${EXES})
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/mozjpeg)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user