diff --git a/.gitignore b/.gitignore index dda5d894..1590b603 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ doc/output/ doc/locale/en/ *.lua.c + +build.luarocks diff --git a/CHANGELOG.md b/CHANGELOG.md index 4062bda4..c4c7705c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `'all'` and `'none'` options for `include` argument, - simultaneous `include` and `exclude` arguments (`exclude` has higher priority) +- Build rock with cmake ### Deprecated - Passing nonexistent metrics to `enable_default_metrics()` diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..c370eece --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.6 FATAL_ERROR) + +project(metrics NONE) + +## Install #################################################################### +############################################################################### + +if(NOT DEFINED TARANTOOL_INSTALL_LUADIR) + set(TARANTOOL_INSTALL_LUADIR "${PROJECT_SOURCE_DIR}/.rocks/share/tarantool") +endif() + +install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME} + DESTINATION ${TARANTOOL_INSTALL_LUADIR} +) + +install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cartridge + DESTINATION ${TARANTOOL_INSTALL_LUADIR} +) diff --git a/metrics-scm-1.rockspec b/metrics-scm-1.rockspec index 8e8cb490..e7f6ef7a 100644 --- a/metrics-scm-1.rockspec +++ b/metrics-scm-1.rockspec @@ -19,51 +19,10 @@ dependencies = { } build = { - type = 'builtin', - - modules = { - ['metrics'] = 'metrics/init.lua', - ['metrics.api'] = 'metrics/api.lua', - ['metrics.registry'] = 'metrics/registry.lua', - ['metrics.quantile'] = 'metrics/quantile.lua', - ['metrics.http_middleware'] = 'metrics/http_middleware.lua', - ['metrics.collectors.shared'] = 'metrics/collectors/shared.lua', - ['metrics.collectors.summary'] = 'metrics/collectors/summary.lua', - ['metrics.collectors.counter'] = 'metrics/collectors/counter.lua', - ['metrics.collectors.gauge'] = 'metrics/collectors/gauge.lua', - ['metrics.collectors.histogram'] = 'metrics/collectors/histogram.lua', - ['metrics.const'] = 'metrics/const.lua', - ['metrics.plugins.graphite'] = 'metrics/plugins/graphite.lua', - ['metrics.plugins.prometheus'] = 'metrics/plugins/prometheus.lua', - ['metrics.plugins.json'] = 'metrics/plugins/json.lua', - ['metrics.tarantool'] = 'metrics/tarantool.lua', - ['metrics.tarantool.fibers'] = 'metrics/tarantool/fibers.lua', - ['metrics.tarantool.info'] = 'metrics/tarantool/info.lua', - ['metrics.tarantool.memory'] = 'metrics/tarantool/memory.lua', - ['metrics.tarantool.memtx'] = 'metrics/tarantool/memtx.lua', - ['metrics.tarantool.network'] = 'metrics/tarantool/network.lua', - ['metrics.tarantool.operations'] = 'metrics/tarantool/operations.lua', - ['metrics.tarantool.replicas'] = 'metrics/tarantool/replicas.lua', - ['metrics.tarantool.runtime'] = 'metrics/tarantool/runtime.lua', - ['metrics.tarantool.slab'] = 'metrics/tarantool/slab.lua', - ['metrics.tarantool.spaces'] = 'metrics/tarantool/spaces.lua', - ['metrics.tarantool.system'] = 'metrics/tarantool/system.lua', - ['metrics.tarantool.cpu'] = 'metrics/tarantool/cpu.lua', - ['metrics.tarantool.event_loop'] = 'metrics/tarantool/event_loop.lua', - ['metrics.cartridge.issues'] = 'metrics/cartridge/issues.lua', - ['metrics.cartridge.failover'] = 'metrics/cartridge/failover.lua', - ['metrics.tarantool.clock'] = 'metrics/tarantool/clock.lua', - ['metrics.psutils.cpu'] = 'metrics/psutils/cpu.lua', - ['metrics.psutils.psutils_linux'] = 'metrics/psutils/psutils_linux.lua', - ['metrics.tarantool.luajit'] = 'metrics/tarantool/luajit.lua', - ['metrics.tarantool.vinyl'] = 'metrics/tarantool/vinyl.lua', - ['metrics.utils'] = 'metrics/utils.lua', - ['metrics.cfg'] = 'metrics/cfg.lua', - ['metrics.stash'] = 'metrics/stash.lua', - ['metrics.version'] = 'metrics/version.lua', - ['cartridge.roles.metrics'] = 'cartridge/roles/metrics.lua', - ['cartridge.health'] = 'cartridge/health.lua', - } + type = 'cmake', + variables = { + TARANTOOL_INSTALL_LUADIR = '$(LUADIR)', + }, } -- vim: syntax=lua