[C++] More modern CMake integration #4418
mcmikecreations
started this conversation in
Ideas
Replies: 1 comment
-
My guess would be that the current approach was chosen with an older cmake version in mind (the example targets 3.7), which didn't have However, I agree that using a more modern FetchContent-based approach would be much more convenient. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! This is mostly a suggestion to @hzeller @parrt @Krzmbrzl and others who worked on the C++ runtime for Antlr.
Runtime warnings aside, I was wondering why there needed to be such a complex CMake setup with
ExternalProject_Add
and the rest ofExternalAntlr4Cpp.cmake
. I tried playing around and got a fully working example with the code below.In it, I download ANTLR C++ Runtime and complete .jar file, then generate a lexer with it. Folder structure:
This example is:
$<TARGET_FILE:antlr4_shared>
CMAKE_BUILD_TYPE
determined by the overall project build type, making debugging easierOf course, this is not the best example there can be and needs further improvements which I don't have the time for, but I feel like it has a better basis without juggling with tons of variables etc.
Beta Was this translation helpful? Give feedback.
All reactions