1111import shutil
1212
1313def extract_cmake_location (file_path ):
14- print "Extracting cmake entry from host config file " , file_path
14+ print ( "Extracting cmake entry from host config file " , file_path )
1515 if os .path .exists (file_path ):
1616 cmake_line_prefix = "# cmake executable path: "
1717 file_handle = open (file_path , "r" )
1818 content = file_handle .readlines ()
1919 for line in content :
2020 if line .startswith (cmake_line_prefix ):
2121 return line .split (" " )[4 ].strip ()
22- print "Could not find a cmake entry in host config file."
22+ print ( "Could not find a cmake entry in host config file." )
2323 return None
2424
2525
@@ -67,7 +67,7 @@ def extract_cmake_location(file_path):
6767
6868args , unknown_args = parser .parse_known_args ()
6969if unknown_args :
70- print "[config-build]: Passing the following unknown arguments directly to cmake... %s" % unknown_args
70+ print ( "[config-build]: Passing the following unknown arguments directly to cmake... %s" % unknown_args )
7171
7272########################
7373# Find CMake Cache File
@@ -81,7 +81,7 @@ def extract_cmake_location(file_path):
8181 platform_info = platform_info [:- 6 ]
8282
8383assert os .path .exists ( cachefile ), "Could not find cmake cache file '%s'." % cachefile
84- print "Using host config file: '%s'." % cachefile
84+ print ( "Using host config file: '%s'." % cachefile )
8585
8686#####################
8787# Setup Build Dir
@@ -97,10 +97,10 @@ def extract_cmake_location(file_path):
9797
9898if os .path .exists (buildpath ):
9999# sys.exit("Build directory '%s' already exists, exiting...")
100- print "Build directory '%s' already exists. Deleting..." % buildpath
100+ print ( "Build directory '%s' already exists. Deleting..." % buildpath )
101101 shutil .rmtree (buildpath )
102102
103- print "Creating build directory '%s'..." % buildpath
103+ print ( "Creating build directory '%s'..." % buildpath )
104104os .makedirs (buildpath )
105105
106106#####################
@@ -117,10 +117,10 @@ def extract_cmake_location(file_path):
117117
118118if os .path .exists (installpath ):
119119# sys.exit("Install directory '%s' already exists, exiting...")
120- print "Install directory '%s' already exists, deleting..." % installpath
120+ print ( "Install directory '%s' already exists, deleting..." % installpath )
121121 shutil .rmtree (installpath )
122122
123- print "Creating install path '%s'..." % installpath
123+ print ( "Creating install path '%s'..." % installpath )
124124os .makedirs (installpath )
125125
126126############################
@@ -163,9 +163,8 @@ def extract_cmake_location(file_path):
163163############################
164164# Run CMake
165165############################
166- print "Changing to build directory..."
166+ print ( "Changing to build directory..." )
167167os .chdir (buildpath )
168- print "Executing cmake line: '%s'" % cmakeline
169- print
168+ print ("Executing cmake line: '%s'\n " % cmakeline )
170169subprocess .call (cmakeline ,shell = True )
171170
0 commit comments