aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/gn_to_cmake.py
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-05-31 15:04:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-31 19:25:34 +0000
commit82cecb6027e776f18840c4d983f838a285d67a5d (patch)
treee26bdbfde6e7f064439649385c188b4b8c997336 /gn/gn_to_cmake.py
parent2372a3352325bc45ebef8beafb5a9da8b6582f77 (diff)
Make CMakeLists.txt less relative.
Change-Id: I8ac60937d793161b37a3975735d21d93bbe7b216 Reviewed-on: https://skia-review.googlesource.com/131222 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gn/gn_to_cmake.py')
-rw-r--r--gn/gn_to_cmake.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/gn/gn_to_cmake.py b/gn/gn_to_cmake.py
index 0e82d64c9f..eca4c07584 100644
--- a/gn/gn_to_cmake.py
+++ b/gn/gn_to_cmake.py
@@ -624,12 +624,13 @@ def WriteTarget(out, target, project):
def WriteProject(project):
out = open(posixpath.join(project.build_path, 'CMakeLists.txt'), 'w+')
+ extName = posixpath.join(project.build_path, 'CMakeLists.ext')
out.write('# Generated by gn_to_cmake.py.\n')
out.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n')
out.write('cmake_policy(VERSION 2.8.8)\n\n')
out.write('file(WRITE "')
- out.write(posixpath.join(project.build_path, "empty.cpp"))
+ out.write(CMakeStringEscape(posixpath.join(project.build_path, "empty.cpp")))
out.write('")\n')
# Update the gn generated ninja build.
@@ -640,10 +641,12 @@ def WriteProject(project):
out.write(CMakeStringEscape(project.build_path))
out.write('" build.ninja)\n')
- out.write('include(CMakeLists.ext)\n')
+ out.write('include("')
+ out.write(CMakeStringEscape(extName))
+ out.write('")\n')
out.close()
- out = open(posixpath.join(project.build_path, 'CMakeLists.ext'), 'w+')
+ out = open(extName, 'w+')
out.write('# Generated by gn_to_cmake.py.\n')
out.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n')
out.write('cmake_policy(VERSION 2.8.8)\n')