diff --git a/.gitignore b/.gitignore index 366e31e87..1c43702a1 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,8 @@ regressions/eformat-tests/*.txt /src/doc/new-doc/new-doc.fts /src/doc/new-doc/new-doc.cf /src/doc/new-doc/new-doc.cfs +/examples/ecl_qt/qt/ecl_qtdemo +/examples/ecl_qt/hello-lisp-system--all-systems.fasb +/examples/ecl_qt/lisp-envi.a +/examples/ecl_qt/qt/.qmake.stash +/examples/ecl_qt/qt/Makefile diff --git a/examples/ecl_qt/README.md b/examples/ecl_qt/README.md index d37c3622d..7c4c9dc0f 100644 --- a/examples/ecl_qt/README.md +++ b/examples/ecl_qt/README.md @@ -1,4 +1,6 @@ -This demo shows how to embed ECL into Qt5 and serve as kernel. This also discuss how to compile ECL with C++(14). You can extend on this demo to form a more complicate and productive project. +This demo shows how to embed ECL into Qt5 and serve as kernel. This +also discuss how to compile ECL with C++(14). You can extend on this +demo to form a more complicate and productive project. # Preparation Before you build the demo, make sure you have those dependencies installed: @@ -8,24 +10,35 @@ Before you build the demo, make sure you have those dependencies installed: 4. Qt5.x with Qt Creator. 5. Quicklisp installed on your ECL. -We use the external Lisp package :lparallel so you better download that package in advance using (ql:quickload :lparallel). +We use the external Lisp package :lparallel so you better download +that package in advance using `(ql:quickload :lparallel)`. + +# Build -# Build ## Build CL Library and FASB -Run `make` in current directory and you get two files, if successful. `lisp-envi.a` and `hello-lisp-system--all-systems.fasb`. -## Configure your Qt Project -cd to the directory `qt` and open that Qt project with your Qt Creator. Change the three paths I marked for you, if necessary. -1. `INCLUDEPATH`: The path that contains ecl/ecl.h. -In Linux it may be `/usr/include/`. -2. `LIBS`:The path that leads to the shared library of ECL. -In Linux, it may be `/usr/lib/libecl.so/`. -## Build Qt Project -Build your Qt Project. This will generate an executable file for you. -## Engage `fasb` file -After your Qt project is built, move the `hello-lisp-system--all-systems.fasb` file that generated in build step 1 into the directory containing the executable file. + +Run `make` in current directory and you get two files, if +successful. `lisp-envi.a` and `hello-lisp-system--all-systems.fasb`. + +## Configure and build your Qt Project + +To build the example it is enough to change to the `qt/` directory, +generate a Makefile with `qmake` and to call `make`. + +```shell +cd qt/ +qmake +make +``` + +If you want to change your Qt project, open it with the `Qt +Creator`. It can build the executable for you (instead of manually +working with make). # Run -After you go through the steps above, go for the executable file and try that demo. + +After you go through the steps above, go for the executable file and +try that demo. Happy hacking with ECL! diff --git a/examples/ecl_qt/qt/ecl_qtdemo.pro b/examples/ecl_qt/qt/ecl_qtdemo.pro index 8e1692d9f..70e42dbe4 100644 --- a/examples/ecl_qt/qt/ecl_qtdemo.pro +++ b/examples/ecl_qt/qt/ecl_qtdemo.pro @@ -22,11 +22,13 @@ HEADERS += hybrid_main.h \ FORMS += hybrid_main.ui -#The include path that contains ecl/ecl.h -INCLUDEPATH += /usr/local/include -#The ECL shared library directory. -LIBS += /usr/local/lib/libecl.dylib +# The include path that contains ecl/ecl.h +QMAKE_CFLAGS += `ecl-config --cflags` +# The ECL shared library directory. +QMAKE_LFLAGS += `ecl-config --ldflags` -lecl + +# Lisp library written by a user LIBS += $$_PRO_FILE_PWD_/../lisp-envi.a diff --git a/examples/ecl_qt/qt/main.cpp b/examples/ecl_qt/qt/main.cpp index 7c848db0a..330662a46 100644 --- a/examples/ecl_qt/qt/main.cpp +++ b/examples/ecl_qt/qt/main.cpp @@ -2,7 +2,7 @@ #include #include "cl_bridge_utils.hpp" -string CL_MAIN_FASB = "\"hello-lisp-system--all-systems.fasb\""; +string CL_MAIN_FASB = "\"../hello-lisp-system--all-systems.fasb\""; string CL_MAIN_PACKAGE_NAME = "hello-lisp"; /* Initialization.