From cf9820bb86565fc21b68890749c8954c9cff1778 Mon Sep 17 00:00:00 2001 From: wangli28 <47812810+wangli28@users.noreply.github.com> Date: Fri, 19 Jul 2019 15:30:09 +0800 Subject: [PATCH] [armadillo] Fix installation path (#7041) --- ports/armadillo/CONTROL | 2 +- ports/armadillo/fix-CMakePath.patch | 13 +++++++++++++ ports/armadillo/portfile.cmake | 10 +++++++++- ports/armadillo/usage | 4 ++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 ports/armadillo/fix-CMakePath.patch create mode 100644 ports/armadillo/usage diff --git a/ports/armadillo/CONTROL b/ports/armadillo/CONTROL index 78f0a66c3..ef0c926a5 100644 --- a/ports/armadillo/CONTROL +++ b/ports/armadillo/CONTROL @@ -1,4 +1,4 @@ Source: armadillo -Version: 2019-04-16-3 +Version: 2019-04-16-4 Description: Armadillo is a high quality linear algebra library (matrix maths) for the C++ language, aiming towards a good balance between speed and ease of use Build-Depends: openblas (!osx), clapack (!osx) diff --git a/ports/armadillo/fix-CMakePath.patch b/ports/armadillo/fix-CMakePath.patch new file mode 100644 index 000000000..58cca5c64 --- /dev/null +++ b/ports/armadillo/fix-CMakePath.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9fea721..e6a273d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -473,7 +473,7 @@ install(EXPORT ArmadilloLibraryDepends DESTINATION + # and install it + set(ARMADILLO_INCLUDE_DIRS "${CMAKE_INSTALL_FULL_INCLUDEDIR}") + set(ARMADILLO_LIB_DIR "${CMAKE_INSTALL_FULL_LIBDIR}") +-set(ARMADILLO_CMAKE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/Armadillo/CMake") ++set(ARMADILLO_CMAKE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/Armadillo") + + + message(STATUS "Generating '${PROJECT_BINARY_DIR}/InstallFiles/ArmadilloConfig.cmake'") diff --git a/ports/armadillo/portfile.cmake b/ports/armadillo/portfile.cmake index 143591de6..4e5798f9b 100644 --- a/ports/armadillo/portfile.cmake +++ b/ports/armadillo/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_gitlab( HEAD_REF 9.400.x PATCHES remove_custom_modules.patch + fix-CMakePath.patch ) file(REMOVE ${SOURCE_PATH}/cmake_aux/Modules/ARMA_FindBLAS.cmake) @@ -31,6 +32,13 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/Armadillo) +file(GLOB SHARE_CONTENT ${CURRENT_PACKAGES_DIR}/share/Armadillo) +list(LENGTH SHARE_CONTENT SHARE_LEN) +if(SHARE_LEN EQUAL 0) + # On case sensitive file system there is an extra empty directory created that should be removed + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/Armadillo) +endif() + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/armadillo) file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/armadillo RENAME copyright) diff --git a/ports/armadillo/usage b/ports/armadillo/usage new file mode 100644 index 000000000..58066f6a9 --- /dev/null +++ b/ports/armadillo/usage @@ -0,0 +1,4 @@ +The package armadillo provides CMake targets: + + find_package(Armadillo CONFIG REQUIRED) + target_link_libraries(main PRIVATE ${ARMADILLO_LIBRARIES})