mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 12:06:49 +08:00
add armadillo (#2954)
* init add armadillo * [armadillo] Disable wrapper lib. Generate appropriate cmake usage information.
This commit is contained in:
parent
1b4bc5e27e
commit
a6d56f88e5
4
ports/armadillo/ArmadilloConfig.cmake
Normal file
4
ports/armadillo/ArmadilloConfig.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
set(ARMADILLO_FOUND TRUE)
|
||||||
|
set(ARMADILLO_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include")
|
||||||
|
set(ARMADILLO_LIBRARY_DIRS)
|
||||||
|
set(ARMADILLO_LIBRARIES)
|
3
ports/armadillo/CONTROL
Normal file
3
ports/armadillo/CONTROL
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Source: armadillo
|
||||||
|
Version: 8.400.0-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
|
50
ports/armadillo/disable-wrapper.patch
Normal file
50
ports/armadillo/disable-wrapper.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 7924a8f..853c2ee 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -27,7 +27,7 @@ include(CheckLibraryExists)
|
||||||
|
## You will then need to link your programs with -lblas -llapack instead of -larmadillo
|
||||||
|
## If you're using OpenBLAS, link your programs with -lopenblas -llapack instead of -larmadillo
|
||||||
|
|
||||||
|
-set(ARMA_USE_WRAPPER true)
|
||||||
|
+set(ARMA_USE_WRAPPER false)
|
||||||
|
|
||||||
|
|
||||||
|
# the settings below will be automatically configured by the rest of this script
|
||||||
|
@@ -379,7 +379,7 @@ message(STATUS "Generating ${PROJECT_BINARY_DIR}/tmp/include/config.hpp")
|
||||||
|
configure_file(${PROJECT_BINARY_DIR}/tmp/include/armadillo_bits/config.hpp.cmake ${PROJECT_BINARY_DIR}/tmp/include/armadillo_bits/config.hpp)
|
||||||
|
|
||||||
|
message(STATUS "Generating ${PROJECT_SOURCE_DIR}/examples/Makefile")
|
||||||
|
-configure_file(${PROJECT_SOURCE_DIR}/examples/Makefile.cmake ${PROJECT_SOURCE_DIR}/examples/Makefile)
|
||||||
|
+#configure_file(${PROJECT_SOURCE_DIR}/examples/Makefile.cmake ${PROJECT_SOURCE_DIR}/examples/Makefile)
|
||||||
|
|
||||||
|
|
||||||
|
include_directories(${PROJECT_BINARY_DIR}/tmp/include/ ${CMAKE_REQUIRED_INCLUDES})
|
||||||
|
@@ -439,11 +439,13 @@ PATTERN "*~" EXCLUDE
|
||||||
|
PATTERN "*orig" EXCLUDE
|
||||||
|
)
|
||||||
|
|
||||||
|
+if(ARMA_USE_WRAPPER)
|
||||||
|
install(TARGETS armadillo EXPORT ArmadilloLibraryDepends
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
-
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
# Export the package for use from the build-tree
|
||||||
|
# (this registers the build-tree with a global CMake-registry)
|
||||||
|
export(PACKAGE armadillo)
|
||||||
|
@@ -465,10 +467,11 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake_aux/InstallFiles/ArmadilloConfigVersi
|
||||||
|
"${PROJECT_BINARY_DIR}/ArmadilloConfigVersion.cmake" @ONLY)
|
||||||
|
|
||||||
|
# Install the export set for use with the install-tree
|
||||||
|
+if(ARMA_USE_WRAPPER)
|
||||||
|
install(EXPORT ArmadilloLibraryDepends DESTINATION
|
||||||
|
"${CMAKE_INSTALL_DATADIR}/Armadillo/CMake"
|
||||||
|
COMPONENT dev)
|
||||||
|
-
|
||||||
|
+endif()
|
||||||
|
|
||||||
|
## GLOBAL INSTALL FILES
|
||||||
|
# Create ArmadilloConfig.cmake file for the use from the install tree
|
39
ports/armadillo/portfile.cmake
Normal file
39
ports/armadillo/portfile.cmake
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
include(vcpkg_common_functions)
|
||||||
|
|
||||||
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||||
|
message("Armadillo only supports static library linkage")
|
||||||
|
set(VCPKG_LIBRARY_LINKAGE static)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#as conradsnicta/armadillo-code has no release, and the link http://sourceforge.net/projects/arma/files/armadillo-8.400.0.tar.xz is not worked, I use the latest commit for 8.400.x branch
|
||||||
|
vcpkg_from_github(
|
||||||
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
|
REPO conradsnicta/armadillo-code
|
||||||
|
REF a25f66da4c27d40a4a7699199cbf4dc747e712a7
|
||||||
|
SHA512 bf5e1de18c38503e46f72f4f9f145477b6b782baf0df42600acb8811c7a07a5d8c0cd2ac3015d4169c961876e4cbb0457a7c1417b55ba52c98d4f78d145f9ae6
|
||||||
|
HEAD_REF unstable
|
||||||
|
)
|
||||||
|
|
||||||
|
vcpkg_apply_patches(
|
||||||
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
|
PATCHES ${CMAKE_CURRENT_LIST_DIR}/disable-wrapper.patch
|
||||||
|
)
|
||||||
|
|
||||||
|
vcpkg_configure_cmake(
|
||||||
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
|
PREFER_NINJA
|
||||||
|
OPTIONS
|
||||||
|
-DDETECT_HDF5=false
|
||||||
|
)
|
||||||
|
|
||||||
|
vcpkg_install_cmake()
|
||||||
|
|
||||||
|
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/CMake)
|
||||||
|
|
||||||
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/ArmadilloConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/Armadillo)
|
||||||
|
|
||||||
|
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/Armadillo RENAME copyright)
|
5
ports/armadillo/usage
Normal file
5
ports/armadillo/usage
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
The package armadillo is compatible with built-in CMake targets:
|
||||||
|
|
||||||
|
find_package(Armadillo CONFIG REQUIRED)
|
||||||
|
target_include_directories(main PRIVATE ${ARMADILLO_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(main PRIVATE ${ARMADILLO_LIBRARIES})
|
Loading…
Reference in New Issue
Block a user