diff options
| author | Don Venable <venabled@users.noreply.github.com> | 2020-05-11 18:45:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-11 15:45:42 -0700 |
| commit | 2601736b9d76e069103c1c1b4336762609bc783a (patch) | |
| tree | 268e8014c89c28b6e8be8424b22fa4b7f29473c9 | |
| parent | 10bb90bbdf4eb2e6b528bde12edca239a37f28e5 (diff) | |
| download | vcpkg-2601736b9d76e069103c1c1b4336762609bc783a.tar.gz vcpkg-2601736b9d76e069103c1c1b4336762609bc783a.zip | |
[ceres] Added patch to add find_dependency() for suitesparse targets downstream (#11200)
* Added patch to add find_dependency() for suitesparse targets downstream
Should address / close microsoft/vcpkg#7556
* Bumped port version to -7
* Removed patch that uses vcpkg features for suitesparse and added
suitesparse detection logic in CeresConfig.cmake.in
* Changed configure options to detect features using `vcpkg_check_features()`
* Passed `${FEATURE_OPTIONS}` to `vcpkg_configure_cmake()`
| -rw-r--r-- | ports/ceres/0003_fix_exported_ceres_config.patch | 14 | ||||
| -rw-r--r-- | ports/ceres/CONTROL | 2 | ||||
| -rw-r--r-- | ports/ceres/portfile.cmake | 36 |
3 files changed, 18 insertions, 34 deletions
diff --git a/ports/ceres/0003_fix_exported_ceres_config.patch b/ports/ceres/0003_fix_exported_ceres_config.patch index 5cc41013e..071ad0ad1 100644 --- a/ports/ceres/0003_fix_exported_ceres_config.patch +++ b/ports/ceres/0003_fix_exported_ceres_config.patch @@ -1,8 +1,8 @@ diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in -index d0380de..bf4c2eb 100644 +index d0380de..55760a8 100644 --- a/cmake/CeresConfig.cmake.in +++ b/cmake/CeresConfig.cmake.in -@@ -237,85 +237,8 @@ endif (EIGEN_FOUND) +@@ -237,85 +237,13 @@ endif (EIGEN_FOUND) list(APPEND CERES_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}) # Glog. @@ -40,7 +40,9 @@ index d0380de..bf4c2eb 100644 - get_filename_component(CERES_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH) - list(APPEND GLOG_LIBRARY_DIR_HINTS ${CERES_BUILD_GLOG_LIBRARY_DIR}) - endif() -- ++include (CMakeFindDependencyMacro) ++find_dependency (glog NO_MODULE) + - # Search quietly s/t we control the timing of the error message if not found. - find_package(Glog QUIET) - if (GLOG_FOUND) @@ -85,8 +87,10 @@ index d0380de..bf4c2eb 100644 - list(APPEND CERES_INCLUDE_DIRS ${GFLAGS_INCLUDE_DIR_HINTS}) - endif() -endif (CERES_USES_MINIGLOG) -+include (CMakeFindDependencyMacro) -+find_dependency (glog NO_MODULE) ++#SuiteSparse ++if (@SUITESPARSE@) ++ find_dependency(suitesparse CONFIG REQUIRED) ++endif() # Import exported Ceres targets, if they have not already been imported. if (NOT TARGET ceres AND NOT Ceres_BINARY_DIR) diff --git a/ports/ceres/CONTROL b/ports/ceres/CONTROL index 850da31a6..a0a7a72e0 100644 --- a/ports/ceres/CONTROL +++ b/ports/ceres/CONTROL @@ -1,5 +1,5 @@ Source: ceres -Version: 1.14.0-6 +Version: 1.14.0-7 Build-Depends: glog, eigen3 Homepage: https://github.com/ceres-solver/ceres-solver Description: non-linear optimization package diff --git a/ports/ceres/portfile.cmake b/ports/ceres/portfile.cmake index 508191628..d2d781b59 100644 --- a/ports/ceres/portfile.cmake +++ b/ports/ceres/portfile.cmake @@ -29,43 +29,23 @@ file(REMOVE ${SOURCE_PATH}/cmake/FindGlog.cmake) file(REMOVE ${SOURCE_PATH}/cmake/FindSuiteSparse.cmake) #file(REMOVE ${SOURCE_PATH}/cmake/FindTBB.cmake) -set(SUITESPARSE OFF) -if("suitesparse" IN_LIST FEATURES) - set(SUITESPARSE ON) -endif() - -set(CXSPARSE OFF) -if("cxsparse" IN_LIST FEATURES) - set(CXSPARSE ON) -endif() - -set(LAPACK OFF) -if("lapack" IN_LIST FEATURES) - set(LAPACK ON) -endif() -set(EIGENSPARSE OFF) -if("eigensparse" IN_LIST FEATURES) - set(EIGENSPARSE ON) -endif() - -set(GFLAGS OFF) -if("tools" IN_LIST FEATURES) - set(GFLAGS ON) -endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + "suitesparse" SUITESPARSE + "cxsparse" CXSPARSE + "lapack" LAPACK + "eigensparse" EIGENSPARSE + "tools" GFLAGS +) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + ${FEATURE_OPTIONS} -DEXPORT_BUILD_DIR=ON -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF - -DGFLAGS=${GFLAGS} - -DCXSPARSE=${CXSPARSE} - -DEIGENSPARSE=${EIGENSPARSE} - -DLAPACK=${LAPACK} - -DSUITESPARSE=${SUITESPARSE} -DMSVC_USE_STATIC_CRT=${MSVC_USE_STATIC_CRT_VALUE} -DLIB_SUFFIX=${LIB_SUFFIX} ) |
