File: check_and_install_conda_deps.cmake

package info (click to toggle)
open3d 0.9.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 101,800 kB
  • sloc: cpp: 65,788; ansic: 6,818; python: 5,593; sh: 906; javascript: 213; makefile: 195; ruby: 52
file content (29 lines) | stat: -rw-r--r-- 981 bytes parent folder | download | duplicates (3)
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
# Assert that we're inside a conda environemnt
message(STATUS "Checking Conda environment...")
execute_process(
    COMMAND bash "-c" "conda info | grep -q \"active environment : None\""
    RESULT_VARIABLE return_code
)

if (${return_code})
    message("Conda environment is active.")
else()
    message(FATAL_ERROR "Not in a conda environment: 1) activate conda, 2) rerun cmake and make")
endif()

# Check if conda-build is installed, if not, install it
find_program(CONDA_BUILD "conda-build")
if (NOT CONDA_BUILD)
    message(STATUS "conda-build not found")
    message(STATUS "Trying to install conda-build ...")
    execute_process(
        COMMAND conda install -y -q conda-build
        RESULT_VARIABLE return_code
    )
    find_program(CONDA_BUILD "conda-build")
    if (NOT CONDA_BUILD)
        message(FATAL_ERROR "conda-build installation failed, please install manualy")
    else()
        message(STATUS "conda-build installed at ${CONDA_BUILD}")
    endif()
endif()