Assuming I have the following project structure,
| CMakeLists.txt
| run_experiments.py
+---libs
\---src
main.cpp
main.h
how to make run_experiments.py compile the program via CMake and run it multiple times with different command-line arguments? What I've tried:
# run_experiments.py
import os
os.system("mkdir bin build")
os.chdir("build")
os.system('cmake -G"Unix Makefiles" ..')
os.system("make")
# and so on...
But it already looks ugly, and I'm looking for the most elegant and cross-platform solution (Windows with MinGW and Linux, for example).
UPD: Added my CMakeLists.txt, which is CLion default-generated:
cmake_minimum_required(VERSION 3.16)
project(test_tokenizing)
set(CMAKE_CXX_STANDARD 14)
add_executable(test_tokenizing src/main.cpp src/main.h)