Make standalone_absl imported target global. (#1351)

master
Juraj Oršulić 2018-07-30 13:06:15 +02:00 committed by Alexander Belyaev
parent b1855d0d06
commit 0a10bc3a15
2 changed files with 16 additions and 11 deletions

View File

@ -23,19 +23,24 @@
set_and_check(CARTOGRAPHER_CMAKE_DIR "@PACKAGE_CARTOGRAPHER_CMAKE_DIR@") set_and_check(CARTOGRAPHER_CMAKE_DIR "@PACKAGE_CARTOGRAPHER_CMAKE_DIR@")
set(CERES_DIR_HINTS @Ceres_DIR@) set(CERES_DIR_HINTS @Ceres_DIR@)
if (cartographer_FIND_QUIETLY)
find_package(Ceres QUIET HINTS ${CERES_DIR_HINTS})
elseif (cartographer_FIND_REQUIRED)
find_package(Ceres REQUIRED HINTS ${CERES_DIR_HINTS})
else ()
find_package(Ceres HINTS ${CERES_DIR_HINTS})
endif()
set(CARTOGRAPHER_HAS_GRPC @CARTOGRAPHER_HAS_GRPC@) set(CARTOGRAPHER_HAS_GRPC @CARTOGRAPHER_HAS_GRPC@)
if (cartographer_FIND_QUIETLY)
set(QUIET_OR_REQUIRED_OPTION "QUIET")
elseif (cartographer_FIND_REQUIRED)
set(QUIET_OR_REQUIRED_OPTION "REQUIRED")
else ()
set(QUIET_OR_REQUIRED_OPTION "")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CARTOGRAPHER_CMAKE_DIR}/modules)
find_package(Ceres ${QUIET_OR_REQUIRED_OPTION} HINTS ${CERES_DIR_HINTS})
find_package(Abseil ${QUIET_OR_REQUIRED_OPTION})
if(CARTOGRAPHER_HAS_GRPC) if(CARTOGRAPHER_HAS_GRPC)
find_package(async_grpc) find_package(async_grpc ${QUIET_OR_REQUIRED_OPTION})
endif() endif()
include("${CARTOGRAPHER_CMAKE_DIR}/CartographerTargets.cmake") include("${CARTOGRAPHER_CMAKE_DIR}/CartographerTargets.cmake")
unset(QUIET_OR_REQUIRED_OPTION)

View File

@ -66,7 +66,7 @@ if(NOT TARGET standalone_absl)
CMAKE_CACHE_ARGS "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON;-DBUILD_TESTING:BOOL=OFF;-DCMAKE_BUILD_TYPE:STRING=Release" CMAKE_CACHE_ARGS "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON;-DBUILD_TESTING:BOOL=OFF;-DCMAKE_BUILD_TYPE:STRING=Release"
BUILD_BYPRODUCTS "${ABSEIL_LIBRARY_PATH};${ABSEIL_DEPENDENT_LIBRARIES}" BUILD_BYPRODUCTS "${ABSEIL_LIBRARY_PATH};${ABSEIL_DEPENDENT_LIBRARIES}"
) )
add_library(standalone_absl STATIC IMPORTED) add_library(standalone_absl STATIC IMPORTED GLOBAL)
set_target_properties(standalone_absl set_target_properties(standalone_absl
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
${ABSEIL_INCLUDE_DIRS} ${ABSEIL_INCLUDE_DIRS}