-
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.
Adding automated build python script
- Loading branch information
Showing
5 changed files
with
52 additions
and
22 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
Empty file.
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
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 |
---|---|---|
@@ -1,15 +1,57 @@ | ||
|
||
import os | ||
os.chdir(os.path.dirname(os.path.abspath(__file__))) | ||
import glob | ||
|
||
root_bfs_dir = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) | ||
print("Root BFS directory at:", root_bfs_dir) | ||
build_dir = os.path.join(root_bfs_dir, "build") | ||
print("Build directory at:", build_dir) | ||
auto_build_dir = os.path.join(build_dir, "auto_build") | ||
if not os.path.exists(auto_build_dir): | ||
os.mkdir(auto_build_dir) | ||
print("Creating auto build directory...") | ||
print("Auto build directory at:", auto_build_dir) | ||
|
||
print("Changing direcory to auto build dir...") | ||
os.chdir(auto_build_dir) | ||
|
||
cmake_bin = None | ||
|
||
vs_cmake_path_pattern = "C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO\\*\\*\\COMMON*\\IDE\\COMMONEXTENSIONS\\MICROSOFT\\CMAKE\\CMake\\bin\\cmake.exe" | ||
print("Searching for cmake installation in visual studio install location at %s" % vs_cmake_path_pattern) | ||
possible_paths = glob.glob(vs_cmake_path_pattern) | ||
if len(possible_paths) > 0: | ||
cmake_bin = possible_paths[0] | ||
|
||
if cmake_bin is None: | ||
sys_cmake_path_pattern = "C:\\Program Files (x86)\\CMake*\\bin\\cmake.exe" | ||
print("cmake bin\\ not found, searching for system installation at %s" % sys_cmake_bin_directory) | ||
possible_paths = glob.glob(sys_cmake_path_pattern) | ||
if len(possible_paths) > 0: | ||
cmake_bin = possible_paths[0] | ||
|
||
if cmake_bin is None: | ||
print("No cmake directory found, try installing it through visual studio or through your system and retrying!") | ||
quit() | ||
else: | ||
print("Cmake binary location found at: %s" % cmake_bin) | ||
cmake_installation = "C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO\\2019\\COMMUNITY\\COMMON7\\IDE\\COMMONEXTENSIONS\\MICROSOFT\\CMAKE\\CMake\\bin\\cmake.exe" | ||
|
||
compile_command = 'C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO\\2019\\COMMUNITY\\COMMON7\\IDE\\COMMONEXTENSIONS\\MICROSOFT\\CMAKE\\CMake\\bin\\cmake.exe -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:/Users/Greg/Documents/git/bfs/breadcrumbs/install/basic_build" -DCMAKE_INSTALL_PREFIX:PATH="C:/Users/Greg/Documents/git/bfs/breadcrumbs/install/basic_build" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/HostX64/x64/cl.exe" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/HostX64/x64/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO\\2019\\COMMUNITY\\COMMON7\\IDE\\COMMONEXTENSIONS\\MICROSOFT\\CMAKE\\Ninja\\ninja.exe" "C:\\Users\\Greg\\Documents\\git\\bfs\\bfs" 2>&1' | ||
test_command = "C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO\\2019\\COMMUNITY\\COMMON7\\IDE\\COMMONEXTENSIONS\\MICROSOFT\\CMAKE\\CMake\\bin\\cmake.exe -G \"Ninja\" -DCMAKE_INSTALL_PREFIX:PATH=\"C:/Users/Greg/Documents/git/bfs/breadcrumbs/install/basic_build\" -DCMAKE_INSTALL_PREFIX:PATH=\"C:/Users/Greg/Documents/git/bfs/breadcrumbs/install/basic_build\" -DCMAKE_CXX_COMPILER:FILEPATH=\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/HostX64/x64/cl.exe\" -DCMAKE_C_COMPILER:FILEPATH=\"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/HostX64/x64/cl.exe\"" | ||
clean_command = "\"%s\" --clean ..\\.." % cmake_bin | ||
build_command = "\"%s\" --build ." % cmake_bin | ||
|
||
|
||
def start_program(program): | ||
if not isinstance(program, str): | ||
raise ValueError("Argument passed to start_program_sync() should be a string") | ||
return os.system("START /wait \""+ program +"\" CMD /c " + program) | ||
print("\n======> Running command: %s <======" % program) | ||
return os.system("CMD /c \"%s\"" % program) | ||
|
||
|
||
# While located in the bfs\build\auto_build directory... | ||
|
||
# cmake --clean ..\.. | ||
start_program(clean_command) | ||
|
||
start_program(test_command) | ||
# cmake --build . | ||
start_program(build_command) |
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