[shogun] Fix target.cmake path (#10246)

* [shogun] Fix target.cmake file path

* [shogun] Fix target.cmake file path

* Update the way to find dirent.h

* Add fix-dirent.patch
This commit is contained in:
NancyLi1013 2020-03-03 07:55:52 +08:00 committed by GitHub
parent 84b5d6462c
commit 129fb5a748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 12 deletions

View File

@ -1,4 +1,5 @@
Source: shogun Source: shogun
Version: 6.1.4 Version: 6.1.4-1
Build-Depends: bzip2, eigen3, liblzma, libxml2, openblas (x64&!osx), nlopt, rxcpp, snappy, zlib, protobuf, curl, lzo, dirent Build-Depends: bzip2, eigen3, liblzma, libxml2, openblas (x64&!osx), nlopt, rxcpp, snappy, zlib, protobuf, curl, lzo, dirent
Homepage: https://github.com/shogun-toolbox/shogun
Description: Unified and efficient Machine Learning Description: Unified and efficient Machine Learning

View File

@ -1 +0,0 @@
find_path(MSDIRENT_INCLUDE_DIR NAMES dirent.h)

View File

@ -0,0 +1,11 @@
diff --git a/cmake/ShogunConfig.cmake.in b/cmake/ShogunConfig.cmake.in
index e8e8035..a5097cb 100644
--- a/cmake/ShogunConfig.cmake.in
+++ b/cmake/ShogunConfig.cmake.in
@@ -2,5 +2,5 @@
set_and_check(shogun_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
-include("@PACKAGE_CONFIG_PACKAGE_DIR@/ShogunTargets.cmake")
+include("@PACKAGE_CONFIG_PACKAGE_DIR@/../../../share/shogun/ShogunTargets.cmake")
check_required_components(shogun)

View File

@ -0,0 +1,17 @@
diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt
index fd76961..396251c 100644
--- a/src/shogun/CMakeLists.txt
+++ b/src/shogun/CMakeLists.txt
@@ -170,10 +170,10 @@ IF(MSVC)
ENDIF()
# bundle dirent
- include(external/MSDirent)
+ find_path(MSDIRENT_INCLUDE_DIR NAMES dirent.h)
SHOGUN_INCLUDE_DIRS(SCOPE PUBLIC
$<BUILD_INTERFACE:${MSDIRENT_INCLUDE_DIR}>
- $<INSTALL_INTERFACE:include/shogun/lib/external/MSDirent>
+ $<INSTALL_INTERFACE:include>
)
target_link_libraries(shogun PUBLIC winmm)

View File

@ -1,5 +1,3 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
@ -16,12 +14,10 @@ vcpkg_from_github(
HEAD_REF master HEAD_REF master
PATCHES PATCHES
cmake.patch cmake.patch
cmake-config.in.patch
fix-dirent.patch
) )
file(REMOVE_RECURSE ${SOURCE_PATH}/cmake/external)
file(MAKE_DIRECTORY ${SOURCE_PATH}/cmake/external)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/MSDirent.cmake DESTINATION ${SOURCE_PATH}/cmake/external)
vcpkg_find_acquire_program(PYTHON3) vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path(${PYTHON3_DIR}) vcpkg_add_to_path(${PYTHON3_DIR})
@ -52,7 +48,6 @@ vcpkg_configure_cmake(
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_CURL=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_CURL=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BLAS=${CMAKE_DISABLE_FIND_PACKAGE_BLAS} -DCMAKE_DISABLE_FIND_PACKAGE_BLAS=${CMAKE_DISABLE_FIND_PACKAGE_BLAS}
-DINSTALL_TARGETS=shogun-static -DINSTALL_TARGETS=shogun-static
) )
@ -67,5 +62,4 @@ file(REMOVE_RECURSE
) )
# Handle copyright # Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/shogun) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/shogun/COPYING ${CURRENT_PACKAGES_DIR}/share/shogun/copyright)