diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL index a6e886c4aee..d9db5b99d13 100644 --- a/ports/dlib/CONTROL +++ b/ports/dlib/CONTROL @@ -1,4 +1,4 @@ Source: dlib -Version: 19.4-3 +Version: 19.4-4 Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3 Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ diff --git a/ports/dlib/portfile.cmake b/ports/dlib/portfile.cmake index 2a5ae6f4473..6c1bad0f83a 100644 --- a/ports/dlib/portfile.cmake +++ b/ports/dlib/portfile.cmake @@ -8,43 +8,48 @@ include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dlib-19.4) vcpkg_download_distfile(ARCHIVE - URLS "http://dlib.net/files/dlib-19.4.tar.bz2" - FILENAME "dlib-19.4.tar.bz2" - SHA512 c5ae22c507b57a13d880d79e9671730829114d0276508b0a41b373d3abae9057d960fce84fafe1be468d943910853baaa70c88f2516e20a0c41f3895bf217f7b + URLS "http://dlib.net/files/dlib-19.4.tar.bz2" + FILENAME "dlib-19.4.tar.bz2" + SHA512 c5ae22c507b57a13d880d79e9671730829114d0276508b0a41b373d3abae9057d960fce84fafe1be468d943910853baaa70c88f2516e20a0c41f3895bf217f7b ) vcpkg_extract_source_archive(${ARCHIVE}) file(REMOVE_RECURSE ${SOURCE_PATH}/dlib/external/libjpeg) file(REMOVE_RECURSE ${SOURCE_PATH}/dlib/external/libpng) file(REMOVE_RECURSE ${SOURCE_PATH}/dlib/external/zlib) +# This fixes static builds; dlib doesn't pull in the needed transitive dependencies +file(READ "${SOURCE_PATH}/dlib/CMakeLists.txt" DLIB_CMAKE) +string(REPLACE "PNG_LIBRARY" "PNG_LIBRARIES" DLIB_CMAKE "${DLIB_CMAKE}") +file(WRITE "${SOURCE_PATH}/dlib/CMakeLists.txt" "${DLIB_CMAKE}") + vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DDLIB_LINK_WITH_SQLITE3=ON - -DDLIB_USE_FFTW=ON - -DDLIB_PNG_SUPPORT=ON - -DDLIB_JPEG_SUPPORT=ON - -DDLIB_USE_BLAS=OFF - -DDLIB_USE_LAPACK=OFF - -DDLIB_USE_CUDA=OFF - -DDLIB_GIF_SUPPORT=OFF - -DDLIB_USE_MKL_FFT=OFF - #-DDLIB_USE_CUDA=ON - OPTIONS_DEBUG - -DDLIB_ENABLE_ASSERTS=ON - #-DDLIB_ENABLE_STACK_TRACE=ON + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DDLIB_LINK_WITH_SQLITE3=ON + -DDLIB_USE_FFTW=ON + -DDLIB_PNG_SUPPORT=ON + -DDLIB_JPEG_SUPPORT=ON + -DDLIB_USE_BLAS=OFF + -DDLIB_USE_LAPACK=OFF + -DDLIB_USE_CUDA=OFF + -DDLIB_GIF_SUPPORT=OFF + -DDLIB_USE_MKL_FFT=OFF + #-DDLIB_USE_CUDA=ON + OPTIONS_DEBUG + -DDLIB_ENABLE_ASSERTS=ON + #-DDLIB_ENABLE_STACK_TRACE=ON ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) + # There is no way to suppress installation of the headers and resource files in debug build. file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) # Remove other files not required in package -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/all) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/test) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/travis) diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index c56b96cccfa..6fa096cbdbf 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -73,7 +73,9 @@ function(vcpkg_fixup_cmake_targets) "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake" "${DEBUG_SHARE}/*[Cc]onfig-version.cmake" ) - file(REMOVE ${UNUSED_FILES}) + if(UNUSED_FILES) + file(REMOVE ${UNUSED_FILES}) + endif() file(GLOB RELEASE_TARGETS "${RELEASE_SHARE}/*[Tt]argets-release.cmake"