File: ConanSetup.cmake

package info (click to toggle)
hdf5-filter-plugin 0.0~git20221111.49e3b65-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,848 kB
  • sloc: ansic: 14,374; sh: 11,445; cpp: 1,463; makefile: 100; python: 19; xml: 6
file content (28 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (2)
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
#
# setting up conan to be used directly from within cmake
#

#
# looking up the conan executable itself
#
find_program(CONAN NAMES conan PATHS ${CONAN_PATH})
if(CONAN MATCHES CONAN-NOTFOUND)
    message(FATAL_ERROR "Could not find conan executable to install dependencies ${CONAN_PATH}")
else()
    message(STATUS "Found conan: ${CONAN}")
    
    #need to add the directory to the path
    get_filename_component(CONAN_EXEC_PATH ${CONAN} DIRECTORY)
    set(ENV{PATH} "$ENV{PATH}:${CONAN_EXEC_PATH}")
endif()

#
# adding required files to the build directory (fetch everything from github)
#
if(NOT EXISTS ${PROJECT_BINARY_DIR}/conan.cmake)
    message(STATUS "Downloading conan.cmake file from github")
    file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
         ${PROJECT_BINARY_DIR}/conan.cmake)
endif()

include(${PROJECT_BINARY_DIR}/conan.cmake)