-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CMake generation function #1
Comments
Note that this requires that |
Doesn't CMake have a notion of exports? Like when you build LLVM, you get a bunch of files like
Or something similar and get those definitions? Then it's something that just comes along with every installation instead of being something users are expecting to copy-and-paste into their projects. |
And we could do something similar in the main project so that you can get:
To get the path to the main Terra executable. (So |
I've not seen generated find scripts, but even then, it wouldn't generate the logic to create the |
I'm not sure why you don't think it wouldn't work? Using LLVM as an example, here's what I get in an installation of LLVM 3.8.0 (this is the contents of Per the documentation for As best I can tell this is just arbitrary CMake code. There may be conventions but you can really do anything you want. For example, There are also files that seem to sit on the side to provide extra utilities as well, that the user could manually include if they wanted: https://gist.github.com/elliottslaughter/64d5d5d9d9e5cbfc853bac1d32cdc131#file-handlellvmoptions-cmake Anyway, I think LLVM goes a bit far here, and the amount of functionality is a bit overwhelming (and undocumented as best I can tell), but a more modest amount of functionality could be quite welcome, in my opinion, in terms of making things work "out of the box" for users. |
Sorry @elliottslaughter I misunderstood what you were saying. This is exactly how it should work - people should be able to do The above code doesn't define This assumes that |
Doesn't it still work if you install to a local directory, as long as you set |
Yes but I've been using it as a subdirectory for cmake via add_subdirectory, therefore I don't need to search for it - I just use a generator variable substitution to get the full path of the built executable. If it were built and installed, then you'd have to use find_program to get the path of the executable. The check for which strategy to use can be done using Then, the script above would be included by the Terrac cmakelists (making it usable by projects that embed it into their projects) as well as installed to the system's default cmake path (making it usable by projects that just have Terra installed globally). Hopefully that makes sense :) |
Not sure exactly how it should be provided (directly in the CMakeLists.txt here? as a package for
find_package()
?) but here is the toolchain function I've been using to create Terra projects withterrac
:Anyone have any preferences on how this gets distributed?
The text was updated successfully, but these errors were encountered: