From 82cecb6027e776f18840c4d983f838a285d67a5d Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Thu, 31 May 2018 15:04:43 -0400 Subject: Make CMakeLists.txt less relative. Change-Id: I8ac60937d793161b37a3975735d21d93bbe7b216 Reviewed-on: https://skia-review.googlesource.com/131222 Reviewed-by: Herb Derby Commit-Queue: Ben Wagner --- gn/gn_to_cmake.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gn/gn_to_cmake.py') 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') -- cgit v1.2.3