-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (C) 2024 Roberto Rossini <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import subprocess as sp | ||
import shutil | ||
import os | ||
|
||
|
||
def find_conan(): | ||
conan = shutil.which("conan") | ||
if conan is None: | ||
raise RuntimeError("Unable to find conan in your PATH.\n" | ||
"Please install conan: https://conan.io/downloads") | ||
|
||
return conan | ||
|
||
|
||
def run_conan_profile_detect(conan): | ||
sp.run(conan, "profile", "detect", stderr=sp.DEVNULL, stdout=sp.DEVNULL) | ||
|
||
|
||
def run_conan_install(conan): | ||
sp.check_call(conan, "install", "../conanfile.txt", "--settings=build_type=Release", | ||
"--settings=compiler.cppstd=17", "--output-folder=conan-staging", | ||
"--build=missing" "--update", stdout=sp.DEVNULL) | ||
|
||
|
||
def main(): | ||
conan = find_conan() | ||
pwd = os.getcwd() | ||
|
||
conandeps_mk = os.path.join(pwd, "conan-staging", "conandeps.mk") | ||
|
||
if os.path.exists(conandeps_mk): | ||
print(conandeps_mk) | ||
return | ||
|
||
conan_home = os.getenv("CONAN_HOME") | ||
if conan_home is not None: | ||
os.makedirs(conan_home, exist_ok=True) | ||
|
||
run_conan_profile_detect(conan) | ||
run_conan_install(conan) | ||
print(conandeps_mk) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters