google / bazel-to-cmake Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
unable to convert bazel to cmake in apollo source code:https://github.com/ApolloAuto/apollo
it has both files BUILD and Workspace.
user@B45:~/apollo$ python /home/user/bazel-to-cmake/bazel_to_cmake.py CMakeLists.txt
Traceback (most recent call last):
File "/home/user/bazel-to-cmake/bazel_to_cmake.py", line 266, in
execfile("WORKSPACE", GetDict(WorkspaceFileFunctions(converter)))
NameError: name 'execfile' is not defined
Yes,I want it, got any plan?
NameError: name 'execfile' is not defined
Python 2 had the builtin function execfile, which was removed in Python 3.0.
Hi, i do have a project layout like this:
~/prj/WORKSPACE
~/prj/a/b/BUILD
~/prj/a/b/main.cpp
cmake_to_bazel is not able to provide a valid CMakeLists.txt because it assumes a BUILD file in ~/prj/
And even if there was a BUILD file in ~/prj/, the other files deep down the directory are not accessed at all, i.e. only one single CMakeLists.txt is created
This tool does not use Bazel implementation at all. Instead it takes advantage of the fact that Bazel input files are a subset of Python by using Python to evaluate them.
Have you considered using a real Starlark interpreter? For example, https://github.com/google/starlark-go is easy to embed.
hi, I run the command and got the errors blew.
execfile("WORKSPACE", GetDict(WorkspaceFileFunctions(converter)))
File "WORKSPACE", line 81, in
new_local_repository(
NameError: name 'new_local_repository' is not defined
Hi, whoever is working on this, did you consider using bazel query results to build up the cmake files? Similar to this approach: https://github.com/lizan/bazel-cmakelists/
I think the advantage would be, that you'd have a real representation of how the project is supposed to look like, instead of parsing files directly?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.