diff --git a/tools/workspace/spdlog/BUILD.bazel b/tools/workspace/spdlog/BUILD.bazel index 9459bb43c43d..7198e3bb9b53 100644 --- a/tools/workspace/spdlog/BUILD.bazel +++ b/tools/workspace/spdlog/BUILD.bazel @@ -2,12 +2,4 @@ load("//tools/lint:lint.bzl", "add_lint_tests") -exports_files( - [ - "spdlog-config.cmake", - "spdlog-config-version.cmake", - ], - visibility = ["@spdlog//:__pkg__"], -) - add_lint_tests() diff --git a/tools/workspace/spdlog/package.BUILD.bazel b/tools/workspace/spdlog/package.BUILD.bazel index 68b2d5b3ad09..a4b66b9e695b 100644 --- a/tools/workspace/spdlog/package.BUILD.bazel +++ b/tools/workspace/spdlog/package.BUILD.bazel @@ -6,7 +6,6 @@ load( "@drake//tools/install:install.bzl", "install", - "install_files", ) licenses(["notice"]) # MIT @@ -92,27 +91,12 @@ cc_library( visibility = ["//visibility:public"], ) -CMAKE_PACKAGE = "spdlog" - -install_files( - name = "install_cmake_config", - dest = "lib/cmake/{}".format(CMAKE_PACKAGE), - files = [ - "@drake//tools/workspace/spdlog:{}-config.cmake".format(CMAKE_PACKAGE), # noqa - "@drake//tools/workspace/spdlog:{}-config-version.cmake".format(CMAKE_PACKAGE), # noqa - ], - strip_prefix = ["**/"], - allowed_externals = ["@drake//:.bazelproject"], - visibility = ["//visibility:private"], -) - install( name = "install", targets = [":libdrake_spdlog.so"], - hdr_dest = "include/" + CMAKE_PACKAGE, + hdr_dest = "include/spdlog", hdr_strip_prefix = ["include"], hdrs = _HDRS, docs = ["LICENSE"], - deps = [":install_cmake_config"], visibility = ["//visibility:public"], ) diff --git a/tools/workspace/spdlog/repository.bzl b/tools/workspace/spdlog/repository.bzl index f8d728cf6073..7ceee5437069 100644 --- a/tools/workspace/spdlog/repository.bzl +++ b/tools/workspace/spdlog/repository.bzl @@ -28,7 +28,7 @@ def _impl(repo_ctx): spdlog_repository = repository_rule( attrs = { - # The next two attributes are used only when we take the branch for + # The next several attributes are used only when we take the branch for # setup_pkg_config_repository in the above logic. "modname": attr.string( default = "spdlog", @@ -55,10 +55,6 @@ install(name = "install") # Here, we elect to use the same version as Ubuntu 20.04, even # though it is not the newest revision. Sticking with a single, # older revision helps reduce spurious CI failures. - # - # In the unlikely event that you update the version here, fix up - # the two spdlog-*.cmake files in this directory, and revisit all - # of the version compatibility matrix in spdlog/repository.bzl. default = "v1.5.0", ), "commit_pin": attr.int( diff --git a/tools/workspace/spdlog/spdlog-config-version.cmake b/tools/workspace/spdlog/spdlog-config-version.cmake deleted file mode 100644 index 53cfd5911976..000000000000 --- a/tools/workspace/spdlog/spdlog-config-version.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# This file is only used in cases when we need to rebuild spdlog from source. -# See repository.bzl for the logic to select when that occurs. - -set(PACKAGE_VERSION "1.5.0") -set(PACKAGE_COMPAT_VERSION "1.5.0") - -if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) - set(PACKAGE_VERSION_COMPATIBLE FALSE) -elseif(PACKAGE_VERSION VERSION_LESS COMPAT_VERSION) - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if(PACKAGE_VERSION STREQUAL PACKAGE_FIND_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) - endif() -endif() - -unset(PACKAGE_COMPAT_VERSION) - diff --git a/tools/workspace/spdlog/spdlog-config.cmake b/tools/workspace/spdlog/spdlog-config.cmake deleted file mode 100644 index 598e8ea5a5dd..000000000000 --- a/tools/workspace/spdlog/spdlog-config.cmake +++ /dev/null @@ -1,74 +0,0 @@ -# This file is only used in cases when we need to rebuild spdlog from source. -# See repository.bzl for the logic to select when that occurs. - -# Generated by cps2cmake https://github.com/mwoehlke/pycps -# and then subsequently edited by hand. - -if(CMAKE_VERSION VERSION_LESS 3.9.0) - message(FATAL_ERROR "CMake >= 3.9 required") -endif() -cmake_policy(PUSH) -cmake_policy(VERSION 3.0) -set(CMAKE_IMPORT_FILE_VERSION 1) - -include(CMakeFindDependencyMacro) - -get_filename_component(${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) -get_filename_component(${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}" PATH) -get_filename_component(${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}" PATH) -get_filename_component(${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}" PATH) - -if(${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX STREQUAL "/") - set(${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX) -endif() - -find_dependency(fmt 6.1.2 CONFIG HINTS "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}/lib/cmake/fmt") -set(_expectedTargets spdlog::spdlog) - -set(_targetsDefined) -set(_targetsNotDefined) - -foreach(_expectedTarget ${_expectedTargets}) - if(NOT TARGET ${_expectedTarget}) - list(APPEND _targetsNotDefined ${_expectedTarget}) - endif() - if(TARGET ${_expectedTarget}) - list(APPEND _targetsDefined ${_expectedTarget}) - endif() -endforeach() -if("${_targetsDefined}" STREQUAL "${_expectedTargets}") - set(CMAKE_IMPORT_FILE_VERSION) - cmake_policy(POP) - return() -endif() -if(NOT "${_targetsDefined}" STREQUAL "") - message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") -endif() -unset(_targetsDefined) -unset(_targetsNotDefined) -unset(_expectedTargets) - -set(spdlog_VERSION "1.5.0") - -set(_apple_soname_prologue) -if(APPLE) - set(_apple_soname_prologue "@rpath/") -endif() -add_library(spdlog::spdlog SHARED IMPORTED) -set_target_properties(spdlog::spdlog PROPERTIES - IMPORTED_LOCATION "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}/lib/libdrake_spdlog.so" - IMPORTED_SONAME "${_apple_soname_prologue}libdrake_spdlog.so" - INTERFACE_INCLUDE_DIRECTORIES "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}/include/spdlog" - INTERFACE_LINK_LIBRARIES "fmt::fmt-header-only" - INTERFACE_COMPILE_DEFINITIONS "HAVE_SPDLOG;SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL" -) -unset(_apple_soname_prologue) - -set(spdlog_LIBRARIES "spdlog::spdlog") -set(spdlog_INCLUDE_DIRS "") - - -unset(${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX) -unset(CMAKE_IMPORT_FILE_VERSION) -cmake_policy(POP) -