Updated build.py to support relative CMake/CTest paths.#205
Conversation
|
|
||
| def resolve_executable_path(command_or_path): | ||
| """Returns the absolute path of an executable.""" | ||
| executable_path = shutil.which(command_or_path) |
There was a problem hiding this comment.
Why adding this function? What if the input is already an absolute path?
There was a problem hiding this comment.
If it's already an absolute path it should be fine. If not, it may not work since the current directory gets changed for some commands. I installed a later cmake version on Linux and gave a relative path from the repo and that didn't work.
There was a problem hiding this comment.
Then why don't you give an absolute path to this script? People often have multiple cmake installed, calling which cmake at here may get unexpected result?
There was a problem hiding this comment.
Giving an absolute path works (which is what I had to do). It seemed like a bug that a relative path does not also work.
For --cmake_path, the default is "cmake". So for the default, I assumed running a cmake command starting with the result of shutil.which("cmake") would be equivalent.
No description provided.