forked from filipdutescu/modern-cpp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Conan.cmake
42 lines (36 loc) · 1.04 KB
/
Conan.cmake
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
34
35
36
37
38
39
40
41
42
if(${PROJECT_NAME}_ENABLE_CONAN)
#
# Setup Conan requires and options here:
#
set(${PROJECT_NAME}_CONAN_REQUIRES "")
set(${PROJECT_NAME}_CONAN_OPTIONS "")
#
# If `conan.cmake` (from https://github.com/conan-io/cmake-conan) does not exist, download it.
#
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(
STATUS
"Downloading conan.cmake from https://github.com/conan-io/cmake-conan..."
)
file(DOWNLOAD "https://github.com/conan-io/cmake-conan/raw/v0.15/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
)
message(STATUS "Cmake-Conan downloaded succesfully.")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_add_remote(NAME bincrafters
URL
https://api.bintray.com/conan/bincrafters/public-conan
)
conan_cmake_run(
REQUIRES
${CONAN_REQUIRES}
OPTIONS
${CONAN_OPTIONS}
BASIC_SETUP
CMAKE_TARGETS # Individual targets to link to
BUILD
missing
)
verbose_message("Conan is setup and all requires have been installed.")
endif()