summaryrefslogtreecommitdiffstats
path: root/src/cephadm/CMakeLists.txt
blob: 8b969bc33e7b7c4a3969b66c4fe7b254cb9ee32c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if(WITH_TESTS)
  include(AddCephTest)
  add_tox_test(cephadm TOX_ENVS py3 mypy flake8)
endif()

set(bin_target_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cephadm)

add_custom_command(
  OUTPUT "${bin_target_file}"
  DEPENDS
    ${CMAKE_CURRENT_SOURCE_DIR}/cephadm.py
    ${CMAKE_CURRENT_SOURCE_DIR}/build.py
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  COMMAND ${Python3_EXECUTABLE} build.py
    --set-version-var=CEPH_GIT_VER=${CEPH_GIT_VER}
    --set-version-var=CEPH_GIT_NICE_VER=${CEPH_GIT_NICE_VER}
    --set-version-var=CEPH_RELEASE=${CEPH_RELEASE}
    --set-version-var=CEPH_RELEASE_NAME=${CEPH_RELEASE_NAME}
    --set-version-var=CEPH_RELEASE_TYPE=${CEPH_RELEASE_TYPE}
    ${bin_target_file}
)

add_custom_target(cephadm ALL
  DEPENDS "${bin_target_file}")

install(PROGRAMS
  ${bin_target_file}
  DESTINATION ${CMAKE_INSTALL_SBINDIR})