aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-13 23:44:19 -0700
committerGitHub <noreply@github.com>2017-06-13 23:44:19 -0700
commit9addc14b37bfd1ee3947328a0fcdffd17d19e4e8 (patch)
treefbc5aa64d49b52cdce0620ebcf5a57fb96c7ba15
parent50fca8f92acd0e0a6ae082e67d58c59e01a51ad5 (diff)
parent27bb11f6fc0da827190571125b62db8df5c86c68 (diff)
downloadvcpkg-9addc14b37bfd1ee3947328a0fcdffd17d19e4e8.tar.gz
vcpkg-9addc14b37bfd1ee3947328a0fcdffd17d19e4e8.zip
Merge pull request #1259 from KindDragon/ceres-fix
Ceres-solver fix
-rw-r--r--ports/ceres/CONTROL2
-rw-r--r--ports/ceres/portfile.cmake66
-rw-r--r--ports/suitesparse/CONTROL4
-rw-r--r--ports/suitesparse/portfile.cmake76
4 files changed, 86 insertions, 62 deletions
diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL
index d8c4c4ec6..4266bbac1 100644
--- a/ports/ceres/CONTROL
+++ b/ports/ceres/CONTROL
@@ -1,4 +1,4 @@
Source: ceres
-Version: 1.12.0
+Version: 1.12.0-1
Build-Depends:suitesparse, eigen3, clapack, gflags, glog
Description: non-linear optimization package \ No newline at end of file
diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake
index 0ed2c94b8..61cb4a009 100644
--- a/ports/ceres/portfile.cmake
+++ b/ports/ceres/portfile.cmake
@@ -29,46 +29,44 @@ vcpkg_from_github(
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
- #PREFER_NINJA # Disable this option if project cannot be built with Ninja
-
- OPTIONS
- -DEXPORT_BUILD_DIR=ON
- -DBUILD_EXAMPLES=OFF
- -DBUILD_TESTING=OFF
- -DEIGENSPARSE=ON
- -DSUITESPARSE=ON
- -DCXSPARSE=ON
- #-DBUILD_SHARED_LIBS=OFF
- -DCXSPARSE_INCLUDE_DIR=${SUITESPARSE_INCLUDE_DIR}
- -DCXSPARSE_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libcxsparse.lib
- -DSUITESPARSE_INCLUDE_DIR_HINTS=${CURRENT_INSTALLED_DIR}/include/suitesparse
- -DEIGEN_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/eigen3
- -DLAPACK_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/lapack.lib
- -DBLAS_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/openblas.lib
- -DMETIS_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/metis.lib
- -DGFLAGS_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include
- -DGFLAGS_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/gflags.lib
- -DGLOG_INCLUDE_DIR=${PACKAGES_INCLUDE_DIR}
- -DGLOG_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/glog.lib
-
- OPTIONS_RELEASE
- -DSUITESPARSE_LIBRARY_DIR_HINTS=${CURRENT_INSTALLED_DIR}/lib
-
- OPTIONS_DEBUG
- -DSUITESPARSEQR_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libspqrd.lib
- -DSUITESPARSE_LIBRARY_DIR_HINTS=${CURRENT_INSTALLED_DIR}/debug/lib
-
+ OPTIONS
+ -DEXPORT_BUILD_DIR=ON
+ -DBUILD_EXAMPLES=OFF
+ -DBUILD_TESTING=OFF
+ -DCXSPARSE=ON
+ -DEIGENSPARSE=ON
+ -DSUITESPARSE=ON
+ -DBLAS_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/openblas.lib
+ -DCXSPARSE_INCLUDE_DIR=${SUITESPARSE_INCLUDE_DIR}
+ -DCXSPARSE_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libcxsparse.lib
+ -DEIGEN_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/eigen3
+ -DGFLAGS_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include
+ -DGFLAGS_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/gflags.lib
+ -DGLOG_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include
+ -DGLOG_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/glog.lib
+ -DLAPACK_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/lapack.lib
+ -DMETIS_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/metis.lib
+ -DSUITESPARSE_INCLUDE_DIR_HINTS=${CURRENT_INSTALLED_DIR}/include/suitesparse
+ OPTIONS_RELEASE
+ -DSUITESPARSE_LIBRARY_DIR_HINTS=${CURRENT_INSTALLED_DIR}/lib
+ OPTIONS_DEBUG
+ -DSUITESPARSEQR_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libspqrd.lib
+ -DSUITESPARSE_LIBRARY_DIR_HINTS=${CURRENT_INSTALLED_DIR}/debug/lib
)
+
vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake")
+
vcpkg_copy_pdbs()
-#clean
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/CMake)
+#clean
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/CMake)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE ${CURRENT_PACKAGES_DIR}/share/ceres/FindEigen.cmake)
+file(REMOVE ${CURRENT_PACKAGES_DIR}/share/ceres/FindGflags.cmake)
+file(REMOVE ${CURRENT_PACKAGES_DIR}/share/ceres/FindGlog.cmake)
# Handle copyright of suitesparse and metis
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ceres)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/ceres/LICENSE ${CURRENT_PACKAGES_DIR}/share/ceres/copyright)
-
-
diff --git a/ports/suitesparse/CONTROL b/ports/suitesparse/CONTROL
index a40b4ff24..74491898e 100644
--- a/ports/suitesparse/CONTROL
+++ b/ports/suitesparse/CONTROL
@@ -1,4 +1,4 @@
Source: suitesparse
-Version: 4.5.5
-Build-Depends:metis, clapack
+Version: 4.5.5-1
+Build-Depends: metis, clapack
Description: algebra library
diff --git a/ports/suitesparse/portfile.cmake b/ports/suitesparse/portfile.cmake
index 1deb3a39e..737561f9f 100644
--- a/ports/suitesparse/portfile.cmake
+++ b/ports/suitesparse/portfile.cmake
@@ -12,6 +12,11 @@
include(vcpkg_common_functions)
+if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ message(STATUS "Warning: Dynamic building not supported yet. Building static.")
+ set(VCPKG_LIBRARY_LINKAGE static)
+endif()
+
set(SUITESPARSE_VER SuiteSparse-4.5.5) #if you change the version, becarefull of changing the SHA512 checksum accordingly
set(SUITESPARSEWIN_PATH ${CURRENT_BUILDTREES_DIR}/src/suitesparse-metis-for-windows-1.3.1)
set(SUITESPARSE_PATH ${SUITESPARSEWIN_PATH}/Suitesparse)
@@ -25,50 +30,72 @@ vcpkg_download_distfile(SUITESPARSE
#download suitesparse-metis-for-windows scripts, suitesparse does not have CMake build system, jlblancoc has made one for it
vcpkg_download_distfile(SUITESPARSEWIN
-URLS "https://github.com/jlblancoc/suitesparse-metis-for-windows/archive/v1.3.1.zip"
-FILENAME "suitesparse-metis-for-windows-1.3.1.zip"
-SHA512 f8b9377420432f1c0a05bf884fe9e72f1f4eaf7e05663c66a383b5d8ddbd4fbfaa7d433727b4dc3e66b41dbb96b1327d380b68a51a424276465512666e63393d
+ URLS "https://github.com/jlblancoc/suitesparse-metis-for-windows/archive/v1.3.1.zip"
+ FILENAME "suitesparse-metis-for-windows-1.3.1.zip"
+ SHA512 f8b9377420432f1c0a05bf884fe9e72f1f4eaf7e05663c66a383b5d8ddbd4fbfaa7d433727b4dc3e66b41dbb96b1327d380b68a51a424276465512666e63393d
)
-#extract suitesparse-metis-for-windows first and merge with suitesparse library
+#extract suitesparse-metis-for-windows first and merge with suitesparse library
vcpkg_extract_source_archive(${SUITESPARSEWIN})
vcpkg_extract_source_archive(${SUITESPARSE} ${SUITESPARSEWIN_PATH})
vcpkg_apply_patches(
SOURCE_PATH ${SUITESPARSEWIN_PATH}
- PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-suitesparse.patch"
+ PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-install-suitesparse.patch"
)
vcpkg_configure_cmake(
SOURCE_PATH ${SUITESPARSEWIN_PATH}
- #PREFER_NINJA # Disable this option if project cannot be built with Ninja
- OPTIONS
-
- -DBUILD_METIS=OFF #Disable the option to build metis from source
- -DUSE_VCPKG_METIS=ON #Force using vcpckg metis library
- -DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR}
-
- -DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON
- -DSUITESPARSE_CUSTOM_BLAS_LIB=${CURRENT_INSTALLED_DIR}/lib/openblas.lib
- -DSUITESPARSE_CUSTOM_LAPACK_LIB=${CURRENT_INSTALLED_DIR}/lib/lapack.lib
-
- -DLIB_POSTFIX=
+ PREFER_NINJA
+ OPTIONS
+ -DBUILD_METIS=OFF #Disable the option to build metis from source
+ -DUSE_VCPKG_METIS=ON #Force using vcpckg metis library
+ -DMETIS_SOURCE_DIR=${CURRENT_INSTALLED_DIR}
+ -DLIB_POSTFIX=
+ -DSUITESPARSE_USE_CUSTOM_BLAS_LAPACK_LIBS=ON
+ -DSUITESPARSE_CUSTOM_BLAS_LIB=${CURRENT_INSTALLED_DIR}/lib/openblas.lib
+ -DSUITESPARSE_CUSTOM_LAPACK_LIB=${CURRENT_INSTALLED_DIR}/lib/lapack.lib
OPTIONS_DEBUG
-DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug
OPTIONS_RELEASE
- -DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}
+ -DSUITESPARSE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}
)
vcpkg_install_cmake()
+file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/suitesparse/)
+
+file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/SuiteSparse-config.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake)
+file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/SuiteSparse-config-release.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-release.cmake)
+file(RENAME ${CURRENT_PACKAGES_DIR}/debug/cmake/SuiteSparse-config-debug.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake)
+
+file(RENAME ${CURRENT_PACKAGES_DIR}/UseSuiteSparse.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/UseSuiteSparse.cmake)
+file(RENAME ${CURRENT_PACKAGES_DIR}/SuiteSparseConfig.cmake ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake)
+file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/UseSuiteSparse.cmake)
+file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/SuiteSparseConfig.cmake)
+
+# Update paths in SuiteSparseConfig.cmake
+file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake _contents)
+string(REPLACE "set(SuiteSparse_LIB_POSTFIX \"64\")" "set(SuiteSparse_LIB_POSTFIX \"\")" _contents "${_contents}")
+string(REPLACE "\#\# do nothing, it's OK" "include(${USE_SuiteSparse})" _contents "${_contents}")
+
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparseConfig.cmake "${_contents}")
+
+# Update paths in SuiteSparse-config.cmake
+file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake _contents)
+string(REPLACE "get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)"
+ "get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)" _contents "${_contents}")
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config.cmake "${_contents}")
+
+# Update paths in SuiteSparse-config-debug.cmake
+file(READ ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake _contents)
+string(REPLACE "\${_IMPORT_PREFIX}/lib/" "\${_IMPORT_PREFIX}/debug/lib/" _contents "${_contents}")
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/suitesparse/SuiteSparse-config-debug.cmake "${_contents}")
+
#clean folders
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake)
-file(GLOB REMFILES ${CURRENT_PACKAGES_DIR}/debug/*.*)
-file(REMOVE ${REMFILES})
-file(GLOB REMFILES ${CURRENT_PACKAGES_DIR}/*.*)
-file(REMOVE ${REMFILES})
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright of suitesparse and suitesparse-metis-for-windows
file(COPY ${SUITESPARSE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
@@ -76,4 +103,3 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/share/suitesparse/LICENSE.txt ${CURRENT_PACK
file(COPY ${SUITESPARSEWIN_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/suitesparse)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/suitesparse/LICENSE.md ${CURRENT_PACKAGES_DIR}/share/suitesparse/copyright_suitesparse-metis-for-windows)
-