diff options
Diffstat (limited to 'vcpkg/ports/armadillo')
| -rw-r--r-- | vcpkg/ports/armadillo/cmake-config.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/armadillo/dependencies.patch | 45 | ||||
| -rw-r--r-- | vcpkg/ports/armadillo/pkgconfig.patch | 9 | ||||
| -rw-r--r-- | vcpkg/ports/armadillo/portfile.cmake | 56 | ||||
| -rw-r--r-- | vcpkg/ports/armadillo/usage | 10 | ||||
| -rw-r--r-- | vcpkg/ports/armadillo/vcpkg-cmake-wrapper.cmake | 15 | ||||
| -rw-r--r-- | vcpkg/ports/armadillo/vcpkg.json | 20 |
7 files changed, 168 insertions, 0 deletions
diff --git a/vcpkg/ports/armadillo/cmake-config.patch b/vcpkg/ports/armadillo/cmake-config.patch new file mode 100644 index 0000000..d0bb5a9 --- /dev/null +++ b/vcpkg/ports/armadillo/cmake-config.patch @@ -0,0 +1,13 @@ +diff --git a/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in b/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in +index bfe74ac..9caf2c8 100644 +--- a/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in ++++ b/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in +@@ -9,7 +9,7 @@ set(ARMADILLO_INCLUDE_DIRS "@ARMADILLO_INCLUDE_DIRS@") + set(ARMADILLO_LIBRARY_DIRS "@ARMADILLO_LIB_DIR@") + + # Our library dependencies (contains definitions for IMPORTED targets) +-include("@ARMADILLO_CMAKE_DIR@/ArmadilloLibraryDepends.cmake") ++include("${CMAKE_CURRENT_LIST_DIR}/ArmadilloLibraryDepends.cmake") + + # These are IMPORTED targets created by ArmadilloLibraryDepends.cmake + set(ARMADILLO_LIBRARIES armadillo) diff --git a/vcpkg/ports/armadillo/dependencies.patch b/vcpkg/ports/armadillo/dependencies.patch new file mode 100644 index 0000000..6dd2221 --- /dev/null +++ b/vcpkg/ports/armadillo/dependencies.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5b27e3c..78d3952 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -260,7 +260,6 @@ message(STATUS "*** Looking for external libraries") + ## Find LAPACK and BLAS libraries, or their optimised versions + ## + +-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/") + + if(APPLE) + message(STATUS "Detected macOS") +@@ -331,11 +330,16 @@ else() + set(FlexiBLAS_FOUND false) + endif() + ++ if(0) + include(ARMA_FindMKL) + include(ARMA_FindOpenBLAS) + include(ARMA_FindATLAS) # TODO: remove support for ATLAS in next major version + include(ARMA_FindBLAS) + include(ARMA_FindLAPACK) ++ else() ++ find_package(BLAS REQUIRED) ++ find_package(LAPACK REQUIRED) ++ endif() + + message(STATUS "FlexiBLAS_FOUND = ${FlexiBLAS_FOUND}" ) + message(STATUS " MKL_FOUND = ${MKL_FOUND}" ) +@@ -449,7 +453,6 @@ else() + endif() + + +-include(ARMA_FindARPACK) + message(STATUS "ARPACK_FOUND = ${ARPACK_FOUND}") + + if(ARPACK_FOUND) +@@ -457,7 +460,6 @@ if(ARPACK_FOUND) + set(ARMA_LIBS ${ARMA_LIBS} ${ARPACK_LIBRARY}) + endif() + +-include(ARMA_FindSuperLU5) + message(STATUS "SuperLU_FOUND = ${SuperLU_FOUND}") + + if(SuperLU_FOUND) diff --git a/vcpkg/ports/armadillo/pkgconfig.patch b/vcpkg/ports/armadillo/pkgconfig.patch new file mode 100644 index 0000000..5485462 --- /dev/null +++ b/vcpkg/ports/armadillo/pkgconfig.patch @@ -0,0 +1,9 @@ +diff --git a/misc/armadillo.pc.in b/misc/armadillo.pc.in +index 27d35bb..1f079a5 100644 +--- a/misc/armadillo.pc.in ++++ b/misc/armadillo.pc.in +@@ -7,3 +7,4 @@ URL: http://arma.sourceforge.net + Version: @ARMA_VERSION_MAJOR@.@ARMA_VERSION_MINOR@.@ARMA_VERSION_PATCH@ + Cflags: -I${includedir} + Libs: -L${libdir} -larmadillo ++Requires.private: @REQUIRES_PRIVATE@ diff --git a/vcpkg/ports/armadillo/portfile.cmake b/vcpkg/ports/armadillo/portfile.cmake new file mode 100644 index 0000000..5d60457 --- /dev/null +++ b/vcpkg/ports/armadillo/portfile.cmake @@ -0,0 +1,56 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO arma + FILENAME "armadillo-${VERSION}.tar.xz" + SHA512 E5983B109242F522561A16A4C5F095F25A8F5262E9E6A5C8AC9D7FA48B1F1B1C3A2E48D5671EB02C478B378BC1759BACE9AC061434C42E7338C0C2D21779F607 + PATCHES + cmake-config.patch + dependencies.patch + pkgconfig.patch +) + +set(REQUIRES_PRIVATE "") +foreach(module IN ITEMS lapack blas) + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/${module}.pc") + string(APPEND REQUIRES_PRIVATE " ${module}") + endif() +endforeach() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DALLOW_FLEXIBLAS_LINUX=OFF + "-DREQUIRES_PRIVATE=${REQUIRES_PRIVATE}" + -DBUILD_SMOKE_TEST=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME Armadillo CONFIG_PATH share/Armadillo/CMake) +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/Armadillo/ArmadilloConfig.cmake" + [[include("${CMAKE_CURRENT_LIST_DIR}/ArmadilloLibraryDepends.cmake")]] + "include(CMakeFindDependencyMacro)\nfind_dependency(LAPACK)\ninclude(\"\${CMAKE_CURRENT_LIST_DIR}/ArmadilloLibraryDepends.cmake\")" + ) +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/share/Armadillo/CMake" +) + +file(GLOB SHARE_ARMADILLO_FILES "${CURRENT_PACKAGES_DIR}/share/Armadillo/*") +if(SHARE_ARMADILLO_FILES STREQUAL "") + # 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() + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/armadillo_bits/config.hpp" "#define ARMA_AUX_LIBS " "#define ARMA_AUX_LIBS //") + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/vcpkg/ports/armadillo/usage b/vcpkg/ports/armadillo/usage new file mode 100644 index 0000000..a6219b8 --- /dev/null +++ b/vcpkg/ports/armadillo/usage @@ -0,0 +1,10 @@ +armadillo provides CMake targets:
+
+ find_package(Armadillo CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE armadillo)
+
+armadillo is compatible with built-in CMake variables:
+
+ find_package(Armadillo REQUIRED)
+ target_include_directories(main PRIVATE ${ARMADILLO_INCLUDE_DIRS})
+ target_link_libraries(main PRIVATE ${ARMADILLO_LIBRARIES})
diff --git a/vcpkg/ports/armadillo/vcpkg-cmake-wrapper.cmake b/vcpkg/ports/armadillo/vcpkg-cmake-wrapper.cmake new file mode 100644 index 0000000..639cc96 --- /dev/null +++ b/vcpkg/ports/armadillo/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,15 @@ +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) +if("CONFIG" IN_LIST ARGS OR "NO_MODULE" IN_LIST ARGS OR NOT "${ARGS};" MATCHES "^Armadillo;") + _find_package(${ARGS}) +else() + list(REMOVE_AT ARGS 0) + list(REMOVE_ITEM ARGS "MODULE") + _find_package(ARMADILLO ${ARGS} NAMES Armadillo) + if(ARMADILLO_FOUND) + set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION}") + file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../../include/armadillo_bits/arma_version.hpp" ARMADILLO_VERSION_NAME REGEX "#define ARMA_VERSION_NAME ") + string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${ARMADILLO_VERSION_NAME}") + endif() +endif() +cmake_policy(POP) diff --git a/vcpkg/ports/armadillo/vcpkg.json b/vcpkg/ports/armadillo/vcpkg.json new file mode 100644 index 0000000..bdfe7fc --- /dev/null +++ b/vcpkg/ports/armadillo/vcpkg.json @@ -0,0 +1,20 @@ +{ + "name": "armadillo", + "version": "14.4.1", + "port-version": 1, + "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", + "homepage": "https://arma.sourceforge.net/", + "license": "Apache-2.0", + "dependencies": [ + "blas", + "lapack", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |