vcpkg/ports/ceres/0004_fix_exported_ceres_config.patch
Stefano Sinigardi 5898891125 [openexr,openimageio,suitesparse,theia] updates for non-win32 (#6371)
* [openexr,openimageio,suitesparse,theia] updates for non-win32

* [theia] use only valid cmake symbols

* [suitesparse] Fix build

* [lapack] still not properly integrating with other ports

* [lapack] intercept cmake module calls and substitute them with our defs

* [suitesparse,clapack] fixes for proper integration

* [ceres,clapack] bump CONTROL

* [suitesparse] remove unnecessary defs

* [clapack] improve wrapper logic

* [WIN32] remove wrong symbol

* [clapack] fix wrapper integration

* [Accelerate] use best framework when available

* [clapack] separate config from wrapper

* [clapack] fix paths and filenames

* [mlpack,armadillo,clapack] improve library handling

* [mlpack] remove unnecessary cmake option

* [clp,coinutils,osi,liblemon] dependencies of openmvg, improve compatibility with non-win32

* [openmvg] fix for case-sensitive filesystems

* [clp,coinutils,osi] simplify CMakeLists removing many unnecessary steps

* [sophus] Force rebuild

* [theia] fixes for linux, part1

* [io2d] remove broken sintax

* [fontconfig] bump version to remove CI cached failure

* [theia] fixes for linux, part2

* [theia] remove unnecessary empty folders and comments from portfile

* [theia] use correct build type removing forced vars in cmakelists.txt

* [openmvg] add missing suitesparse target detection

* [sophus] fix Suitesparse dependency

* [sophus,openmvg] use suitesparse lowercase for module compatibility on case-sensitive filesystems

* [suitesparse] fixes for case-sensitive filesystems

* [openmvg] use correct Eigen3 name for case-sensitive filesystems

* [sophus] trigger rebuild

* [shogun] use modern vcpkg style

* [shogun] add missing cmake system processor symbol
2019-05-31 15:48:17 -07:00

93 lines
4.2 KiB
Diff

diff --git a/cmake/CeresConfig.cmake.in b/cmake/CeresConfig.cmake.in
index d0380de..bf4c2eb 100644
--- a/cmake/CeresConfig.cmake.in
+++ b/cmake/CeresConfig.cmake.in
@@ -237,85 +237,8 @@ endif (EIGEN_FOUND)
list(APPEND CERES_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})
# Glog.
-# Flag set during configuration and build of Ceres.
-set(CERES_USES_MINIGLOG @MINIGLOG@)
-set(CERES_USES_GFLAGS @GFLAGS@)
-if (CERES_USES_MINIGLOG)
- set(MINIGLOG_INCLUDE_DIR ${CERES_INCLUDE_DIR}/ceres/internal/miniglog)
- if (NOT CERES_WAS_INSTALLED)
- # When Ceres was exported from the build tree, the miniglog headers
- # will be in Ceres internal source directory, not in the public headers
- # directory (they are copied with the public headers when installed).
- set(MINIGLOG_INCLUDE_DIR
- ${CERES_EXPORTED_SOURCE_DIR}/internal/ceres/miniglog)
- endif()
- if (NOT EXISTS ${MINIGLOG_INCLUDE_DIR})
- ceres_report_not_found(
- "Failed to find miniglog headers in expected include directory: "
- "${MINIGLOG_INCLUDE_DIR}, but Ceres was compiled with MINIGLOG enabled "
- "(in place of glog).")
- endif (NOT EXISTS ${MINIGLOG_INCLUDE_DIR})
- list(APPEND CERES_INCLUDE_DIRS ${MINIGLOG_INCLUDE_DIR})
- # Output message at standard log level (not the lower STATUS) so that
- # the message is output in GUI during configuration to warn user.
- message("-- Found Ceres compiled with miniglog substitute "
- "for glog, beware this will likely cause problems if glog is later linked.")
-else (CERES_USES_MINIGLOG)
- # Append the locations of glog when Ceres was built to the search path hints.
- set(GLOG_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_GLOG_CMAKE_CONFIGURATION@)
- if (GLOG_WAS_BUILT_WITH_CMAKE)
- set(glog_DIR @glog_DIR@)
- set(GLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION TRUE)
- else()
- list(APPEND GLOG_INCLUDE_DIR_HINTS @GLOG_INCLUDE_DIR@)
- get_filename_component(CERES_BUILD_GLOG_LIBRARY_DIR @GLOG_LIBRARY@ PATH)
- list(APPEND GLOG_LIBRARY_DIR_HINTS ${CERES_BUILD_GLOG_LIBRARY_DIR})
- endif()
-
- # Search quietly s/t we control the timing of the error message if not found.
- find_package(Glog QUIET)
- if (GLOG_FOUND)
- message(STATUS "Found required Ceres dependency: glog")
- else (GLOG_FOUND)
- ceres_report_not_found("Missing required Ceres "
- "dependency: glog. Searched using GLOG_INCLUDE_DIR_HINTS: "
- "${GLOG_INCLUDE_DIR_HINTS} and glog_DIR: ${glog_DIR}.")
- endif (GLOG_FOUND)
- list(APPEND CERES_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS})
-
- # gflags is only a public dependency of Ceres via glog, thus is not required
- # if Ceres was built with MINIGLOG.
- if (CERES_USES_GFLAGS)
- # If gflags was found as an imported CMake target, we need to call
- # find_packge(Gflags) again here, as imported CMake targets are not
- # re-exported. Without this, the 'gflags-shared' target name which is
- # present in CERES_LIBRARIES in this case would not be defined, and so
- # CMake will assume it is a library name (which it is not) and fail to link.
- #
- # Append the locations of gflags when Ceres was built to the search path
- # hints.
- set(GFLAGS_WAS_BUILT_WITH_CMAKE @FOUND_INSTALLED_GFLAGS_CMAKE_CONFIGURATION@)
- if (GFLAGS_WAS_BUILT_WITH_CMAKE)
- set(gflags_DIR @gflags_DIR@)
- set(GFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION TRUE)
- else()
- list(APPEND GFLAGS_INCLUDE_DIR_HINTS @GFLAGS_INCLUDE_DIR@)
- get_filename_component(CERES_BUILD_GFLAGS_LIBRARY_DIR @GFLAGS_LIBRARY@ PATH)
- list(APPEND GFLAGS_LIBRARY_DIR_HINTS ${CERES_BUILD_GFLAGS_LIBRARY_DIR})
- endif()
-
- # Search quietly s/t we control the timing of the error message if not found.
- find_package(Gflags QUIET)
- if (GFLAGS_FOUND)
- message(STATUS "Found required Ceres dependency: gflags")
- else()
- ceres_report_not_found("Missing required Ceres "
- "dependency: gflags. Searched using GFLAGS_INCLUDE_DIR_HINTS: "
- "${GFLAGS_INCLUDE_DIR_HINTS} and gflags_DIR: ${gflags_DIR}.")
- endif()
- list(APPEND CERES_INCLUDE_DIRS ${GFLAGS_INCLUDE_DIR_HINTS})
- endif()
-endif (CERES_USES_MINIGLOG)
+include (CMakeFindDependencyMacro)
+find_dependency (glog NO_MODULE)
# Import exported Ceres targets, if they have not already been imported.
if (NOT TARGET ceres AND NOT Ceres_BINARY_DIR)