summaryrefslogtreecommitdiffstats
path: root/src/cephadm/CMakeLists.txt
blob: c8b7c74a985a6af2ed98ee29fa5a41fd1cabdc16 (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
29
30
31
32
33
if(WITH_TESTS)
  include(AddCephTest)
  add_tox_test(cephadm TOX_ENVS __tox_defaults__)
endif()

set(bin_target_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cephadm)

if(NOT DEFINED CEPHADM_BUNDLED_DEPENDENCIES)
  set(CEPHADM_BUNDLED_DEPENDENCIES "pip")
endif()

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}
    --bundled-dependencies=${CEPHADM_BUNDLED_DEPENDENCIES}
    ${bin_target_file}
)

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

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