Add camera reboot option

This commit is contained in:
2023-10-15 16:02:24 -05:00
parent 56f98eed60
commit ac7bb9c585
7 changed files with 52 additions and 22 deletions

View File

@ -14,6 +14,7 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# enable ccache
if(NOT DEFINED ENV{BUILDCORE_SUPPRESS_CCACHE})
find_program(CCACHE_PROGRAM ccache)

View File

@ -6,6 +6,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
ifndef USE_CONAN
USE_CONAN=0
endif
ifeq (${OS},Windows_NT)
SHELL := powershell.exe
.SHELLFLAGS := -NoProfile -Command
@ -78,6 +82,7 @@ purge:
${ENV_RUN} ${RM_RF} .current_build
${ENV_RUN} ${RM_RF} ${BUILD_PATH}
${ENV_RUN} ${RM_RF} dist
${ENV_RUN} ${RM_RF} compile_commands.json
.PHONY: test
test: build
${ENV_RUN} mypy ${SCRIPTS}
@ -129,6 +134,8 @@ else
${ENV_RUN} ${VCPKG_DIR}/bootstrap-vcpkg.bat
endif
endif
.PHONY: vcpkg-install
vcpkg-install:
ifneq (${OS},windows)
@ -137,39 +144,30 @@ else
${VCPKG_DIR}/vcpkg install --triplet x64-windows ${VCPKG_PKGS}
endif
else ifdef USE_CONAN # USE_VCPKG ################################################
.PHONY: setup-conan
ifeq (${USE_CONAN},1) # USE_CONAN ################################################
.PHONY: conan-config
conan-config:
${ENV_RUN} conan profile new ${PROJECT_NAME} --detect --force
ifeq ($(OS),linux)
${ENV_RUN} conan profile update settings.compiler.libcxx=libstdc++11 ${PROJECT_NAME}
else
${ENV_RUN} conan profile update settings.compiler.cppstd=20 ${PROJECT_NAME}
ifeq ($(OS),windows)
${ENV_RUN} conan profile update settings.compiler.runtime=static ${PROJECT_NAME}
endif
endif
${ENV_RUN} conan profile detect -f --name ${PROJECT_NAME}
.PHONY: conan
conan:
${ENV_RUN} ${PYBB} conan-install ${PROJECT_NAME}
endif # USE_VCPKG ###############################################
endif # USE_CONAN ###############################################
ifeq (${OS},darwin)
.PHONY: configure-xcode
configure-xcode:
${ENV_RUN} ${SETUP_BUILD} ${VCPKG_TOOLCHAIN} --build_tool=xcode --current_build=0 --build_root=${BUILD_PATH}
${ENV_RUN} ${SETUP_BUILD} ${VCPKG_TOOLCHAIN} --build_tool=xcode --current_build=0 --build_root=${BUILD_PATH} --use_conan=${USE_CONAN}
endif
.PHONY: configure-release
configure-release:
${ENV_RUN} ${SETUP_BUILD} ${VCPKG_TOOLCHAIN} --build_type=release --build_root=${BUILD_PATH}
${ENV_RUN} ${SETUP_BUILD} ${VCPKG_TOOLCHAIN} --build_type=release --build_root=${BUILD_PATH} --use_conan=${USE_CONAN}
.PHONY: configure-debug
configure-debug:
${ENV_RUN} ${SETUP_BUILD} ${VCPKG_TOOLCHAIN} --build_type=debug --build_root=${BUILD_PATH}
${ENV_RUN} ${SETUP_BUILD} ${VCPKG_TOOLCHAIN} --build_type=debug --build_root=${BUILD_PATH} --use_conan=${USE_CONAN}
.PHONY: configure-asan
configure-asan:
${ENV_RUN} ${SETUP_BUILD} ${VCPKG_TOOLCHAIN} --build_type=asan --build_root=${BUILD_PATH}
${ENV_RUN} ${SETUP_BUILD} ${VCPKG_TOOLCHAIN} --build_type=asan --build_root=${BUILD_PATH} --use_conan=${USE_CONAN}

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python3
#
# Copyright 2016 - 2021 gary@drinkingtea.net
# Copyright 2016 - 2023 gary@drinkingtea.net
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@ -74,7 +74,7 @@ def conan() -> int:
return 1
if err != 0:
return err
args = ['conan', 'install', '../', '--build=missing', '-pr', project_name]
args = ['conan', 'install', '../', '-of', '.', '--build=missing', '-pr', project_name]
os.chdir(conan_dir)
err = subprocess.run(args).returncode
if err != 0:

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python3
#
# Copyright 2016 - 2021 gary@drinkingtea.net
# Copyright 2016 - 2023 gary@drinkingtea.net
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@ -28,6 +28,7 @@ def main() -> int:
parser.add_argument('--build_root', help='Path to the root of build directories (must be in project dir)', default='build')
parser.add_argument('--toolchain', help='Path to CMake toolchain file', default='')
parser.add_argument('--current_build', help='Indicates whether or not to make this the active build', default=1)
parser.add_argument('--use_conan', help='Indicates whether or not should use .conanbuild/conan_toolchain.cmake', default='0')
args = parser.parse_args()
if args.build_type == 'asan':
@ -76,6 +77,8 @@ def main() -> int:
'-DBUILDCORE_BUILD_CONFIG={:s}'.format(build_config),
'-DBUILDCORE_TARGET={:s}'.format(args.target),
]
if args.use_conan != '0':
cmake_cmd.append('-DCMAKE_TOOLCHAIN_FILE={:s}'.format('.conanbuild/conan_toolchain.cmake'))
if qt_path != '':
cmake_cmd.append(qt_path)
if platform.system() == 'Windows':