Fix uncessary relative dir suffix in pro2cmake.py
When we replace the PWD key from qmake files and both the base and current directory are the same, there's no need to add an extra './' to the current working directory. This also fixes a unit test in qtsvg as it requires the passed in path to match exactly to the one outputed in the log files. Change-Id: Ide9ca6a70493e8039d3af84a9e576d8f6a313f2a Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
9864ff22aa
commit
d908e0a47d
@ -591,10 +591,19 @@ class Scope(object):
|
||||
return result
|
||||
|
||||
def get(self, key: str, *, ignore_includes: bool = False, inherrit: bool = False) -> typing.List[str]:
|
||||
|
||||
is_same_path = self.currentdir == self.basedir
|
||||
|
||||
if key == 'PWD':
|
||||
return ['${CMAKE_CURRENT_SOURCE_DIR}/' + os.path.relpath(self.currentdir, self.basedir),]
|
||||
if is_same_path:
|
||||
return ['${CMAKE_CURRENT_SOURCE_DIR}']
|
||||
else:
|
||||
return ['${CMAKE_CURRENT_SOURCE_DIR}/' + os.path.relpath(self.currentdir, self.basedir),]
|
||||
if key == 'OUT_PWD':
|
||||
return ['${CMAKE_CURRENT_BUILD_DIR}/' + os.path.relpath(self.currentdir, self.basedir),]
|
||||
if is_same_path:
|
||||
return ['${CMAKE_CURRENT_BUILD_DIR}']
|
||||
else:
|
||||
return ['${CMAKE_CURRENT_BUILD_DIR}/' + os.path.relpath(self.currentdir, self.basedir),]
|
||||
|
||||
return self._evalOps(key, None, [], inherrit=inherrit)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user