Skip to content

Commit

Permalink
Add features for factory programming
Browse files Browse the repository at this point in the history
  • Loading branch information
kwagyeman committed Sep 8, 2023
1 parent ed73c1d commit 58afcbf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ def make():
parser.add_argument("--no-sign-installer", action='store_true', default=False,
help = "Don't sign the installer on windows and mac")

parser.add_argument("--factory", action='store_true', default=False,
help = "Build OpenMV IDE for the factory")

args = parser.parse_args()

if args.rpi and not sys.platform.startswith('linux'):
Expand All @@ -321,8 +324,18 @@ def make():
if not os.path.exists(installdir):
os.mkdir(installdir)

cxx_flags_init = ""

if args.factory:
cxx_flags_init += "-DFORCE_FORM_KEY_DIALOG "
cxx_flags_init += "-DFORCE_AUTO_CONNECT "
cxx_flags_init += "-DFORCE_AUTO_UPDATE=release "
cxx_flags_init += "-DFORCE_AUTO_RUN "
cxx_flags_init += "-DFORCE_OVERRIDE_READ_TIMEOUT=3000 "

if args.rpi:
installer_name = "openmv-ide-linux-arm64-" + ideversion + ".tar.gz"
if args.factory: installer_name.replace("openmv", "openmv-factory")
if not args.no_build_application:
if os.system("cd " + builddir +
" && cmake ../qt-creator -Wno-dev" +
Expand All @@ -331,7 +344,7 @@ def make():
" \"-DCMAKE_PREFIX_PATH:PATH=" + qtdir + "\"" +
" \"-DCMAKE_C_COMPILER:FILEPATH=/usr/bin/aarch64-linux-gnu-gcc-9\"" +
" \"-DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/aarch64-linux-gnu-g++-9\"" +
" \"-DCMAKE_CXX_FLAGS_INIT:STRING=\"" +
" \"-DCMAKE_CXX_FLAGS_INIT:STRING=" + cxx_flags_init + "\"" +
" \"-DCMAKE_TOOLCHAIN_FILE:UNINITIALIZED=" + os.path.join(qtdir, "lib/cmake/Qt6/qt.toolchain.cmake") + "\"" +
" && cmake --build . --target all" +
" && cmake --install . --prefix openmv-ide" +
Expand Down Expand Up @@ -382,6 +395,7 @@ def make():

elif sys.platform.startswith('win'):
installer_name = "openmv-ide-windows-" + ideversion
if args.factory: installer_name.replace("openmv", "openmv-factory")
installer_archive_name = installer_name + "-installer-archive.7z"
if not args.no_build_application:
if os.system("cd " + builddir +
Expand All @@ -392,7 +406,7 @@ def make():
" \"-DCMAKE_PREFIX_PATH:PATH=" + qtdir + "\"" +
" \"-DCMAKE_C_COMPILER:FILEPATH=" + os.path.join(mingwdir, "bin/gcc.exe") + "\"" +
" \"-DCMAKE_CXX_COMPILER:FILEPATH=" + os.path.join(mingwdir, "bin/g++.exe") + "\"" +
" \"-DCMAKE_CXX_FLAGS_INIT:STRING=\""
" \"-DCMAKE_CXX_FLAGS_INIT:STRING=" + cxx_flags_init + "\"" +
" && cmake --build . --target all" +
" && cmake --install . --prefix install" +
" && cmake --install . --prefix install --component Dependencies"):
Expand All @@ -417,13 +431,14 @@ def make():

elif sys.platform.startswith('darwin'):
installer_name = "openmv-ide-mac-" + ideversion + ".dmg"
if args.factory: installer_name.replace("openmv", "openmv-factory")
if not args.no_build_application:
if os.system("cd " + builddir +
" && cmake ../qt-creator" +
" \"-DCMAKE_GENERATOR:STRING=Ninja\"" +
" \"-DCMAKE_BUILD_TYPE:STRING=Release\"" +
" \"-DCMAKE_PREFIX_PATH:PATH=" + qtdir + "\"" +
" \"-DCMAKE_CXX_FLAGS_INIT:STRING=\""
" \"-DCMAKE_CXX_FLAGS_INIT:STRING=" + cxx_flags_init + "\"" +
" && cmake --build . --target all" +
" && cmake --install . --prefix . --component Dependencies"):
sys.exit("Make Failed...")
Expand All @@ -447,6 +462,7 @@ def make():

elif sys.platform.startswith('linux'):
installer_name = "openmv-ide-linux-x86_64-" + ideversion
if args.factory: installer_name.replace("openmv", "openmv-factory")
installer_archive_name = installer_name + "-installer-archive.7z"
if not args.no_build_application:
if os.system("cd " + builddir +
Expand All @@ -455,7 +471,7 @@ def make():
" \"-DCMAKE_GENERATOR:STRING=Ninja\"" +
" \"-DCMAKE_BUILD_TYPE:STRING=Release\"" +
" \"-DCMAKE_PREFIX_PATH:PATH=" + qtdir + "\"" +
" \"-DCMAKE_CXX_FLAGS_INIT:STRING=\"" +
" \"-DCMAKE_CXX_FLAGS_INIT:STRING=" + cxx_flags_init + "\"" +
" && cmake --build . --target all" +
" && cmake --install . --prefix install" +
" && cmake --install . --prefix install --component Dependencies"):
Expand Down

0 comments on commit 58afcbf

Please sign in to comment.