Skip to content
Snippets Groups Projects
linux_compile_run_cmake.py 555 B
Newer Older
Noé's avatar
Noé committed
#!/bin/bash

import os
import multiprocessing

basedir = os.path.dirname(__file__)

full_path = os.path.dirname(os.path.abspath(__file__))
executable_name = full_path.split('/')[-2]


def run_cmd(cmd):
    full_cmd = ''
    if basedir!='':
        full_cmd = 'cd '+basedir+'; '
    full_cmd += 'cd ..; '+cmd
    print(full_cmd)
    os.system(full_cmd)

run_cmd('python3 scripts/linux_clean.py')

run_cmd('mkdir build/')
run_cmd('cd build/; cmake ..')
run_cmd('cd build/; make -j'+str(multiprocessing.cpu_count()))

run_cmd('cd build/; ./'+executable_name)