Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: pylib/gyp/generator/cmake.py

Issue 1408993007: Change CMAKE_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR. (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: fix builddir Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/cmake.py
diff --git a/pylib/gyp/generator/cmake.py b/pylib/gyp/generator/cmake.py
index eece6ea98ddd001072169d924f3b865b984baff6..641edfce1f2fcde1c4b9c43a3ec38c6e4f17b00b 100644
--- a/pylib/gyp/generator/cmake.py
+++ b/pylib/gyp/generator/cmake.py
@@ -55,7 +55,7 @@ generator_default_variables = {
'CONFIGURATION_NAME': '${configuration}',
}
-FULL_PATH_VARS = ('${CMAKE_SOURCE_DIR}', '${builddir}', '${obj}')
+FULL_PATH_VARS = ('${CMAKE_CURRENT_LIST_DIR}', '${builddir}', '${obj}')
generator_supports_multiple_toolsets = True
generator_wants_static_library_dependencies_adjusted = True
@@ -103,7 +103,7 @@ def NormjoinPathForceCMakeSource(base_path, rel_path):
if any([rel_path.startswith(var) for var in FULL_PATH_VARS]):
return rel_path
# TODO: do we need to check base_path for absolute variables as well?
- return os.path.join('${CMAKE_SOURCE_DIR}',
+ return os.path.join('${CMAKE_CURRENT_LIST_DIR}',
os.path.normpath(os.path.join(base_path, rel_path)))
@@ -293,7 +293,7 @@ def WriteActions(target_name, actions, extra_sources, extra_deps,
WriteVariable(output, inputs_name)
output.write('\n')
- output.write(' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
+ output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/')
output.write(path_to_gyp)
output.write('\n')
@@ -398,9 +398,9 @@ def WriteRules(target_name, rules, extra_sources, extra_deps,
output.write(NormjoinPath(path_to_gyp, rule_source))
output.write('\n')
- # CMAKE_SOURCE_DIR is where the CMakeLists.txt lives.
+ # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives.
# The cwd is the current build directory.
- output.write(' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
+ output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/')
output.write(path_to_gyp)
output.write('\n')
@@ -522,7 +522,7 @@ def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output):
WriteVariable(output, copy.inputs_name, ' ')
output.write('\n')
- output.write('WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
+ output.write('WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/')
output.write(path_to_gyp)
output.write('\n')
@@ -1126,7 +1126,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
if cc:
SetVariable(output, 'CMAKE_ASM_COMPILER', cc)
- SetVariable(output, 'builddir', '${CMAKE_BINARY_DIR}')
+ SetVariable(output, 'builddir', '${CMAKE_CURRENT_LIST_DIR}')
bungeman-chromium 2015/11/04 14:55:49 Now this I object to. This change means generated
bungeman-chromium 2015/11/04 15:00:12 Did you want something like CMAKE_CURRENT_BINARY_D
Ian Ni-Lewis (Google) 2015/11/05 13:56:11 That's exactly what I wanted, thanks.
SetVariable(output, 'obj', '${builddir}/obj')
output.write('\n')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698