#!/usr/bin/env python from drake.tools.install.cpsutils import read_version_defs defs = read_version_defs("set\(TINYOBJLOADER_VERSION\s+([0-9]+).([0-9]+).([0-9]+)") content = """ { "Cps-Version": "0.8.0", "Name": "tinyobjloader", "Description": "Tiny but powerful single file wavefront obj loader", "License": "MIT", "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Compat-Version": "%(VERSION_MAJOR)s.0.0", "Default-Components": [ ":tinyobjloader" ], "Components": { "tinyobjloader": { "Type": "dylib", "Location": "@prefix@/lib/libtinyobjloader.so", "Includes": [ "@prefix@/include/tinyobjloader" ] } } } """ % defs print(content[1:])
from drake.tools.install.cpsutils import read_version_defs def_re = "#define IGNITION_MATH_VERSION_FULL[\s]\"([0-9]+).([0-9]+).([0-9]+).*\"" defs = read_version_defs(def_re) content = """ { "Cps-Version": "0.8.0", "Name": "ignition-math%(VERSION_MAJOR)s", "Description": "Math classes and functions for robot applications", "License": "Apache-2.0", "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Default-Components": [":ignition-math%(VERSION_MAJOR)s"], "Components": { "ignition-math%(VERSION_MAJOR)s": { "Type": "dylib", "Location": "@prefix@/lib/libdrake_ignition_math.so", "Includes": ["@prefix@/include/ignition-math%(VERSION_MAJOR)s"] } }, "X-CMake-Variables": { "IGNITION-MATH_INCLUDE_DIRS": "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}/include", "IGNITION-MATH_LINK_DIRS": "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}/lib", "IGNITION-MATH_LIBRARY_DIRS": "${${CMAKE_FIND_PACKAGE_NAME}_IMPORT_PREFIX}/lib", "IGNITION-MATH_LIBRARIES": "ignition_math" } } """ % defs print(content[1:])
# This file is only used in cases when we need to build and/or install fmt from # source, i.e., when we are not using pkg-config. See repository.bzl for the # logic to select when that occurs. from drake.tools.install.cpsutils import read_version_defs defs = read_version_defs( "#define FMT_VERSION ([0-9]{1,2})([0-9]{2})([0-9]{2})$") # Skip leading zeros if any. assert len(defs) == 3 defs = dict([(k, int(v)) for k, v in defs.items()]) content = """ { "Cps-Version": "0.8.0", "Name": "fmt", "Description": "Small, safe and fast formatting library", "License": "BSD-2-Clause", "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Default-Components": [":fmt"], "Components": { "fmt-header-only": { "Type": "interface", "Definitions": ["FMT_HEADER_ONLY=1"], "Includes": ["@prefix@/include/fmt"] } } } """ % defs
#!/usr/bin/env python2 from drake.tools.install.cpsutils import read_version_defs, read_requires def_re = "project\(spdlog\sVERSION\s([0-9]+).([0-9]+).([0-9]+)" defs = read_version_defs(def_re) defs.update(read_requires()) content = """ { "Cps-Version": "0.8.0", "Name": "spdlog", "Description": "Super fast C++ logging library", "License": "MIT", "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Requires": { "fmt": { "Version": "%(fmt_VERSION)s", "Hints": ["@prefix@/lib/cmake/fmt"], "X-CMake-Find-Args": ["CONFIG"] } }, "Default-Components": [":spdlog"], "Components": { "spdlog": { "Type": "interface", "Includes": ["@prefix@/include/spdlog"], "Definitions": [ "HAVE_SPDLOG", "SPDLOG_FMT_EXTERNAL"
#!/usr/bin/env python from drake.tools.install.cpsutils import read_version_defs defs = read_version_defs("\W+\(\"([0-9]+).([0-9]+).([0-9]+)\"\)") content = """ { "Cps-Version": "0.8.0", "Name": "scs", "Description": "Conic optimization via operator splitting.", "License": [ "LGPL-2.1+", "MIT" ], "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Default-Components": [":scsdir"], "Components": { "scsdir": { "Type": "dylib", "Location": "@prefix@/lib/libscsdir.so", "Definitions": ["LAPACK_LIB_FOUND=1"], "Includes": ["@prefix@/include/scs"] }, "scsindir": { "Type": "dylib", "Location": "@prefix@/lib/libscsindir.so", "Definitions": ["LAPACK_LIB_FOUND=1"], "Includes": ["@prefix@/include/scs"] } }
#!/usr/bin/env python2 from drake.tools.install.cpsutils import read_version_defs defs = read_version_defs("#define FMT_VERSION ([0-9]{1,2})([0-9]{2})([0-9]{2})$") # Skip leading zeros if any. assert len(defs) == 3 defs = dict([(k, int(v)) for k, v in defs.iteritems()]) content = """ { "Cps-Version": "0.8.0", "Name": "fmt", "Description": "Small, safe and fast formatting library", "License": "BSD-2-Clause", "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Default-Components": [":fmt"], "Components": { "fmt-header-only": { "Type": "interface", "Definitions": ["FMT_HEADER_ONLY=1"], "Includes": ["@prefix@/include/fmt"] } } } """ % defs print(content[1:])
#!/usr/bin/env python from drake.tools.install.cpsutils import read_version_defs defs = read_version_defs("set\(FMT_VERSION\s([0-9]+).([0-9]+).([0-9]+)") content = """ { "Cps-Version": "0.8.0", "Name": "fmt", "Description": "Small, safe and fast formatting library", "License": "BSD-2-Clause", "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Default-Components": [":fmt"], "Components": { "fmt-header-only": { "Type": "interface", "Includes": ["@prefix@/include/fmt"] }, "fmt": { "Type": "dylib", "Location": "@prefix@/lib/libfmt.so", "Requires": [":fmt-header-only"] } } } """ % defs print(content[1:])
#!/usr/bin/env python from drake.tools.install.cpsutils import read_version_defs defs = read_version_defs("set\(FMT_VERSION\s([0-9]+).([0-9]+).([0-9]+)") content = """ { "Cps-Version": "0.8.0", "Name": "fmt", "Description": "Small, safe and fast formatting library", "License": "BSD-2-Clause", "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Default-Components": [":fmt"], "Components": { "fmt-header-only": { "Type": "interface", "Definitions": ["FMT_HEADER_ONLY=1"], "Includes": ["@prefix@/include/fmt"] } } } """ % defs print(content[1:])
#!/usr/bin/env python from drake.tools.install.cpsutils import read_version_defs defs = read_version_defs( "set\(TINYOBJLOADER_VERSION\s+([0-9]+).([0-9]+).([0-9]+)") content = """ { "Cps-Version": "0.8.0", "Name": "tinyobjloader", "Description": "Tiny but powerful single file wavefront obj loader", "License": "MIT", "Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s", "Default-Components": [ ":tinyobjloader" ], "Components": { "tinyobjloader": { "Type": "dylib", "Location": "@prefix@/lib/libtinyobjloader.so", "Includes": [ "@prefix@/include/tinyobjloader" ] } } } """ % defs print(content[1:])