A few minor changes related to building via cmake.

This commit is contained in:
Mike Lischke 2016-05-23 09:40:48 +02:00
parent be65ccd25c
commit 9e30f3f265
3 changed files with 16 additions and 9 deletions

View File

@ -40,6 +40,7 @@ find_package(Java REQUIRED)
file(STRINGS "VERSION" ANTLR_VERSION)
if (WITH_DEMO)
if (NOT ANTLR_JAR_LOCATION)
message(FATAL_ERROR "Missing antlr4.jar location. You can specify it's path using: -DANTLR_JAR_LOCATION=<path>")
else()
@ -50,6 +51,8 @@ else()
message(STATUS "Found ${ANTLR_NAME}: ${ANTLR_JAR_LOCATION}")
endif()
endif()
endif(WITH_DEMO)
set(MY_CXX_WARNING_FLAGS " -Wall -pedantic -W")
# Initialize CXXFLAGS.

View File

@ -44,9 +44,11 @@ Simply open the VS solution (VS 2013+) and build it.
Either open the included XCode project and build that or use the cmake compilation as described for linux.
#### Compiling on Linux
- cd <antlr4-dir>/runtime/Cpp
- cd <antlr4-dir>/runtime/Cpp (this is where this readme is located)
- mkdir build && mkdir run && cd build
- cmake ..-DANTLR_JAR_LOCATION=full/path/to/antlr4-4.5.4-SNAPSHOT.jar -DWITH_DEMO=True
- make
- DESTDIR=<antlr4-dir>/runtime/Cpp/run make install
If you don't want to build the demo then simply run cmake without parameters.

View File

@ -9,3 +9,5 @@ A few steps are necessary to get this to work:
- Run the generation script. This will generate a test parser + lexer, along with listener + visitor classes in a subfolder named "generated". This is where the demo application looks for these files.
- Open the project in the folder that matches your system.
- Compile and run.
Compilation is done as described in the runtime/cpp/readme.md file.