aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sinigardi <stesinigardi@hotmail.com>2019-05-03 20:43:35 +0200
committerVictor Romero <romerosanchezv@gmail.com>2019-05-03 11:43:35 -0700
commit5b2759be83d06c8089c6067c408dc946452d772d (patch)
treec49d9440a347bab81dd54705fdbff95b1adc16c9
parentdf482edfd946958dc4bad5ce6b9a8ad3a0d2bee4 (diff)
downloadvcpkg-5b2759be83d06c8089c6067c408dc946452d772d.tar.gz
vcpkg-5b2759be83d06c8089c6067c408dc946452d772d.zip
[dlib] port patch from #5169 (#6292)
-rw-r--r--ports/dlib/CONTROL16
-rw-r--r--ports/dlib/force_finding_packages.patch147
-rw-r--r--ports/dlib/portfile.cmake7
3 files changed, 159 insertions, 11 deletions
diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL
index 1de246923..638391c61 100644
--- a/ports/dlib/CONTROL
+++ b/ports/dlib/CONTROL
@@ -1,8 +1,8 @@
-Source: dlib
-Version: 19.16-2
-Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3, openblas, clapack
-Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++
-
-Feature: cuda
-Build-Depends: cuda
-Description: CUDA support for dlib
+Source: dlib
+Version: 19.16-2
+Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3, openblas (!osx), clapack
+Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++
+
+Feature: cuda
+Build-Depends: cuda
+Description: CUDA support for dlib
diff --git a/ports/dlib/force_finding_packages.patch b/ports/dlib/force_finding_packages.patch
new file mode 100644
index 000000000..a62ccf22d
--- /dev/null
+++ b/ports/dlib/force_finding_packages.patch
@@ -0,0 +1,147 @@
+diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt
+index d8a1362..088168c 100644
+--- a/dlib/CMakeLists.txt
++++ b/dlib/CMakeLists.txt
+@@ -410,68 +410,9 @@ if (NOT TARGET dlib)
+ endif()
+
+ if (DLIB_PNG_SUPPORT)
+- # try to find libpng
+- find_package(PNG QUIET)
+- # Make sure there isn't something wrong with the version of LIBPNG
+- # installed on this system. Also never link to anything from anaconda
+- # since it's probably broken.
+- if (PNG_FOUND AND NOT ("${PNG_INCLUDE_DIR}" MATCHES "(.*)(Ana|ana|mini)conda(.*)"))
+- set(CMAKE_REQUIRED_LIBRARIES ${PNG_LIBRARIES})
+- CHECK_FUNCTION_EXISTS(png_create_read_struct LIBPNG_IS_GOOD)
+- endif()
+- if (PNG_FOUND AND LIBPNG_IS_GOOD)
+- include_directories(${PNG_INCLUDE_DIR})
+- set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES})
+- set(REQUIRES_LIBS " libpng")
+- else()
+- # If we can't find libpng then statically compile it in.
+- include_directories(external/libpng external/zlib)
+- set(source_files ${source_files}
+- external/libpng/png.c
+- external/libpng/pngerror.c
+- external/libpng/pngget.c
+- external/libpng/pngmem.c
+- external/libpng/pngpread.c
+- external/libpng/pngread.c
+- external/libpng/pngrio.c
+- external/libpng/pngrtran.c
+- external/libpng/pngrutil.c
+- external/libpng/pngset.c
+- external/libpng/pngtrans.c
+- external/libpng/pngwio.c
+- external/libpng/pngwrite.c
+- external/libpng/pngwtran.c
+- external/libpng/pngwutil.c
+- external/zlib/adler32.c
+- external/zlib/compress.c
+- external/zlib/crc32.c
+- external/zlib/deflate.c
+- external/zlib/gzclose.c
+- external/zlib/gzlib.c
+- external/zlib/gzread.c
+- external/zlib/gzwrite.c
+- external/zlib/infback.c
+- external/zlib/inffast.c
+- external/zlib/inflate.c
+- external/zlib/inftrees.c
+- external/zlib/trees.c
+- external/zlib/uncompr.c
+- external/zlib/zutil.c
+- )
+-
+- include(cmake_utils/check_if_neon_available.cmake)
+- if (ARM_NEON_IS_AVAILABLE)
+- message (STATUS "NEON instructions will be used for libpng.")
+- enable_language(ASM)
+- set(source_files ${source_files}
+- external/libpng/arm/arm_init.c
+- external/libpng/arm/filter_neon_intrinsics.c
+- external/libpng/arm/filter_neon.S
+- )
+- set_source_files_properties(external/libpng/arm/filter_neon.S PROPERTIES COMPILE_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_CXX_FLAGS} -x assembler-with-cpp")
+- endif()
+- set(REQUIRES_LIBS "")
+- endif()
++ find_package(PNG REQUIRED)
++ include_directories(${PNG_INCLUDE_DIR})
++ set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES})
+ set(source_files ${source_files}
+ image_loader/png_loader.cpp
+ image_saver/save_png.cpp
+@@ -479,68 +420,8 @@ if (NOT TARGET dlib)
+ endif()
+
+ if (DLIB_JPEG_SUPPORT)
+- # try to find libjpeg
+- find_package(JPEG QUIET)
+- # Make sure there isn't something wrong with the version of libjpeg
+- # installed on this system. Also don't use the installed libjpeg
+- # if this is an APPLE system because apparently it's broken (as of 2015/01/01).
+- if (JPEG_FOUND AND NOT ("${JPEG_INCLUDE_DIR}" MATCHES "(.*)(Ana|ana|mini)conda(.*)"))
+- set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY})
+- CHECK_FUNCTION_EXISTS(jpeg_read_header LIBJPEG_IS_GOOD)
+- endif()
+- if (JPEG_FOUND AND LIBJPEG_IS_GOOD)
+- include_directories(${JPEG_INCLUDE_DIR})
+- set (dlib_needed_libraries ${dlib_needed_libraries} ${JPEG_LIBRARY})
+- else()
+- # If we can't find libjpeg then statically compile it in.
+- add_definitions(-DDLIB_JPEG_STATIC)
+- set(source_files ${source_files}
+- external/libjpeg/jcomapi.cpp
+- external/libjpeg/jdapimin.cpp
+- external/libjpeg/jdapistd.cpp
+- external/libjpeg/jdatasrc.cpp
+- external/libjpeg/jdcoefct.cpp
+- external/libjpeg/jdcolor.cpp
+- external/libjpeg/jddctmgr.cpp
+- external/libjpeg/jdhuff.cpp
+- external/libjpeg/jdinput.cpp
+- external/libjpeg/jdmainct.cpp
+- external/libjpeg/jdmarker.cpp
+- external/libjpeg/jdmaster.cpp
+- external/libjpeg/jdmerge.cpp
+- external/libjpeg/jdphuff.cpp
+- external/libjpeg/jdpostct.cpp
+- external/libjpeg/jdsample.cpp
+- external/libjpeg/jerror.cpp
+- external/libjpeg/jidctflt.cpp
+- external/libjpeg/jidctfst.cpp
+- external/libjpeg/jidctint.cpp
+- external/libjpeg/jidctred.cpp
+- external/libjpeg/jmemmgr.cpp
+- external/libjpeg/jmemnobs.cpp
+- external/libjpeg/jquant1.cpp
+- external/libjpeg/jquant2.cpp
+- external/libjpeg/jutils.cpp
+- external/libjpeg/jcapimin.cpp
+- external/libjpeg/jdatadst.cpp
+- external/libjpeg/jcparam.cpp
+- external/libjpeg/jcapistd.cpp
+- external/libjpeg/jcmarker.cpp
+- external/libjpeg/jcinit.cpp
+- external/libjpeg/jcmaster.cpp
+- external/libjpeg/jcdctmgr.cpp
+- external/libjpeg/jccoefct.cpp
+- external/libjpeg/jccolor.cpp
+- external/libjpeg/jchuff.cpp
+- external/libjpeg/jcmainct.cpp
+- external/libjpeg/jcphuff.cpp
+- external/libjpeg/jcprepct.cpp
+- external/libjpeg/jcsample.cpp
+- external/libjpeg/jfdctint.cpp
+- external/libjpeg/jfdctflt.cpp
+- external/libjpeg/jfdctfst.cpp
+- )
+- endif()
++ find_package(JPEG REQUIRED)
++ include_directories(${JPEG_INCLUDE_DIR})
+ set(source_files ${source_files}
+ image_loader/jpeg_loader.cpp
+ image_saver/save_jpeg.cpp
diff --git a/ports/dlib/portfile.cmake b/ports/dlib/portfile.cmake
index 730c27257..be4a877cf 100644
--- a/ports/dlib/portfile.cmake
+++ b/ports/dlib/portfile.cmake
@@ -11,6 +11,7 @@ vcpkg_from_github(
PATCHES
fix-mac-jpeg.patch
fix-sqlite3-fftw-linkage.patch
+ force_finding_packages.patch
)
file(REMOVE_RECURSE ${SOURCE_PATH}/dlib/external/libjpeg)
@@ -29,7 +30,7 @@ endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
+ PREFER_NINJA
OPTIONS
-DDLIB_LINK_WITH_SQLITE3=ON
-DDLIB_USE_FFTW=ON
@@ -40,7 +41,7 @@ vcpkg_configure_cmake(
-DDLIB_USE_CUDA=${WITH_CUDA}
-DDLIB_GIF_SUPPORT=OFF
-DDLIB_USE_MKL_FFT=OFF
- -DCMAKE_DEBUG_POSTFIX=d
+ -DCMAKE_DEBUG_POSTFIX=d
OPTIONS_DEBUG
-DDLIB_ENABLE_ASSERTS=ON
#-DDLIB_ENABLE_STACK_TRACE=ON
@@ -58,7 +59,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/all)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/appveyor)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/test)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/travis)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/travis)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_neon)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cudnn)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils/test_for_cuda)