1414 */
1515class UnixCMakeExecutor extends Executor
1616{
17- protected ?string $ cmake_build_dir = null ;
17+ protected ?string $ build_dir = null ;
1818
1919 protected array $ configure_args = [];
2020
@@ -27,10 +27,10 @@ class UnixCMakeExecutor extends Executor
2727 public function build (string $ build_pos = '.. ' ): void
2828 {
2929 // set cmake dir
30- $ this ->initCMakeBuildDir ();
30+ $ this ->initBuildDir ();
3131
3232 if ($ this ->reset ) {
33- FileSystem::resetDir ($ this ->cmake_build_dir );
33+ FileSystem::resetDir ($ this ->build_dir );
3434 }
3535
3636 // prepare environment variables
@@ -41,7 +41,7 @@ public function build(string $build_pos = '..'): void
4141 ];
4242
4343 // prepare shell
44- $ shell = shell ()->cd ($ this ->cmake_build_dir )->setEnv ($ env );
44+ $ shell = shell ()->cd ($ this ->build_dir )->setEnv ($ env );
4545
4646 // config
4747 $ this ->steps >= 1 && $ shell ->execWithEnv ("cmake {$ this ->getConfigureArgs ()} {$ this ->getDefaultCMakeArgs ()} {$ build_pos }" );
@@ -99,9 +99,9 @@ public function toStep(int $step): static
9999 *
100100 * @param string $dir custom CMake build directory
101101 */
102- public function setCMakeBuildDir (string $ dir ): static
102+ public function setBuildDir (string $ dir ): static
103103 {
104- $ this ->cmake_build_dir = $ dir ;
104+ $ this ->build_dir = $ dir ;
105105 return $ this ;
106106 }
107107
@@ -152,15 +152,12 @@ private function getDefaultCMakeArgs(): string
152152 /**
153153 * Initialize the CMake build directory.
154154 * If the directory is not set, it defaults to the library's source directory with '/build' appended.
155- *
156- * @throws FileSystemException
157155 */
158- private function initCMakeBuildDir (): void
156+ private function initBuildDir (): void
159157 {
160- if ($ this ->cmake_build_dir === null ) {
161- $ this ->cmake_build_dir = "{$ this ->library ->getSourceDir ()}/build " ;
158+ if ($ this ->build_dir === null ) {
159+ $ this ->build_dir = "{$ this ->library ->getSourceDir ()}/build " ;
162160 }
163- FileSystem::resetDir ($ this ->cmake_build_dir );
164161 }
165162
166163 /**
0 commit comments